Ldap\Connection: Return false if nothing is found for fetchRow()
This should behave like DbConnection::fetchRow(). refs #8954
This commit is contained in:
parent
15220da645
commit
6d8c56a12f
|
@ -325,7 +325,7 @@ class LdapUserBackend extends LdapRepository implements UserBackendInterface
|
||||||
throw new AuthenticationException('Connection not possible.', $e);
|
throw new AuthenticationException('Connection not possible.', $e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result === null) {
|
if ($result === false) {
|
||||||
throw new AuthenticationException(
|
throw new AuthenticationException(
|
||||||
'No objects with objectClass "%s" in DN "%s" found. (Filter: %s)',
|
'No objects with objectClass "%s" in DN "%s" found. (Filter: %s)',
|
||||||
$this->userClass,
|
$this->userClass,
|
||||||
|
|
|
@ -235,7 +235,7 @@ class Connection implements Selectable
|
||||||
$query->limit(1);
|
$query->limit(1);
|
||||||
$query->setUsePagedResults(false);
|
$query->setUsePagedResults(false);
|
||||||
$results = $this->fetchAll($query, $fields);
|
$results = $this->fetchAll($query, $fields);
|
||||||
return array_shift($results);
|
return array_shift($results) ?: false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue