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

View File

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