Initial Commit
This commit is contained in:
commit
1d85bf6663
7 changed files with 377 additions and 0 deletions
33
admin/auth.php
Normal file
33
admin/auth.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?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;
|
||||
?>
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue