35791-vm/includes/auth_check.php
2025-11-25 17:23:56 +00:00

9 lines
211 B
PHP

<?php
session_start();
// If user is not logged in or is not an admin, redirect to login page
if (!isset($_SESSION['user_id']) || $_SESSION['role'] !== 'admin') {
header("Location: login.php");
exit;
}