Page 1 of 1

authldap.php & dokeos

Posted: Tue Jan 31, 2012 8:46 am
by superzumo
Hi Guys.

I am a 100% php noob. Basically I was trying to setup proof of concept for a learning management software called Dokeos. Everything was going fine until I came across the LDAP functions.

The first problem was that the script was written for every active directory language besides Microsoft. So I searched around the internet and I found this:

http://pix-mania.dyndns.org/mediawiki/i ... -_authldap

THe link above is essentially my authldap.php file.

The problem I am having is that when I try to log in using an Active Directory user I get 3 errors kicked back to me.

#1 Warning: ldap_search() [function.ldap-search]: Search: Operations error in C:\wamp\www\dokeos\main\auth\ldap\authldap.php on line 368

#2 Warning: ldap_get_entries() expects parameter 2 to be resource, boolean given in C:\wamp\www\dokeos\main\auth\ldap\authldap.php on line 370

Here are lines 365-375 of the file:

365 $ldap_bind_res = ldap_handle_bind($ds,$result);
366 // Execution de la recherche avec $filtre en parametre
367 //error_log('Searching for '.$filter.' on LDAP server',0);
368 $sr=ldap_search($ds,$ldap_basedn,$filter);
369 // La variable $info recoit le resultat de la requete
370 $info = ldap_get_entries($ds, $sr);
371 $dn=($info[0]["dn"]);
372 //affichage debug !! echo"<br> dn = $dn<br> pass = $passwd<br>";
373 // fermeture de la 1ere connexion
374 ldap_close($ds);
375 }

The third error has to do with the newUser.php:

#3 Notice: Undefined variable: _user in C:\wamp\www\dokeos\main\auth\ldap\newUser.php on line 65

Here are lines 63-68:

//error_log('Could not find '.$login.' on LDAP server',0);
$loginFailed = true;
unset($_user['user_id']);
$uidReset = false;
}
?>

Up to this point I've been using basically how-to guides and I follow stuff step by step. Its how I have been able to make all the other php changes for this program. Could anyone give me a hand here with this issue. A push in the right direction would be great.

I'm almost there...I hope.

Thank you!

Phil