2021-03-31 10:18:25 +00:00
|
|
|
<?php
|
|
|
|
|
2021-03-31 10:33:30 +00:00
|
|
|
include __DIR__.'/account.php';
|
2021-03-31 10:18:25 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Restores the user password.
|
2022-05-26 06:08:31 +00:00
|
|
|
*/
|
2021-03-31 10:18:25 +00:00
|
|
|
class RestorePassword extends Vn\Web\JsonRequest {
|
|
|
|
const PARAMS = ['verificationToken', 'newPassword'];
|
|
|
|
|
|
|
|
function run($db) {
|
|
|
|
$verificationToken = $_REQUEST['verificationToken'];
|
|
|
|
$newPassword = $_REQUEST['newPassword'];
|
|
|
|
|
|
|
|
$db->query('CALL account.myUser_restorePassword(#, #)',
|
|
|
|
[$verificationToken, $newPassword]);
|
|
|
|
Account::sync($db, $_SESSION['user'], $newPassword);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|