Initial production version
This commit is contained in:
43
flag.php
Normal file
43
flag.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?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>
|
||||
Reference in New Issue
Block a user