LDAP: Don't handle invalid credentials as a connection error

Signed-off-by: Jarkko Lehtoranta <devel@jlranta.com>
This commit is contained in:
Jarkko Lehtoranta 2017-06-13 21:13:40 +03:00
parent 4e2e592635
commit 039a836d4a
1 changed files with 9 additions and 2 deletions

View File

@ -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;