do not die after LDAP auth failed with expired acc

- some servers return error code 53

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2021-03-01 19:20:05 +01:00 committed by backportbot[bot]
parent 3177ab8ba9
commit 4b3961c412
1 changed files with 6 additions and 3 deletions

View File

@ -671,9 +671,12 @@ class Connection extends LDAPUtility {
'Bind failed: ' . $errno . ': ' . $this->ldap->error($cr), 'Bind failed: ' . $errno . ': ' . $this->ldap->error($cr),
ILogger::WARN); ILogger::WARN);
// Set to failure mode, if LDAP error code is not LDAP_SUCCESS or LDAP_INVALID_CREDENTIALS // Set to failure mode, if LDAP error code is not one of
// or (needed for Apple Open Directory:) LDAP_INSUFFICIENT_ACCESS // - LDAP_SUCCESS (0)
if ($errno !== 0 && $errno !== 49 && $errno !== 50) { // - LDAP_INVALID_CREDENTIALS (49)
// - LDAP_INSUFFICIENT_ACCESS (50, spotted Apple Open Directory)
// - LDAP_UNWILLING_TO_PERFORM (53, spotted eDirectory)
if (!in_array($errno, [0, 49, 50, 53], true)) {
$this->ldapConnectionRes = null; $this->ldapConnectionRes = null;
} }