<?php
/**
 * auth.php — include this at the top of any admin-only PHP file.
 * Kills the request with 401 if not logged in.
 */
require_once __DIR__ . '/config.php';

if (empty($_SESSION['sultani_admin_logged_in'])) {
    http_response_code(401);
    header('Content-Type: application/json');
    echo json_encode(['error' => 'Not logged in']);
    exit;
}
