Add nonce verification to all get requests with the task param

This commit is contained in:
Flavio Copes
2015-11-19 22:54:17 +01:00
parent 0e4b451f80
commit 1f6bda7d75

View File

@@ -94,10 +94,17 @@ class AdminController
}
unset($this->post['admin-nonce']);
} else {
if ($this->task == 'logout') {
if ($this->task == 'logout') {
$nonce = $this->grav['uri']->param('logout-nonce');
if (!isset($nonce) || !Utils::verifyNonce($nonce, 'logout-form')) {
return;
$this->admin->setMessage('Unauthorized', 'error');
return false;
}
} else {
$nonce = $this->grav['uri']->param('admin-nonce');
if (!isset($nonce) || !Utils::verifyNonce($nonce, 'admin-form')) {
$this->admin->setMessage('Unauthorized', 'error');
return false;
}
}
}