Hi all,
I've run in a little problem this morning and wasn't able to find the answer so far, so I hope you guys can help me.
I'm trying to do a ldap_bind then test the value of the bind to make the authentication, but the the bind always return nothing (isn't it supposed to return true or false ?)
My dn and pass are ok, the connection works so I really don't know what I'm doing wrong. Here's my code:
$conLDAP = ldap_connect($ldap_var[db][host], $ldap_var[db][port])
$dn = $sArrayRechLdap[0][7];
$bindLDAP = @ldap_bind($conLDAP, $dn, $mdp);
if ($bindLDAP)
{
$sArrayLDAP = array(trim($sArrayRechLdap[0][0]),
trim($sArrayRechLdap[0][1]),
trim($sArrayRechLdap[0][2]),
trim($sArrayRechLdap[0][3]),
trim($sArrayRechLdap[0][4]),
trim($sArrayRechLdap[0][5]),
trim($sArrayRechLdap[0][6]));
$bGoodLogin = 1;
}
the $dn returns uid=atfrank,ou=Employee,ou=Person,dc=csaff,dc=qc,dc=ca
and the $mdp returns the correct password. However, the it never goes through the If because the $BindLDAP is always nothing.
Hope someone can help me out with this.Thanks for your time and help.
Frank
I've run in a little problem this morning and wasn't able to find the answer so far, so I hope you guys can help me.
I'm trying to do a ldap_bind then test the value of the bind to make the authentication, but the the bind always return nothing (isn't it supposed to return true or false ?)
My dn and pass are ok, the connection works so I really don't know what I'm doing wrong. Here's my code:
$conLDAP = ldap_connect($ldap_var[db][host], $ldap_var[db][port])
$dn = $sArrayRechLdap[0][7];
$bindLDAP = @ldap_bind($conLDAP, $dn, $mdp);
if ($bindLDAP)
{
$sArrayLDAP = array(trim($sArrayRechLdap[0][0]),
trim($sArrayRechLdap[0][1]),
trim($sArrayRechLdap[0][2]),
trim($sArrayRechLdap[0][3]),
trim($sArrayRechLdap[0][4]),
trim($sArrayRechLdap[0][5]),
trim($sArrayRechLdap[0][6]));
$bGoodLogin = 1;
}
the $dn returns uid=atfrank,ou=Employee,ou=Person,dc=csaff,dc=qc,dc=ca
and the $mdp returns the correct password. However, the it never goes through the If because the $BindLDAP is always nothing.
Hope someone can help me out with this.Thanks for your time and help.
Frank