Skip to content

Commit 7c8c890

Browse files
authored
Merge pull request #25899 from nextcloud/backport/25860/stable21
[stable21] do not die after LDAP auth failed with expired acc
2 parents 2a66d4e + 9d93748 commit 7c8c890

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

apps/user_ldap/lib/Connection.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -676,9 +676,12 @@ public function bind() {
676676
'Bind failed: ' . $errno . ': ' . $this->ldap->error($cr),
677677
ILogger::WARN);
678678

679-
// Set to failure mode, if LDAP error code is not LDAP_SUCCESS or LDAP_INVALID_CREDENTIALS
680-
// or (needed for Apple Open Directory:) LDAP_INSUFFICIENT_ACCESS
681-
if ($errno !== 0 && $errno !== 49 && $errno !== 50) {
679+
// Set to failure mode, if LDAP error code is not one of
680+
// - LDAP_SUCCESS (0)
681+
// - LDAP_INVALID_CREDENTIALS (49)
682+
// - LDAP_INSUFFICIENT_ACCESS (50, spotted Apple Open Directory)
683+
// - LDAP_UNWILLING_TO_PERFORM (53, spotted eDirectory)
684+
if (!in_array($errno, [0, 49, 50, 53], true)) {
682685
$this->ldapConnectionRes = null;
683686
}
684687

0 commit comments

Comments
 (0)