diff --git a/library/Icinga/Authentication/User/LdapUserBackend.php b/library/Icinga/Authentication/User/LdapUserBackend.php index cec74a6e5..981ed9331 100644 --- a/library/Icinga/Authentication/User/LdapUserBackend.php +++ b/library/Icinga/Authentication/User/LdapUserBackend.php @@ -325,7 +325,7 @@ class LdapUserBackend extends LdapRepository implements UserBackendInterface throw new AuthenticationException('Connection not possible.', $e); } - if ($result === null) { + if ($result === false) { throw new AuthenticationException( 'No objects with objectClass "%s" in DN "%s" found. (Filter: %s)', $this->userClass, diff --git a/library/Icinga/Protocol/Ldap/Connection.php b/library/Icinga/Protocol/Ldap/Connection.php index c2758154a..f5ca017f3 100644 --- a/library/Icinga/Protocol/Ldap/Connection.php +++ b/library/Icinga/Protocol/Ldap/Connection.php @@ -235,7 +235,7 @@ class Connection implements Selectable $query->limit(1); $query->setUsePagedResults(false); $results = $this->fetchAll($query, $fields); - return array_shift($results); + return array_shift($results) ?: false; } /**