mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-19 00:25:18 +00:00
Can use security answers to create password reset token
This commit is contained in:
@ -291,6 +291,25 @@ class AccountComponent {
|
||||
return CS::get()->db->updateDB(self::USER_TABLE, "ID = ?", $modif, array($userID));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set new password reset token for an account
|
||||
*
|
||||
* @param int $userID Target user ID
|
||||
* @param string $token The new token to apply
|
||||
* @return bool TRUE for a success / FALSE else
|
||||
*/
|
||||
public function set_new_password_reset_token(int $userID, string $token) : bool {
|
||||
|
||||
//Prepare database update
|
||||
$modifs = array(
|
||||
"pasword_reset_token" => $token,
|
||||
"password_reset_token_time_create" => time()
|
||||
);
|
||||
|
||||
//Apply update
|
||||
return cs()->db->updateDB(self::USER_TABLE, "ID = ?", $modifs, array($userID));
|
||||
}
|
||||
|
||||
/**
|
||||
* Crypt user password
|
||||
*
|
||||
|
Reference in New Issue
Block a user