forked from PrabhdeepSingh/WurmUnlimitedAdmin
/
header.php
145 lines (137 loc) · 6.09 KB
/
header.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?php
session_start();
require(dirname(__FILE__) . "/includes/config.php");
require(dirname(__FILE__) . "/includes/functions.php");
if($application["mode"] == DEVELOPMENT)
{
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
}
if(isLoggedin())
{
$userData = $_SESSION["userData"];
}
else
{
header("Location: ".$application["rootPath"]."account/login/?ref=//".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']."");
die();
}
if(time() - $_SESSION['accountLoggedinTime'] > 3600) {
unset($_SESSION['userData']);
unset($_SESSION['accountLoggedinTime']);
header("Location: ".$application["rootPath"]."account/login/?ref=//".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']."");
die();
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Wurm Unlimited Admin</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<script src="<?php echo $application["rootPath"]; ?>assets/vendors/jquery/jquery-2.1.4.min.js"></script>
<!-- Bootstrap 3.3.5 -->
<link rel="stylesheet" href="<?php echo $application["rootPath"]; ?>assets/vendors/bootstrap/css/bootstrap.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="<?php echo $application["rootPath"]; ?>assets/vendors/fontawesome/css/font-awesome.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="<?php echo $application["rootPath"]; ?>assets/css/style.min.css">
<link rel="stylesheet" href="<?php echo $application["rootPath"]; ?>assets/css/skinstyle.min.css">
<link rel="stylesheet" href="<?php echo $application["rootPath"]; ?>assets/vendors/sweetalert/sweetalert.min.css" />
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body class="hold-transition skin-black sidebar-mini">
<div class="wrapper">
<header class="main-header">
<a href="<?php echo $application["rootPath"]; ?>" class="logo">
<span class="logo-mini">WU<b>A</b></span>
<span class="logo-lg">WU<b>Admin</b></span>
</a>
<nav class="navbar navbar-static-top" role="navigation">
<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
<span class="sr-only">Toggle navigation</span>
</a>
</nav>
</header>
<aside class="main-sidebar">
<section class="sidebar">
<div class="user-panel">
<div class="pull-left image">
<img src="<?php echo $application["rootPath"]; ?>assets/images/avatars/avatar_<?php echo strtolower($userData['username'][0]); ?>_120.png" class="img-circle" alt="User Image">
</div>
<div class="pull-left info">
<p><?php echo $userData["username"]; ?></p>
Admin level: <?php echo $userData["level"]; ?>
</div>
</div>
<ul class="sidebar-menu">
<li class="header">MAIN NAVIGATION</li>
<!--
- This nav will be generated through sql database
-->
<li class="treeview <?php echo $page == 'account' ? 'active' : ''; ?>">
<a href="#">
<i class="fa fa-desktop"></i>
<span> Account</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li><a href="<?php echo $application["rootPath"]; ?>account/changepassword/"><i class="fa fa-lock"></i> Change password</a></li>
<li><a href="<?php echo $application["rootPath"]; ?>account/logout/"><i class="fa fa-sign-out"></i> Logout</a></li>
</ul>
</li>
<?php
if($userData["level"] >= $application["minAdminLevel"])
{
?>
<li class="treeview <?php echo $page == 'admin' ? 'active' : ''; ?>">
<a href="#">
<i class="fa fa-bank"></i>
<span> Admin</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li><a href="<?php echo $application["rootPath"]; ?>admin/add/"><i class="fa fa-user-plus"></i> Add user</a></li>
<li><a href="<?php echo $application["rootPath"]; ?>admin/users/"><i class="fa fa-users"></i> Users</a></li>
</ul>
</li>
<li class="<?php echo $page == 'server' ? 'active' : ''; ?>">
<a href="<?php echo $application["rootPath"]; ?>servers/">
<i class="fa fa-server"></i>
<span> Servers</span>
</a>
</li>
<?php } ?>
<li class="treeview <?php echo $page == 'player' ? 'active' : ''; ?>">
<a href="#">
<i class="fa fa-user"></i>
<span> Player</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li><a href="#"><i class="fa fa-power-off"></i> Players online</a></li>
<li><a href="<?php echo $application["rootPath"]; ?>players/"><i class="fa fa-users"></i> All players</a></li>
</ul>
</li>
<li class="treeview <?php echo $page == 'village' ? 'active' : ''; ?>">
<a href="#">
<i class="fa fa-home"></i>
<span> Village</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li><a href="#"><i class="fa fa-list"></i> View all villages</a></li>
</ul>
</li>
</ul>
</section>
<!-- /.sidebar -->
</aside>