LogoutController.php 407 B

1234567891011121314151617181920212223
  1. <?php
  2. declare(strict_types=1);
  3. namespace PhpMyAdmin\Controllers;
  4. use PhpMyAdmin\Core;
  5. class LogoutController
  6. {
  7. public function index(): void
  8. {
  9. global $auth_plugin, $token_mismatch;
  10. if ($_SERVER['REQUEST_METHOD'] !== 'POST' || $token_mismatch) {
  11. Core::sendHeaderLocation('./index.php?route=/');
  12. return;
  13. }
  14. $auth_plugin->logOut();
  15. }
  16. }