22 lines
460 B
PHP
22 lines
460 B
PHP
|
<?php
|
||
|
|
||
|
use Vn\Web;
|
||
|
|
||
|
/**
|
||
|
* Restores the user password.
|
||
|
**/
|
||
|
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;
|
||
|
}
|
||
|
}
|
||
|
|