LDAP: Don't handle invalid credentials as a connection error
Signed-off-by: Jarkko Lehtoranta <devel@jlranta.com>
This commit is contained in:
parent
4e2e592635
commit
039a836d4a
|
@ -617,10 +617,17 @@ class Connection extends LDAPUtility {
|
||||||
$this->configuration->ldapAgentName,
|
$this->configuration->ldapAgentName,
|
||||||
$this->configuration->ldapAgentPassword);
|
$this->configuration->ldapAgentPassword);
|
||||||
if(!$ldapLogin) {
|
if(!$ldapLogin) {
|
||||||
|
$errno = $this->ldap->errno($cr);
|
||||||
|
|
||||||
\OCP\Util::writeLog('user_ldap',
|
\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);
|
\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 false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue