public function SimpleLdapUser::authenticate in Simple LDAP 7.2
Same name and namespace in other branches
- 7 simple_ldap_user/SimpleLdapUser.class.php \SimpleLdapUser::authenticate()
Authenticates this user with the given password.
Parameters
string $password: The password to use for authentication.
Return value
boolean TRUE on success, FALSE on failure
File
- simple_ldap_user/
SimpleLdapUser.class.php, line 255 - Class defining a simple LDAP user.
Class
- SimpleLdapUser
- @file Class defining a simple LDAP user.
Code
public function authenticate($password) {
if ($this->exists) {
if ($password[0] === chr(0)) {
$password[0] = chr(0x20);
}
$auth = $this->server
->bind($this->dn, $password);
return $auth;
}
return FALSE;
}