Files
WebGIS_Project/05/index.php
T
luthfihadinugroho79 e950468760 add files
2026-06-10 19:42:59 +07:00

22 lines
530 B
PHP

<?php
// index.php — Entry point, redirect berdasarkan role
require_once 'includes/config.php';
startSession();
if (empty($_SESSION['user_id'])) {
header('Location: login.php');
exit;
}
$role = $_SESSION['role'] ?? '';
$redirectMap = [
'admin' => 'dashboard/pengurus.php',
'pengurus_ibadah' => 'dashboard/pengurus.php',
'masyarakat' => 'dashboard/masyarakat.php',
'pemerintah' => 'dashboard/pemerintah.php',
];
header('Location: ' . ($redirectMap[$role] ?? 'login.php'));
exit;
?>