Merge pull request 'For compatibility with the ldap_*() functions of PHP 8.1+' (#18) from fix_issue15_error_500_on_log_in into master
All checks were successful
gitea/evoadmin-mail/pipeline/head This commit looks good
All checks were successful
gitea/evoadmin-mail/pipeline/head This commit looks good
Reviewed-on: #18
This commit is contained in:
commit
532e3d054a
1 changed files with 6 additions and 3 deletions
|
@ -77,10 +77,13 @@ class LdapServer {
|
|||
|
||||
public function login($password) {
|
||||
$sr=ldap_search($this->conn, self::getBaseDN($this), "(&(uid=".$this->login.")(isAdmin=TRUE))");
|
||||
|
||||
if ($sr !== false) {
|
||||
$info = ldap_get_entries($this->conn, $sr);
|
||||
if (!$info['count']) {
|
||||
Logger::error('Invalid login for '.$this->login);
|
||||
throw new Exception("Échec de l'authentification, utilisateur ou mot de passe incorrect.");
|
||||
if ($info == false || !$info['count']) {
|
||||
Logger::error('Invalid login for '.$this->login);
|
||||
throw new Exception("Échec de l'authentification, utilisateur ou mot de passe incorrect.");
|
||||
}
|
||||
}
|
||||
|
||||
if (!@ldap_bind($this->conn, $info[0]['dn'], $password)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue