forked from Ne00n/Night-Sky
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
81 lines (60 loc) · 1.33 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
<?php
include 'content/header.html';
include 'content/configs/config.php';
include 'content/configs/regex.php';
function dat_loader($class) {
include 'class/' . $class . '.php';
}
spl_autoload_register('dat_loader');
session_start();
#CSRF token
if (!isset($_SESSION['Token'])) {
$_SESSION['Token'] = bin2hex(random_bytes(40));
}
if (isset($_GET["p"])) {
$p = $_GET["p"];
} elseif (isset($_GET["key"])) {
$k = $_GET["key"];
}
if(!isset($p)) {
$p="login";
}
$DB = new Database;
$DB->InitDB();
if ($p == "login") {
include 'content/login.php';
}
if (Page::startsWith($p,"register")) {
include 'content/register.php';
}
if (Page::startsWith($p,"main")) {
include 'content/main.php';
}
if (Page::startsWith($p,"group")) {
include 'content/group.php';
}
if (Page::startsWith($p,"contact")) {
include 'content/contact.php';
}
if (Page::startsWith($p,"history")) {
include 'content/history.php';
}
if (Page::startsWith($p,"tos")) {
include 'content/tos.php';
}
if (Page::startsWith($p,"privacy")) {
include 'content/privacy.php';
}
if (Page::startsWith($p,"account")) {
include 'content/account.php';
}
if (Page::startsWith($p,"status-page")) {
include 'content/status-page.php';
}
if ($p=="logout") {
session_unset();
session_destroy();
header('Location: index.php?p=login');
}
include 'content/footer.html';
?>