'GeoLite', // 'logo_url' => '/assets/logo.svg', // 'primary_color' => '#6366f1', // indigo // 'hero_image' => null, // e.g. '/assets/hero.jpg' // 'footer_text' => '� ' . date('Y') . ' Your Company' // ]; // ------------------------------------------------------------- $brand = [ 'site_name' => 'GeoLite', 'logo_url' => null, 'primary_color' => '#667eea', // original gradient hue 'hero_image' => null, 'footer_text' => '� ' . date('Y') . ' GeoLite' ]; require_once 'incl/const.php'; if (file_exists('settings.php')) { $loaded = include 'settings.php'; if (is_array($loaded)) { $brand = array_merge($brand, array_filter($loaded, fn($v) => $v !== null && $v !== '')); } } // Load settings from database require_once 'incl/db.php'; require_once 'incl/Settings.php'; $settingsService = new Settings($pdo, 'assets/brand', 'assets/brand'); $brand = array_merge($brand, $settingsService->load()); // Include authentication (unchanged) require_once 'incl/Auth.php'; // If already logged in, redirect to index if (isLoggedIn()) { ob_end_clean(); header('Location: index.php'); exit; } $error = ''; $loginAttempt = false; // Handle login form submission (unchanged) if ($_SERVER['REQUEST_METHOD'] === 'POST') { $loginAttempt = true; $username = isset($_POST['username']) ? trim($_POST['username']) : ''; $password = isset($_POST['password']) ? $_POST['password'] : ''; if (empty($username) || empty($password)) { $error = 'Please enter both username and password.'; } elseif (authenticate($username, $password)) { // Successful login - redirect to index ob_end_clean(); header('Location: index.php'); exit; } else { $error = 'Invalid username or password.'; } } // Flush output buffer ob_end_flush(); ?>