-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdash.php
47 lines (47 loc) · 1.68 KB
/
dash.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
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php require('includes/prepend.php') ?>
<?php global $glip ?>
<?php
$glip->showHeader();
if(isset($_SESSION['username']) && (defined('server') && defined('server_user') && defined('server_pass') && defined('site_database')) && isset($_GET['plc'])){
$user = $_SESSION['username'];
$id = $_SESSION['id'];
$userLevel = $_SESSION['level'];
$fname = $glip->getUsername($id);
//start of top section
echo '<div class="header_sect">';
echo '<div class="logo_dash"></div>';
echo '<div class="top_widget"><div id="user_welcome">Welcome <span class="name">', $user,'!</span></div>';
?>
<div id="logout"><a href="dash.php?logout=yes">Logout</a></div>
</div>
<div class="clear"></div>
<?php include('includes/menu.php'); ?>
<!-- end of top section -->
</div>
<?php if(isset($_GET['plc']) && $_GET['plc'] === "applications"){
if($userLevel == 2){
header('location: dash.php?plc=agents');
}else{
$glip->showApplications();
}
}else if(isset($_GET['plc']) && $_GET['plc'] === "agents"){
$glip->showAgents();
}else if(isset($_GET['plc']) && $_GET['plc'] === "execs"){
$glip->showExecs();
}else if(!isset($_GET['plc']) || empty($_GET['plc'])){
//if someone tries to access dash without proper params log them out
header('location: dash.php?logout=yes');
}else{
//if user is not logged in
header('location: dash.php?logout=yes');
}
}else{
//if user is not logged in
header('location: dash.php?logout=yes');
}
//if logged out call logout function
if(isset($_GET['logout'])){
$logout=$_GET['logout'];
$glip->logout($logout);
}
$glip->showFooter();