phpmyadmin/logout.php
Maurício Meneghini Fauth 4bc08bb098 Fix some errors detected by PHPStan
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2019-07-31 20:59:24 -03:00

27 lines
571 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('ROOT_PATH')) {
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
}
global $auth_plugin, $token_mismatch;
require_once ROOT_PATH . 'libraries/common.inc.php';
if ($_SERVER['REQUEST_METHOD'] != 'POST' || $token_mismatch) {
Core::sendHeaderLocation('./index.php');
} else {
/** @var AuthenticationPlugin $auth_plugin */
$auth_plugin->logOut();
}