-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
39 lines (33 loc) · 1.01 KB
/
index.php
File metadata and controls
39 lines (33 loc) · 1.01 KB
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
32
33
34
35
36
37
38
39
// include_once "config.php";
// session_start();
// if (isset($_SESSION['user'])) {
// header("Location: /digifine/dashboard/index.php");
// } else {
// header("Location: /digifine/landingPage/index.php");
// }
<?php
include_once "config.php";
session_start();
if (isset($_SESSION['user'])) {
$role = $_SESSION['user']['role']; // Assuming role is stored in the user session data
switch ($role) {
case 'admin':
header("Location: /digifine/dashboard/admin/index.php");
break;
case 'oic':
header("Location: /digifine/dashboard/oic/index.php");
break;
case 'driver':
header("Location: /digifine/dashboard/driver/index.php");
break;
case 'officer':
header("Location: /digifine/dashboard/officer/index.php");
break;
default:
header("Location: /digifine/dashboard/index.php");
break;
}
} else {
header("Location: /digifine/landingPage/index.php");
}
exit();