phpmyadmin/libraries/entry_points/logout.php
Maurício Meneghini Fauth 84cb56ab4d Use the router for the logout page
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2019-08-19 22:47:53 -03:00

25 lines
472 B
PHP

<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Logout script
*
* @package PhpMyAdmin
*/
declare(strict_types=1);
use PhpMyAdmin\Core;
use PhpMyAdmin\Plugins\AuthenticationPlugin;
if (! defined('PHPMYADMIN')) {
exit;
}
global $auth_plugin, $token_mismatch;
if ($_SERVER['REQUEST_METHOD'] != 'POST' || $token_mismatch) {
Core::sendHeaderLocation('./index.php');
} else {
/** @var AuthenticationPlugin $auth_plugin */
$auth_plugin->logOut();
}