22 lines
437 B
PHP
22 lines
437 B
PHP
<?php
|
|
|
|
include __DIR__.'/account.php';
|
|
|
|
/**
|
|
* Updates the user password.
|
|
**/
|
|
class ChangePassword extends Vn\Web\JsonRequest {
|
|
const PARAMS = ['newPassword'];
|
|
|
|
function run($db) {
|
|
$newPassword = $_REQUEST['newPassword'];
|
|
$oldPassword = $_REQUEST['oldPassword'];
|
|
|
|
$db->query('CALL account.myUserChangePassword(#, #)',
|
|
[$oldPassword, $newPassword]);
|
|
Account::sync($db, $_SESSION['user'], $newPassword);
|
|
return TRUE;
|
|
}
|
|
}
|
|
|