Unverified Commit 0b153aba authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:ambulance: fix(core) Correctly detect LDAP error during login.

Avoids PHP errors and shows the actual LDAP error when there is a
 problem for fetching connected user.

issue #6175
Showing with 4 additions and 1 deletion
+4 -1
......@@ -1119,7 +1119,7 @@ class LDAP
if ($this->error == 'Success') {
return 0;
} else {
return ldap_errno($this->cid);
return @ldap_errno($this->cid);
}
}
......
......@@ -87,6 +87,9 @@ class userinfo
$ldap = $config->get_ldap_link();
$ldap->cat($this->dn, ['*']);
$attrs = $ldap->fetch(TRUE);
if (!$ldap->success()) {
throw new FusionDirectoryLdapError($this->dn, LDAP_SEARCH, $ldap->get_error(), $ldap->get_errno());
}
$this->uid = $attrs['uid'][0];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment