13
thanks your work.
I wanted to check the LDAP password.
I added LDAP password check to your code.
function LDAPAuthentication($criteria = null)
{
$uid_attr = "uid";
$mail_attr = "mail";
$name_attr = "cn";
$pass_attr = "userpassword";
.
.
.
// Get info from LDAP (mail,name)
$sr = ldap_search($ds,$base_dn,$uid_attr."=".$criteria->crit
eriaElements[0]->value,Array($mail_attr,$name_attr,$pass_attr));
.
.
.
if ($info["count"] == 1) {
$ldap_pass = ereg_replace("{CRYPT}", "", $info[0]["userpa
ssword"][0]);
if ($ldap_pass == crypt($pass, substr($ldap_pass,0,2))) {
// Search user in the DB
.
.
.
}
.
.
.