hedera-web/rest/core/change-password.php

24 lines
471 B
PHP
Raw Normal View History

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'];
$db->query ('CALL account.userChangePassword (#, #)',
[$oldPassword, $newPassword]);
Account::sync ($db, $_SESSION['user'], $newPassword, Account::PASS | Account::USER);
2016-10-27 11:22:04 +00:00
return TRUE;
}
}