Add user maintenance CLI (#9)
- Add CLI infrastructure - Add user to index page query - Strip tags from title - Move item parsing to FeedItem
This commit is contained in:
@@ -84,6 +84,20 @@ class Security {
|
||||
add_error('Invalid credentials; log on unsuccessful');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the password for the given user
|
||||
*
|
||||
* @param string $email The e-mail address of the user whose password should be updated
|
||||
* @param string $password The new password for this user
|
||||
* @param SQLite3 $db The database connection to use in updating the password
|
||||
*/
|
||||
public static function updatePassword(string $email, string $password, SQLite3 $db): void {
|
||||
$query = $db->prepare('UPDATE frc_user SET password = :password WHERE email = :email');
|
||||
$query->bindValue(':password', password_hash($password, PASSWORD_DEFAULT));
|
||||
$query->bindValue(':email', $email);
|
||||
$query->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Log on the single user
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user