forked from ZeroDream-CN/SakuraPanel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
panel.php
executable file
·189 lines (183 loc) · 6.9 KB
/
panel.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<?php
namespace SakuraPanel;
use SakuraPanel;
global $_config;
$module = $_GET['module'] ?? "";
$rs = Database::querySingleLine("users", Array("username" => $_SESSION['user']));
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>管理面板 :: <?php echo $_config[ 'sitename']; ?> - <?php echo $_config[ 'description']; ?></title>
<!-- Font Awesome Icons -->
<link rel="stylesheet" href="assets/panel/plugins/fontawesome-free/css/all.min.css">
<!-- IonIcons -->
<link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="assets/panel/dist/css/adminlte.min.css">
<!-- Google Font: Source Sans Pro -->
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet"></head>
<body class="hold-transition sidebar-mini">
<div class="wrapper">
<!-- Navbar -->
<nav class="main-header navbar navbar-expand navbar-white navbar-light">
<!-- Left navbar links -->
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" data-widget="pushmenu" href="#">
<i class="fas fa-bars"></i>
</a>
</li>
<li class="nav-item d-none d-sm-inline-block">
<a href="?page=panel&module=home" class="nav-link">主页</a></li>
</ul>
<!-- Right navbar links -->
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="?page=logout&csrf=<?php echo $_SESSION['token']; ?>" title="退出登录">
登出
<i class="fas fa-sign-out-alt"></i>
</a>
</li>
</ul>
</nav>
<!-- /.navbar -->
<!-- Main Sidebar Container -->
<aside class="main-sidebar sidebar-dark-primary elevation-4">
<!-- Brand Logo -->
<a href="?page=panel&module=home" class="brand-link">
<center>
<span class="brand-text font-weight-light">
<?php echo $_config[ 'sitename']; ?></span>
</center>
</a>
<!-- Sidebar -->
<div class="sidebar">
<!-- Sidebar user panel (optional) -->
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
<div class="image">
<img src="https://secure.gravatar.com/avatar/<?php echo md5($_SESSION['mail']); ?>?s=64" class="img-circle elevation-2" alt="User Image"></div>
<div class="info">
<a href="#" class="d-block">
<?php echo htmlspecialchars($_SESSION[ 'user']); ?></a>
</div>
</div>
<!-- Sidebar Menu -->
<nav class="mt-2">
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
<!-- <li class="nav-header">EXAMPLES</li> -->
<li class="nav-item">
<a href="?page=panel&module=home" class="nav-link <?php echo $module == "home" ? "active" : ""; ?>">
<i class="nav-icon fas fa-tachometer-alt"></i>
<p>管理面板</p>
</a>
</li>
<li class="nav-item">
<a href="?page=panel&module=profile" class="nav-link <?php echo $module == "profile" ? "active" : ""; ?>">
<i class="nav-icon fas fa-user"></i>
<p>用户信息</p>
</a>
</li>
<li class="nav-header">内网穿透</li>
<li class="nav-item">
<a href="?page=panel&module=proxies" class="nav-link <?php echo $module == "proxies" ? "active" : ""; ?>">
<i class="nav-icon fas fa-list"></i>
<p>隧道列表</p>
</a>
</li>
<li class="nav-item">
<a href="?page=panel&module=addproxy" class="nav-link <?php echo $module == "addproxy" ? "active" : ""; ?>">
<i class="nav-icon fas fa-plus"></i>
<p>创建隧道</p>
</a>
</li>
<li class="nav-item">
<a href="?page=panel&module=sign" class="nav-link <?php echo $module == "sign" ? "active" : ""; ?>">
<i class="nav-icon fas fa-check-square"></i>
<p>每日签到</p>
</a>
</li>
<li class="nav-item">
<a href="?page=panel&module=download" class="nav-link <?php echo $module == "download" ? "active" : ""; ?>">
<i class="nav-icon fas fa-download"></i>
<p>软件下载</p>
</a>
</li>
<li class="nav-item">
<a href="?page=panel&module=configuration" class="nav-link <?php echo $module == "configuration" ? "active" : ""; ?>">
<i class="nav-icon fas fa-file"></i>
<p>配置文件</p>
</a>
</li>
<?php
if($rs['group'] == "admin") {
?>
<li class="nav-header">管理员</li>
<li class="nav-item">
<a href="?page=panel&module=userlist" class="nav-link <?php echo $module == "userlist" ? "active" : ""; ?>">
<i class="nav-icon fas fa-users"></i>
<p>用户管理</p>
</a>
</li>
<li class="nav-item">
<a href="?page=panel&module=nodes" class="nav-link <?php echo $module == "nodes" ? "active" : ""; ?>">
<i class="nav-icon fas fa-server"></i>
<p>节点管理</p>
</a>
</li>
<li class="nav-item">
<a href="?page=panel&module=traffic" class="nav-link <?php echo $module == "traffic" ? "active" : ""; ?>">
<i class="nav-icon fas fa-paper-plane"></i>
<p>流量统计</p>
</a>
</li>
<li class="nav-item">
<a href="?page=panel&module=settings" class="nav-link <?php echo $module == "settings" ? "active" : ""; ?>">
<i class="nav-icon fas fa-wrench"></i>
<p>站点设置</p>
</a>
</li>
<?php
}
?>
</ul>
</nav>
<!-- /.sidebar-menu --></div>
<!-- /.sidebar --></aside>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<?php
$page = new SakuraPanel\Pages();
if(isset($_GET['module']) && preg_match("/^[A-Za-z0-9\_\-]{1,16}$/", $_GET['module'])) {
$page->loadModule($_GET['module']);
} else {
$page->loadModule("home");
}
?>
</div>
<!-- /.content-wrapper -->
<!-- Control Sidebar -->
<aside class="control-sidebar control-sidebar-dark">
<!-- Control sidebar content goes here --></aside>
<!-- /.control-sidebar -->
<!-- Main Footer -->
<footer class="main-footer">
<strong>Copyright © <?php echo date( "Y"); ?> <a href="http://<?php echo $_SERVER['SERVER_NAME']; ?>"><?php echo $_config[ 'sitename']; ?></a>.</strong>
All rights reserved.
<div class="float-right d-none d-sm-inline-block">Powered by <b>Sakura Panel</b>
</div>
</footer>
</div>
<!-- ./wrapper -->
<!-- REQUIRED SCRIPTS -->
<!-- jQuery -->
<script src="assets/panel/plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap -->
<script src="assets/panel/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- AdminLTE -->
<script src="assets/panel/dist/js/adminlte.js"></script>
</body>
</html>