22 lines
530 B
PHP
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;
|
|
?>
|