-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
34 lines (29 loc) · 1.09 KB
/
index.php
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
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/functions/inc.func.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/standards/access.inc.php';
//check if the user is not logged in
if (!userIsLoggedIn()) {
include $_SERVER['DOCUMENT_ROOT'] . '/php/sections/login.html.php';
exit();
}
if (getUserRole($_SESSION['user'])) {
if (getUserRole($_SESSION['user']) == 'ceo') {
header("Location: ./pages/ceo/");
exit();
}
else if (userHasProgram($_SESSION['user'])) {
$departament = getUserDepartament($_SESSION['user']);
header("Location: ./pages/$departament/");
exit();
}
else {
$error = 'nu ai acces astazi';
include $_SERVER['DOCUMENT_ROOT'] . '/php/sections/error.html.php';
include $_SERVER['DOCUMENT_ROOT'] . '/php/sections/logout.html.php';
exit();
}
}
$error = 'nu exista pagina pentru userul tau';
include $_SERVER['DOCUMENT_ROOT'] . '/php/sections/error.html.php';
exit();
?>