[Ldap] Add missing LdapUser::setPassword()
This commit is contained in:
parent
b7954640e3
commit
08dd4f3ae1
@ -90,6 +90,11 @@ class LdapUser implements UserInterface, EquatableInterface
|
||||
return $this->extraFields;
|
||||
}
|
||||
|
||||
public function setPassword(string $password)
|
||||
{
|
||||
$this->password = $password;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -125,11 +125,9 @@ class LdapUserProvider implements UserProviderInterface, PasswordUpgraderInterfa
|
||||
}
|
||||
|
||||
try {
|
||||
if ($user->isEqualTo($this->loadUserByUsername($user->getUsername()))) {
|
||||
$user->getEntry()->setAttribute($this->passwordAttribute, [$newEncodedPassword]);
|
||||
$this->ldap->getEntryManager()->update($user->getEntry());
|
||||
$user->setPassword($newEncodedPassword);
|
||||
}
|
||||
$user->getEntry()->setAttribute($this->passwordAttribute, [$newEncodedPassword]);
|
||||
$this->ldap->getEntryManager()->update($user->getEntry());
|
||||
$user->setPassword($newEncodedPassword);
|
||||
} catch (ExceptionInterface $e) {
|
||||
// ignore failed password upgrades
|
||||
}
|
||||
|
Reference in New Issue
Block a user