36952-vm/session.php
Flatlogic Bot 76d7d99142 PMS 1
2025-12-15 01:31:18 +00:00

21 lines
435 B
PHP

<?php
session_start();
require_once 'db/config.php';
if (!isset($_SESSION['user_id'])) {
header('Location: login.php');
exit();
}
function is_admin() {
return isset($_SESSION['role']) && $_SESSION['role'] === 'admin';
}
function check_admin() {
if (!is_admin()) {
// You can customize this part, e.g., show an error message or redirect.
die('You are not authorized to access this page.');
}
}
?>