-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmanage.php
106 lines (96 loc) · 3.15 KB
/
manage.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
<?php
/**
* Model: C.P.Sub 公告系統
* Author: Cooltey Feng
* Lastest Update: 2014/6/9
*/
// include configuration file
include_once("config/config.php");
// include setting file
include_once("class/settings.php");
// include library file
include_once("class/lib.php");
// include article file
include_once("class/article.php");
// include page file
include_once("class/page.php");
// include auth file
include_once("class/auth.php");
// include template file
include_once("class/template.php");
// include csrf protection file
include_once("class/csrf_protection.php");
$getSettings = new Settings($config_setting_file_path);
$cpsub = $getSettings->getSettings();
$getLib = new Lib($cpsub['filter'], $cpsub['stripslashes']);
$getAuth = new Auth($config_account_data, $getLib);
$getTmp = new Template($config_current_version);
$getCSRF = new CSRFProtection($getLib);
// check file status
$getLib->checkFileStatus($config_default_folder);
$getLib->checkFileStatus($config_article_file_path);
$getLib->checkFileStatus($config_ip_file_path);
// get page val
if(isset($_GET['p'])){
$p = $getLib->setFilter($_GET['p']);
}else{
$p = "";
}
if(!$getLib->checkVal($p)){
$p = "about";
}
// check auth
$getAuth->checkAuth($_COOKIE, $_SESSION, $p);
// get page folder
$include_path = $getLib->checkAdminPath($p);
// current page
$website_current_page = "管理";
// get title
$website_title = $getLib->setFilter($cpsub['title']). "-" .$website_current_page;
?>
<!DOCTYPE html>
<html lang="zh-tw">
<head>
<?=$getTmp->setHeader($website_title);?>
</head>
<body>
<div class="container">
<div class="page-header">
<h1><a href="./"><?=$getLib->setFilter($cpsub['title']);?></a> <small><?=$website_current_page;?></small></h1>
</div>
<nav class="navbar navbar-default" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">控制台</a>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
<li <?=$getLib->toggleMenu($p, "article_add");?>><a href="?p=article_add">建立新公告</a></li>
<li <?=$getLib->toggleMenu($p, "article_list");?>><a href="?p=article_list">公告列表</a></li>
<li <?=$getLib->toggleMenu($p, "system_settings");?>><a href="?p=system_settings">系統管理</a></li>
<li <?=$getLib->toggleMenu($p, "about");?>><a href="?p=about">程式資訊</a></li>
<li <?=$getLib->toggleMenu($p, "logout");?>><a href="?p=logout">登出</a></li>
</ul>
</div>
</div>
</nav>
<?php
if($getLib->checkVal($include_path)){
include($include_path) ;
}else{
$error_msg = "找不到網頁";
$error_msg_array = array();
array_push($error_msg_array, $error_msg);
$getLib->showErrorMsg($error_msg_array);
}
?>
</div>
<?=$getTmp->setFooter();?>
</body>
</html>