<?php
// Start the secure session handler globally across all core web scripts
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
// DEFINE SYSTEM PASSWORDS
define('ADMIN_PASSWORD', 'dr0w55@P'); // Change this string to your secret password
// Helper function to verify if the active visitor has administrative credentials
function is_admin() {
return isset($_SESSION['is_admin']) && $_SESSION['is_admin'] === true;
}
// Gatekeeper function to force a redirect if an unauthenticated user hits an admin file
function enforce_admin() {
if (!is_admin()) {
header('Location: index.php?admin_login=1');
exit;
}
}
?>