summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2021-03-03 08:35:21 +0100
committerGitHub <noreply@github.com>2021-03-03 08:35:21 +0100
commit4a111afc8d0e671b5c69f5fff8c2b28587df2c7e (patch)
treedc176d5d69023cbd0646d8e69a42882b623df760
parent7d5f7cef93f600c64e22e5149c988964b4aee356 (diff)
parent4b3961c41236bcf6f64567b8838bdf5308469ffa (diff)
downloadnextcloud-server-4a111afc8d0e671b5c69f5fff8c2b28587df2c7e.tar.gz
nextcloud-server-4a111afc8d0e671b5c69f5fff8c2b28587df2c7e.zip
Merge pull request #25901 from nextcloud/backport/25860/stable19
[stable19] do not die after LDAP auth failed with expired acc
-rw-r--r--apps/user_ldap/lib/Connection.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/user_ldap/lib/Connection.php b/apps/user_ldap/lib/Connection.php
index 539e3f28518..09733b7ca9f 100644
--- a/apps/user_ldap/lib/Connection.php
+++ b/apps/user_ldap/lib/Connection.php
@@ -671,9 +671,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;
}