mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-01-06 15:43:01 +01:00
Add nonce verification to all get requests with the task param
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user