]> source.dussan.org Git - nextcloud-server.git/commitdiff
do not die after LDAP auth failed with expired acc 25900/head
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Mon, 1 Mar 2021 18:20:05 +0000 (19:20 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Tue, 2 Mar 2021 20:40:06 +0000 (20:40 +0000)
- some servers return error code 53

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
apps/user_ldap/lib/Connection.php

index 431f395e50df08180895e28636bac595f7d97cd5..dd1d966361b517527683e7aa41e941746c0d9ba6 100644 (file)
@@ -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;
                        }