/
index.php
86 lines (78 loc) · 2.05 KB
/
index.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
<?php
define("EW_PAGE_ID", "index", TRUE); // Page ID
?>
<?php
session_start(); // Initialize session data
ob_start(); // Turn on output buffering
?>
<?php include "ewcfg50.php" ?>
<?php include "ewmysql50.php" ?>
<?php include "phpfn50.php" ?>
<?php include "userinfo.php" ?>
<?php include "userfn50.php" ?>
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Always modified
header("Cache-Control: private, no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
?>
<?php
// Open connection to the database
$conn = ew_Connect();
?>
<?php
$Security = new cAdvancedSecurity();
?>
<?php
// Common page loading event (in userfn*.php)
Page_Loading();
?>
<?php
if (!$Security->IsLoggedIn()) $Security->AutoLogin();
if ($Security->IsLoggedIn()) {
Page_Terminate("postslist.php");
}
if ($Security->IsLoggedIn()) {
Page_Terminate("userlist.php");
}
if ($Security->IsLoggedIn()) {
Page_Terminate("hoturlslist.php");
}
if ($Security->IsLoggedIn()) {
Page_Terminate("categorieslist.php"); // Exit and go to default page
}
if ($Security->IsLoggedIn()) {
?>
你没有足够的权限浏览此页面
<br>
<a href="logout.php">返回登陆页面</a>
<?php
} else {
Page_Terminate("login.php"); // Exit and go to login page
}
?>
<?php
// If control is passed here, simply terminate the page without redirect
Page_Terminate();
// -----------------------------------------------------------------
// Subroutine Page_Terminate
// - called when exit page
// - clean up connection and objects
// - if url specified, redirect to url, otherwise end response
function Page_Terminate($url = "") {
global $conn;
// Global page unloaded event (in userfn*.php)
Page_Unloaded();
// Close Connection
$conn->Close();
// Go to url if specified
if ($url <> "") {
ob_end_clean();
header("Location: $url");
}
exit();
}
?>
<?php
?>