2016-10-27 11:22:04 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
include __DIR__.'/account.php';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Updates the user password.
|
2016-12-20 09:32:17 +00:00
|
|
|
*/
|
2016-10-27 11:22:04 +00:00
|
|
|
class ChangePassword extends Vn\Web\JsonRequest
|
|
|
|
{
|
|
|
|
const PARAMS = ['newPassword'];
|
|
|
|
|
|
|
|
function run ($db)
|
|
|
|
{
|
|
|
|
$newPassword = $_REQUEST['newPassword'];
|
|
|
|
$oldPassword = $_REQUEST['oldPassword'];
|
|
|
|
|
|
|
|
$db->query ('CALL account.userChangePassword (#, #)',
|
|
|
|
[$oldPassword, $newPassword]);
|
2016-12-05 12:39:29 +00:00
|
|
|
Account::sync ($db, $_SESSION['user'], $newPassword, Account::PASS | Account::USER);
|
2016-10-27 11:22:04 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|