Bienvenue, Invité
Nom d'utilisateur : Mot de passe : Se souvenir de moi

SUJET : Problem trying to get the web server auth running

Problem trying to get the web server auth running il y a 1 an 3 mois #94925

  • jowen
  • Portrait de jowen
  • Hors ligne
  • Fresh Lemon
  • Messages : 1
  • Karma: 0
Hi,
I have recently been using your product and think it is great. I am not new to PHP however have been really struggling to get the web server authentication to work. I have read the docs and while this subject is spoken about I just need some help to get it running.

I am authenticating all users via a MYSQL database login form and not via HTTP. I planned to use cURL to call lime survey. My code I have been using is below and it simply is not working. I think the issue I am having is passing the authenticated user.

Am I completely off the mark for this integration or is there something very minor I am missing?
The build I am using is the latest stable release 200 build number 130406

Thanks in advance
Jamie
$cred = "user";
 
$data = array();
$data[] = "Authorization: Basic ". base64_encode($cred);
 
$ch = curl_init(); 
$timeout = 30;
curl_setopt($ch, CURLOPT_URL, $request_url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_HTTPHEADER, $data); 
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($ch, CURLOPT_UNRESTRICTED_AUTH, 1);  
$output = curl_exec($ch);
 
if ($output === FALSE) {  
echo "cURL Error: " . curl_error($ch);    
}else
{
echo $output;
}
 
curl_close($ch);
L'administrateur a désactivé l'accès en écriture pour le public.

Problem trying to get the web server auth running il y a 1 an 3 mois #94927

  • mdekker
  • Portrait de mdekker
  • Hors ligne
  • LimeSurvey Team
  • Messages : 341
  • Remerciements reçus 68
  • Karma: 38
You don't need to do php coding if you use webserver authentication: the webserver handles that for you when configured right. Google on "apache auth mysql" to get some info on how to set this up.

If you want to authenticate in limesurvey via a different mysql database then the one limesurvey uses, you should wait for 2.05 (which is beta now) and write a different authentication plugin.
---
Menno Dekker
L'administrateur a désactivé l'accès en écriture pour le public.
Modérateurs: ITEd
Temps de génération de la page : 0.185 secondes
Donation Image