mirror of
https://github.com/delight-im/PHP-Auth.git
synced 2025-08-04 15:17:28 +02:00
Use 'changePasswordForUserById' for 'changePasswordForUserByUsername'
This commit is contained in:
@@ -401,19 +401,15 @@ final class Administration extends UserManager {
|
|||||||
* @throws AuthError if an internal problem occurred (do *not* catch)
|
* @throws AuthError if an internal problem occurred (do *not* catch)
|
||||||
*/
|
*/
|
||||||
public function changePasswordForUserByUsername($username, $newPassword) {
|
public function changePasswordForUserByUsername($username, $newPassword) {
|
||||||
$newPassword = self::validatePassword($newPassword);
|
|
||||||
|
|
||||||
$userData = $this->getUserDataByUsername(
|
$userData = $this->getUserDataByUsername(
|
||||||
\trim($username),
|
\trim($username),
|
||||||
[ 'id' ]
|
[ 'id' ]
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->updatePasswordInternal(
|
$this->changePasswordForUserById(
|
||||||
(int) $userData['id'],
|
(int) $userData['id'],
|
||||||
$newPassword
|
$newPassword
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->deleteRememberDirectiveForUserById((int) $userData['id']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user