Welcome to mirror list, hosted at ThFree Co, Russian Federation.

LogoutController.php « Controllers « classes « libraries - github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b5e9683e595a321d3c9ec5d9b4c99a1c23208cf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php

declare(strict_types=1);

namespace PhpMyAdmin\Controllers;

use PhpMyAdmin\Core;

class LogoutController
{
    public function __invoke(): void
    {
        $GLOBALS['auth_plugin'] = $GLOBALS['auth_plugin'] ?? null;
        $GLOBALS['token_mismatch'] = $GLOBALS['token_mismatch'] ?? null;

        if (($_SERVER['REQUEST_METHOD'] ?? 'GET') !== 'POST' || $GLOBALS['token_mismatch']) {
            Core::sendHeaderLocation('./index.php?route=/');

            return;
        }

        $GLOBALS['auth_plugin']->logOut();
    }
}