-
Notifications
You must be signed in to change notification settings - Fork 0
/
session.inc.php
33 lines (32 loc) · 1.65 KB
/
session.inc.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
<?php
session_start();
if (isset($_SESSION['user']) && isset($_SESSION['Last_Activity'])) {
if (time() - $_SESSION['Last_Activity'] < 600) {
$_SESSION['Last_Activity'] = time();
if((strpos(strtolower($_SERVER['REQUEST_URI']), 'addproject') !== FALSE) && ($_SESSION['role'] != '1')){
echo 'Don\'t be Smart!!! :D You don\'t have Permissions to access this Page.<br>';
echo 'Page Under Construction :)';
exit();
} else if ((strpos(strtolower ($_SERVER['REQUEST_URI']), 'addtask') !== FALSE) && ($_SESSION['role'] == '3')){
echo 'Don\'t be Smart!!! :D You don\'t have Permissions to access this Page.<br>';
echo 'Page Under Construction :)';
exit();
} else if ((strpos(strtolower ($_SERVER['REQUEST_URI']), 'addteam') !== FALSE) && ($_SESSION['role'] != '1')){
echo 'Don\'t be Smart!!! :D You don\'t have Permissions to access this Page.<br>';
echo 'Page Under Construction :)';
exit();
} else if ((strpos(strtolower ($_SERVER['REQUEST_URI']), 'editproject') !== FALSE) && ($_SESSION['role'] != '1')){
echo 'Don\'t be Smart!!! :D You don\'t have Permissions to access this Page.<br>';
echo 'Page Under Construction :)';
exit();
}
} else if((strpos(strtolower ($_SERVER["QUERY_STRING"]), 'bulkedit') !== FALSE) || (strpos(strtolower ($_SERVER["QUERY_STRING"]), 'addteam') !== FALSE)){
echo 'OOps Session Expired... Close the Window and Login Again.';
exit();
}else{
header('Location: login.php?loginagain');
}
} else {
header('Location: login.php');
}
?>