2015-09-08 02:51:48 +02:00
|
|
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Variables
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Functions
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Main before POST
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// POST Method
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
|
|
|
{
|
2015-10-20 05:14:28 +02:00
|
|
|
$token = isset($_POST['tokenCSRF']) ? Sanitize::html($_POST['tokenCSRF']) : false;
|
2015-09-08 02:51:48 +02:00
|
|
|
|
2015-11-28 15:47:03 +01:00
|
|
|
if( !$Security->validateTokenCSRF($token) )
|
2015-09-08 02:51:48 +02:00
|
|
|
{
|
2015-11-28 15:47:03 +01:00
|
|
|
Log::set(__FILE__.LOG_SEP.'Error occurred when trying to validate the tokenCSRF. Token CSRF ID: '.$token);
|
2015-09-08 02:51:48 +02:00
|
|
|
|
|
|
|
// Destroy the session.
|
|
|
|
Session::destroy();
|
|
|
|
|
|
|
|
// Redirect to login panel.
|
|
|
|
Redirect::page('admin', 'login');
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-10-20 05:14:28 +02:00
|
|
|
unset($_POST['tokenCSRF']);
|
2015-09-08 02:51:48 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Main after POST
|
2015-11-28 15:47:03 +01:00
|
|
|
// ============================================================================
|