11 lines
259 B
PHP
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;
|
|
}
|
|
?>
|