2021-07-24 15:12:19 -04:00
|
|
|
<?php
|
|
|
|
require_once('includes/common.php');
|
|
|
|
require_once('includes/functions.php');
|
|
|
|
|
2022-03-12 13:56:32 -05:00
|
|
|
use PonePaste\Helpers\SessionHelper;
|
|
|
|
|
2021-07-24 15:12:19 -04:00
|
|
|
if ($_SERVER['REQUEST_METHOD'] !== 'POST' || $current_user === null) {
|
|
|
|
header('Location: ' . $_SERVER['HTTP_REFERER']);
|
|
|
|
die();
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Destroy remember token */
|
2022-03-12 13:56:32 -05:00
|
|
|
SessionHelper::destroySession();
|
2021-07-24 15:12:19 -04:00
|
|
|
|
|
|
|
/* Destroy PHP session */
|
|
|
|
unset($_SESSION['user_id']);
|
|
|
|
session_destroy();
|
|
|
|
|
|
|
|
header('Location: ' . $_SERVER['HTTP_REFERER']);
|