2021-12-27 07:11:26 +00:00

35 lines
518 B
PHP
Executable File

<?php
session_start();
$token = $_POST['token'];
if (!isset($_SESSION['uid'])) {
if (!isset($token)) {
?>
<!DOCTYPE HTML>
<html>
<body>
<form action="/admin/login.php" method="POST">
<div>
<p>Enter passcode:</p>
<input type="password" name="token">
</div>
<div>
<button type="submit">Login</button>
</div>
</form>
</body>
</html>
<?php
die;
} else if ($token !== '1445') {
http_response_code(403);
die("Error: incorrect token");
} else {
$_SESSION['uid'] = 1;
}
}
header('Location: /admin');