2016-10-27 11:22:04 +00:00
|
|
|
<?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'];
|
|
|
|
|
2018-05-11 09:25:10 +00:00
|
|
|
$db->query ('CALL account.myUserChangePassword (#, #)',
|
2016-10-27 11:22:04 +00:00
|
|
|
[$oldPassword, $newPassword]);
|
2017-05-02 12:33:48 +00:00
|
|
|
Account::sync ($db, $_SESSION['user'], $newPassword);
|
2016-10-27 11:22:04 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|