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:
2024-04-27 13:01:57 -04:00
parent 7b21b86550
commit c1790b58fd
8 changed files with 318 additions and 76 deletions

View File

@@ -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
*