funnies/admin/auth.php
2025-10-25 15:10:38 -04:00

33 lines
798 B
PHP

<?php
session_start();
require_once __DIR__ . '/config.php';
if (isset($_POST['password'])) {
if (password_verify($_POST['password'], $ADMIN_PASS_HASH)) {
$_SESSION['auth'] = true;
header("Location: upload.php");
exit;
} else {
$error = "Invalid password.";
}
}
if (!isset($_SESSION['auth'])):
?>
<!DOCTYPE html>
<html>
<head><title>Login - MentalNet Funnies Admin</title></head>
<body style="background:#111;color:#eee;font-family:monospace;text-align:center">
<h1>🔒 MentalNet Funnies Admin</h1>
<form method="post">
<input type="password" name="password" placeholder="Password" autofocus>
<button type="submit">Login</button>
</form>
<?php if (!empty($error)) echo "<p style='color:red;'>$error</p>"; ?>
</body>
</html>
<?php
exit;
endif;
?>