summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/user_ldap/lib/Connection.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/user_ldap/lib/Connection.php b/apps/user_ldap/lib/Connection.php
index d0cf87299aa..d3da4f8dadc 100644
--- a/apps/user_ldap/lib/Connection.php
+++ b/apps/user_ldap/lib/Connection.php
@@ -617,10 +617,17 @@ class Connection extends LDAPUtility {
$this->configuration->ldapAgentName,
$this->configuration->ldapAgentPassword);
if(!$ldapLogin) {
+ $errno = $this->ldap->errno($cr);
+
\OCP\Util::writeLog('user_ldap',
- 'Bind failed: ' . $this->ldap->errno($cr) . ': ' . $this->ldap->error($cr),
+ 'Bind failed: ' . $errno . ': ' . $this->ldap->error($cr),
\OCP\Util::WARN);
- $this->ldapConnectionRes = null;
+
+ // Set to failure mode, if LDAP error code is not LDAP_SUCCESS or LDAP_INVALID_CREDENTIALS
+ if($errno !== 0x00 && $errno !== 0x31) {
+ $this->ldapConnectionRes = null;
+ }
+
return false;
}
return true;