forked from ChristopherDay/Gangster-Legends-V2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.php
91 lines (68 loc) · 2.51 KB
/
init.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
<?php
spl_autoload_register(function ($class) {
if(file_exists('class/' . $class . '.php'))
include 'class/' . $class . '.php';
});
new ErrorHandler();
$start = microtime();
session_start();
if (file_exists("install/index.php")) {
header("Location: install/");
exit;
}
include 'dbconn.php';
$settings = new settings();
$page = new Page();
$page->loadModuleMetaData();
if (!isset($_GET['page'])) {
$_GET['page'] = $page->landingPage;
}
$pageToLoad = $_GET['page'];
if (!isset($page->modules[$pageToLoad])) {
if (!empty($_SESSION['userID'])) {
$user = new user($_SESSION['userID']);
$user->updateTimer('laston', time());
$user->checkRank();
}
$page->loadPage("pageNotFound");
} else {
$jailPageCheck = $page->modules[$pageToLoad];
if (!empty($_SESSION['userID'])) {
$user = new user($_SESSION['userID']);
$user->updateTimer('laston', time());
$user->checkRank();
if ($_GET["page"] == "logout") {
$page->loadPage('logout');
} else if ($user->info->U_status == 0) {
$deadPage = "dead";
$hook = new Hook("deadPage");
$deadPage = $hook->run($deadPage, true);
$page->loadPage($deadPage);
} else if ($user->info->U_status == 2 && $jailPageCheck["requireLogin"]) {
$page->loadPage('users');
} else if ($user->info->U_userLevel == 3) {
$bannedPage = "banned";
$hook = new Hook("bannedPage");
$bannedPage = $hook->run($bannedPage, true);
$page->loadPage($bannedPage);
} else if (!$user->checkTimer('jail')) {
if ($jailPageCheck["accessInJail"]) {
$page->loadPage($pageToLoad);
} else {
$jailPage = "jail";
$hook = new Hook("jailPage");
$jailPage = $hook->run($jailPage, true);
$page->loadPage($jailPage);
}
} else {
$page->loadPage($pageToLoad);
}
} else if (!$jailPageCheck["requireLogin"]) {
$page->loadPage($_GET['page']);
} else {
$page->loadPage("login");
}
}
$page->printPage();
$page->success = true;
?>