mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
Ldap\Connection: Do not suppress errors for failed credential tests
This commit is contained in:
parent
5fd2eb639a
commit
197861efda
@ -32,6 +32,7 @@ class Connection implements Selectable
|
|||||||
const LDAP_NO_SUCH_OBJECT = 32;
|
const LDAP_NO_SUCH_OBJECT = 32;
|
||||||
const LDAP_SIZELIMIT_EXCEEDED = 4;
|
const LDAP_SIZELIMIT_EXCEEDED = 4;
|
||||||
const LDAP_ADMINLIMIT_EXCEEDED = 11;
|
const LDAP_ADMINLIMIT_EXCEEDED = 11;
|
||||||
|
const LDAP_INVALID_CREDENTIALS = 49;
|
||||||
const PAGE_SIZE = 1000;
|
const PAGE_SIZE = 1000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -557,15 +558,9 @@ class Connection implements Selectable
|
|||||||
{
|
{
|
||||||
$this->connect();
|
$this->connect();
|
||||||
|
|
||||||
$r = @ldap_bind($this->ds, $username, $password);
|
$success = @ldap_bind($this->ds, $username, $password);
|
||||||
if ($r) {
|
if (! $success) {
|
||||||
Logger::debug(
|
if (ldap_errno($this->ds) === self::LDAP_INVALID_CREDENTIALS) {
|
||||||
'Successfully tested LDAP credentials (%s / %s)',
|
|
||||||
$username,
|
|
||||||
'***'
|
|
||||||
);
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
Logger::debug(
|
Logger::debug(
|
||||||
'Testing LDAP credentials (%s / %s) failed: %s',
|
'Testing LDAP credentials (%s / %s) failed: %s',
|
||||||
$username,
|
$username,
|
||||||
@ -574,6 +569,11 @@ class Connection implements Selectable
|
|||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
throw new LdapException(ldap_error($this->ds));
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user