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
|
|
|
|
|
|
|
if( !$Security->validateToken($token) )
|
|
|
|
{
|
2015-10-20 05:14:28 +02:00
|
|
|
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying 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
|
|
|
|
// ============================================================================
|