add files
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?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;
|
||||
?>
|
||||
Reference in New Issue
Block a user