44 lines
991 B
PHP
44 lines
991 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
session_start();
|
|
require __DIR__ . "/config.php";
|
|
|
|
if (empty($_SESSION["is_admin"])) {
|
|
http_response_code(403);
|
|
$allowed = false;
|
|
} else {
|
|
$allowed = true;
|
|
}
|
|
?>
|
|
<!doctype html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Flag</title>
|
|
<link rel="stylesheet" href="/style.css">
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<nav class="topnav">
|
|
<a href="/">Accueil</a>
|
|
<a href="/login.php">Login</a>
|
|
<a class="active" href="/flag.php">Flag</a>
|
|
<?php if (!empty($_SESSION["is_admin"])): ?>
|
|
<a href="/logout.php">Logout</a>
|
|
<?php endif; ?>
|
|
</nav>
|
|
|
|
<div class="card">
|
|
<h1>Flag DevWeb</h1>
|
|
|
|
<?php if (!$allowed): ?>
|
|
<div class="alert danger">Accès refusé (admin requis).</div>
|
|
<?php else: ?>
|
|
<div class="flagbox"><?php echo htmlspecialchars(DEVWEB_FLAG); ?></div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|