1
0
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:
Marco
2018-03-21 02:55:31 +01:00
parent 05165a44a6
commit d7d9899167

View File

@@ -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']);
} }
/** /**