mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-30 09:14:08 +02:00
Do not interrupt authentication chain on invalid ldap connection infos
Catch LdapExceptions and throw AuthenticationException to not interrupt authentication chain fixes #7497
This commit is contained in:
parent
18bd49e636
commit
f9fee2df70
@ -68,8 +68,16 @@ class LdapUserBackend extends UserBackend
|
|||||||
*/
|
*/
|
||||||
public function assertAuthenticationPossible()
|
public function assertAuthenticationPossible()
|
||||||
{
|
{
|
||||||
$q = $this->conn->select()->from($this->userClass);
|
try {
|
||||||
$result = $q->fetchRow();
|
$q = $this->conn->select()->from($this->userClass);
|
||||||
|
$result = $q->fetchRow();
|
||||||
|
} catch (LdapException $e) {
|
||||||
|
throw new AuthenticationException(
|
||||||
|
'Connection not possible: %s',
|
||||||
|
$e->getMessage()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (! isset($result)) {
|
if (! isset($result)) {
|
||||||
throw new AuthenticationException(
|
throw new AuthenticationException(
|
||||||
'No objects with objectClass="%s" in DN="%s" found.',
|
'No objects with objectClass="%s" in DN="%s" found.',
|
||||||
@ -158,7 +166,7 @@ class LdapUserBackend extends UserBackend
|
|||||||
} catch (AuthenticationException $e) {
|
} catch (AuthenticationException $e) {
|
||||||
// Authentication not possible
|
// Authentication not possible
|
||||||
throw new AuthenticationException(
|
throw new AuthenticationException(
|
||||||
'Authentication against backend "%s" not possible: ',
|
'Authentication against backend "%s" not possible: %s',
|
||||||
$this->getName(),
|
$this->getName(),
|
||||||
$e
|
$e
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user