Fix: on vrifie si le user existe
This commit is contained in:
parent
1f0e74f1f6
commit
d68383340b
@ -111,7 +111,7 @@ function check_user_password_ldap($usertotest,$passwordtotest)
|
||||
{
|
||||
$resultFetchLdapUser = $ldap->fetch($_POST["username"]);
|
||||
// On stop si le mot de passe ldap doit etre modifie sur le domaine
|
||||
if ($resultFetchLdapUser && $ldap->pwdlastset <= 0)
|
||||
if ($resultFetchLdapUser == 1 && $ldap->pwdlastset <= 0)
|
||||
{
|
||||
dolibarr_syslog('functions_ldap::User '.$login.' must change password next logon');
|
||||
if ($ldapdebug) print "DEBUG: User ".$login." must change password<br>\n";
|
||||
|
||||
@ -900,6 +900,7 @@ class Ldap
|
||||
if (! $result)
|
||||
{
|
||||
$this->error = ldap_errno($this->connection)." ".ldap_error($this->connection);
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -916,6 +917,7 @@ class Ldap
|
||||
$this->badpwdtime = $this->convert_time($this->ldap_utf8_decode($result[0]["badpasswordtime"][0]));
|
||||
|
||||
ldap_free_result($this->result);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user