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;
|
2018-07-17 19:13:01 +02:00
|
|
|
if( !$security->validateTokenCSRF($token) ) {
|
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
|
|
|
Session::destroy();
|
2017-05-12 20:18:44 +02:00
|
|
|
Redirect::page('login');
|
2015-09-08 02:51:48 +02:00
|
|
|
}
|
2017-05-12 20:18:44 +02:00
|
|
|
else {
|
|
|
|
unset( $_POST['tokenCSRF'] );
|
2015-09-08 02:51:48 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Main after POST
|
2015-11-28 15:47:03 +01:00
|
|
|
// ============================================================================
|