diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2021-03-03 08:34:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-03 08:34:50 +0100 |
commit | 7c8c8902fa6355816d7f339151574bd6c3a14016 (patch) | |
tree | 5033d2fc2be38f2d5fda85abd2ceb16b52389d03 /apps | |
parent | 2a66d4e5d15ba2afe024d8ee8698c065ef8e438c (diff) | |
parent | 9d937489db916667268481328e03d85533bed481 (diff) | |
download | nextcloud-server-7c8c8902fa6355816d7f339151574bd6c3a14016.tar.gz nextcloud-server-7c8c8902fa6355816d7f339151574bd6c3a14016.zip |
Merge pull request #25899 from nextcloud/backport/25860/stable21
[stable21] do not die after LDAP auth failed with expired acc
Diffstat (limited to 'apps')
-rw-r--r-- | apps/user_ldap/lib/Connection.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/user_ldap/lib/Connection.php b/apps/user_ldap/lib/Connection.php index 9a99b94689f..6ba21c6de2c 100644 --- a/apps/user_ldap/lib/Connection.php +++ b/apps/user_ldap/lib/Connection.php @@ -676,9 +676,12 @@ class Connection extends LDAPUtility { 'Bind failed: ' . $errno . ': ' . $this->ldap->error($cr), ILogger::WARN); - // Set to failure mode, if LDAP error code is not LDAP_SUCCESS or LDAP_INVALID_CREDENTIALS - // or (needed for Apple Open Directory:) LDAP_INSUFFICIENT_ACCESS - if ($errno !== 0 && $errno !== 49 && $errno !== 50) { + // Set to failure mode, if LDAP error code is not one of + // - LDAP_SUCCESS (0) + // - 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; } |