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