-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
31 lines (29 loc) · 761 Bytes
/
Copy pathindex.php
File metadata and controls
31 lines (29 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
/**
* Index Page - Redirect to Login or Dashboard
*/
require_once 'config/config.php';
require_once 'includes/auth.php';
if (isLoggedIn()) {
// Redirect to appropriate dashboard based on role
switch ($_SESSION['role']) {
case ROLE_ADMIN:
header('Location: admin/dashboard.php');
break;
case ROLE_TEACHER:
header('Location: teacher/dashboard.php');
break;
case ROLE_STUDENT:
header('Location: student/dashboard.php');
break;
case ROLE_PARENT:
header('Location: parent/dashboard.php');
break;
default:
header('Location: logout.php');
}
} else {
header('Location: login.php');
}
exit();
?>