Add session verification to error log flushing.

This commit is contained in:
Aaron van Geffen 2016-09-02 11:45:13 +02:00
parent 196fe6780c
commit 02752798a9
1 changed files with 7 additions and 2 deletions

View File

@ -15,13 +15,18 @@ class ManageErrors extends HTMLController
throw new NotAllowedException();
// Flushing, are we?
if (isset($_POST['flush']))
if (isset($_POST['flush']) && Session::validateSession('get'))
{
ErrorLog::flush();
header('Location: ' . BASEURL . '/manageerrors/');
}
Session::resetSessionToken();
$options = [
'title' => 'Error log',
'form' => [
'action' => BASEURL . '/manageerrors/',
'action' => BASEURL . '/manageerrors/?' . Session::getSessionTokenKey() . '=' . Session::getSessionToken(),
'method' => 'post',
'class' => 'floatright',
'buttons' => [