diff options
author | Jarkko Lehtoranta <devel@jlranta.com> | 2017-06-13 21:13:40 +0300 |
---|---|---|
committer | Jarkko Lehtoranta <devel@jlranta.com> | 2017-07-23 14:50:01 +0300 |
commit | 039a836d4abd0956889aaa4d5cf6f7740a0d2e88 (patch) | |
tree | e2790464c41f24d11fed4e056b11cc0f8ed03c67 /apps/user_ldap/lib/Connection.php | |
parent | 4e2e592635af27c2a8665837769ea8e55acc091f (diff) | |
download | nextcloud-server-039a836d4abd0956889aaa4d5cf6f7740a0d2e88.tar.gz nextcloud-server-039a836d4abd0956889aaa4d5cf6f7740a0d2e88.zip |
LDAP: Don't handle invalid credentials as a connection error
Signed-off-by: Jarkko Lehtoranta <devel@jlranta.com>
Diffstat (limited to 'apps/user_ldap/lib/Connection.php')
-rw-r--r-- | apps/user_ldap/lib/Connection.php | 11 |
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; |