This commit is contained in:
Flatlogic Bot 2026-03-15 03:04:09 +00:00
parent 5ee3262843
commit 517061dddb
2 changed files with 5 additions and 27 deletions

View File

@ -16,7 +16,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$username = trim($_POST['username'] ?? '');
$password = trim($_POST['password'] ?? '');
if (login_admin($username, $password)) {
flash_set('success', 'Login berhasil. Selamat datang admin.');
header('Location: admin_dashboard.php');
exit;
}
@ -26,8 +25,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
}
$flash = flash_get();
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
?>
<!doctype html>
<html lang="id">
@ -35,55 +32,36 @@ $projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Login Admin</title>
<?php if ($projectDescription): ?>
<meta name="description" content="<?= htmlspecialchars($projectDescription) ?>" />
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
<?php endif; ?>
<?php if ($projectImageUrl): ?>
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
<?php endif; ?>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="assets/css/custom.css?v=<?= time() ?>">
</head>
<body class="app-body">
<body class="bg-light">
<div class="container py-5">
<div class="row justify-content-center">
<div class="col-lg-5">
<div class="card shadow-sm border-0">
<div class="card-body">
<h1 class="h4 fw-semibold mb-3">Login Admin</h1>
<p class="text-muted small">Gunakan kredensial admin untuk mengakses laporan pendaftar.</p>
<?php if ($flash): ?>
<div class="alert alert-<?= htmlspecialchars($flash['type']) ?> border-0 small">
<?= htmlspecialchars($flash['message']) ?>
</div>
<?php endif; ?>
<form method="post" class="needs-validation" novalidate>
<form method="post">
<div class="mb-3">
<label class="form-label" for="username">Username</label>
<input type="text" class="form-control" id="username" name="username" required>
<div class="invalid-feedback">Username wajib diisi.</div>
</div>
<div class="mb-3">
<label class="form-label" for="password">Password</label>
<input type="password" class="form-control" id="password" name="password" required>
<div class="invalid-feedback">Password wajib diisi.</div>
</div>
<button type="submit" class="btn btn-dark w-100">Masuk</button>
</form>
<div class="border-top pt-3 mt-4 small text-muted">
Default demo: <strong>admin / admin123</strong>
</div>
</div>
</div>
<div class="text-center mt-3">
<a class="text-muted small" href="/">Kembali ke halaman utama</a>
</div>
</div>
</div>
</div>
</body>
</html>
</html>

View File

@ -7,7 +7,7 @@ if (session_status() === PHP_SESSION_NONE) {
// Credentials
const ADMIN_USERNAME = 'roni';
const ADMIN_PASSWORD_HASH = '$2y$10$hkUDAZesiL6CbEdU34ovGOEDmfAjfeAF9E5eu.Yxlv0xO8aX5UBIW'; // Hash of 'wijaya91'
const ADMIN_PASSWORD_HASH = '$2y$10$dxyVYBKFCObI9vbpngH04OVMAUzMnpm5sy.w3Ex704xLjknaL7Vy6';
function is_admin_logged_in(): bool {
return !empty($_SESSION['admin_logged_in']);
@ -35,4 +35,4 @@ function logout_admin(): void {
if (session_status() === PHP_SESSION_ACTIVE) {
session_destroy();
}
}
}