mirror of
https://github.com/myronblair/do-server-config
synced 2026-07-28 05:22:53 -05:00
[orbis] Weekly backup 2026-07-07 — 318 files changed, 48597 insertions(+), 7 deletions(-)
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../includes/auth.php';
|
||||
|
||||
if (AdminAuth::isLoggedIn()) {
|
||||
header('Location: /admin/index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
$error = '';
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$password = $_POST['password'] ?? '';
|
||||
if (AdminAuth::attempt($password)) {
|
||||
header('Location: /admin/index.php');
|
||||
exit;
|
||||
}
|
||||
$error = AdminAuth::isLockedOut($_SERVER['REMOTE_ADDR'] ?? 'unknown')
|
||||
? 'Too many failed attempts. Try again in 15 minutes.'
|
||||
: 'Incorrect password';
|
||||
}
|
||||
|
||||
$pageTitle = 'Login - ChuckCo Time Keeper';
|
||||
require_once __DIR__ . '/../includes/header.php';
|
||||
?>
|
||||
<div class="container" style="max-width:400px; padding-top: 4rem;">
|
||||
<div class="card">
|
||||
<h2 class="text-center">ChuckCo Time Keeper</h2>
|
||||
<?php if ($error): ?>
|
||||
<div class="alert alert-error"><?= e($error) ?></div>
|
||||
<?php endif; ?>
|
||||
<form method="POST">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Admin Password</label>
|
||||
<input type="password" name="password" class="form-input" autofocus required>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary btn-block">Log In</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php require_once __DIR__ . '/../includes/footer.php'; ?>
|
||||
Reference in New Issue
Block a user