Admin Login
= htmlspecialchars($error) ?>
logout(); header('Location: ' . Bootstrap::url('admin/login.php')); exit; } if ($auth->isLoggedIn()) { header('Location: ' . Bootstrap::url('admin/index.php')); exit; } $error = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { if (!Csrf::validate((string) ($_POST['csrf'] ?? ''))) { $error = 'Ungültiges CSRF-Token.'; } else { $password = (string) ($_POST['password'] ?? ''); if ($auth->login($password)) { header('Location: ' . Bootstrap::url('admin/index.php')); exit; } $error = 'Login fehlgeschlagen.'; } } $csrf = Csrf::token(); ?>
= htmlspecialchars($error) ?>