bug #33263 [Ldap] Add missing LdapUser::setPassword() (chalasr)
This PR was merged into the 4.4 branch.
Discussion
----------
[Ldap] Add missing LdapUser::setPassword()
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Required for password migrations.
Commits
-------
08dd4f3ae1
[Ldap] Add missing LdapUser::setPassword()
This commit is contained in:
commit
543e4013d0
@ -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