Fix exception when the password of a valid ldap user is invalid

This commit is contained in:
Johannes Meyer 2014-01-29 10:41:17 +01:00
parent 8e645d0410
commit 0b28bd31e5
1 changed files with 2 additions and 5 deletions

View File

@ -159,15 +159,12 @@ class LdapUserBackend implements UserBackend
*/
public function authenticate(Credential $credentials)
{
if (!$this->connection->testCredentials(
if ($this->connection->testCredentials(
$this->connection->fetchDN($this->selectUsername($credentials->getUsername())),
$credentials->getPassword()
)) {
return false;
return new User($credentials->getUsername());
}
$user = new User($credentials->getUsername());
return $user;
}
/**