35311-vm/includes/resident_session.php
Flatlogic Bot 6441bdd294 10 31
2025-10-31 19:00:37 +00:00

11 lines
259 B
PHP

<?php
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
// Check if user is logged in and has the 'resident' role
if (!isset($_SESSION['user_id']) || $_SESSION['user_role'] !== 'resident') {
header("Location: index.php");
exit;
}
?>