Check the hash of the token that was POSTed with the token in the session.

pull/253/head
Levi 2016-01-30 15:27:52 -05:00
parent 861c0eadb4
commit 81bef8d973
1 changed files with 4 additions and 2 deletions

View File

@ -237,8 +237,10 @@ class UserController extends AbstractController {
return $this->executeIndex();
}
$user_id = (isset($_GET['id'])) ? intval($_GET['id']) : 0;
$fields = array('name', 'user_name', 'password', 'password_repeat', 'level', 'mobile', 'pushover_key', 'pushover_device', 'email');
if (!hash_equals($_POST['token'], $_SESSION['token'])) {
return $this->executeIndex();
}
$fields = array('name', 'user_name', 'password', 'password_repeat', 'level', 'mobile', 'pushover_key', 'pushover_device', 'email', 'token');
$clean = array();
foreach($fields as $field) {
if(isset($_POST[$field])) {