-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.php
194 lines (193 loc) · 6.89 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
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
190
191
192
193
194
<?php
include_once($_SERVER['DOCUMENT_ROOT'].'/core/inc/config.php');
if(isset($_GET['action'])) {
$action = stripslashes(htmlspecialchars(trim($_GET['action'])));
$url = explode('/', $action);
} else {
$url[0] = "home";
}
if (!(is_login()) == true) {
switch ($url[0]) {
case 'home': {
$title = 'Home | '.site_name();
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/index.php');
break;
}
/* case 'login': {
$title = 'Login | '.site_name();
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/head.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/login.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/footer.php');
break;
}
case 'register': {
$title = 'Register | '.site_name();
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/head.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/register.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/footer.php');
break;
}*/
case 'demo': {
if (!user_login('demo@obgp.me', 'demo')) {
sMSG('Doslo je do greske, molimo pokusajte malo kasnije.', 'error');
redirect_to('home');
die();
} else {
sMSG('Uspesno ste se ulogovali na demo nalog.', 'success');
redirect_to('home');
die();
}
break;
}
default: {
header('Location: /');
}
}
} else {
switch ($url[0]) {
case 'home': {
$title = 'Home | '.site_name();
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/head.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/home.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/footer.php');
break;
}
case 'webftp': {
$title = 'WebFTP | '.site_name();
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/head.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/webftp.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/footer.php');
break;
}
case 'view-billing': {
$title = 'View billing | '.site_name();
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/head.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/view-billing.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/footer.php');
break;
}
case 'ticket': {
$title = 'Ticket | '.site_name();
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/head.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/ticket.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/footer.php');
break;
}
case 'support': {
$title = 'Support | '.site_name();
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/head.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/support.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/footer.php');
break;
}
case 'settings': {
$title = 'Settings | '.site_name();
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/head.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/settings.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/footer.php');
break;
}
case 'servers': {
$title = 'Servers | '.site_name();
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/head.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/servers.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/footer.php');
break;
}
case 'server': {
$title = 'Server | '.site_name();
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/head.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/server.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/footer.php');
break;
}
case 'plugins': {
$title = 'Plugins | '.site_name();
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/head.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/plugins.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/footer.php');
break;
}
case 'order': {
$title = 'Order | '.site_name();
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/head.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/order.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/footer.php');
break;
}
case 'mods': {
$title = 'Mods | '.site_name();
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/head.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/mods.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/footer.php');
break;
}
case 'maps': {
$title = 'Maps | '.site_name();
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/head.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/maps.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/footer.php');
break;
}
case 'iplogs': {
$title = 'IP Logs | '.site_name();
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/head.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/iplog.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/footer.php');
break;
}
case 'console': {
$title = 'Console | '.site_name();
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/head.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/console.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/footer.php');
break;
}
case 'boost': {
$title = 'Boost | '.site_name();
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/head.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/boost.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/footer.php');
break;
}
case 'billing': {
$title = 'Billing | '.site_name();
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/head.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/billing.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/footer.php');
break;
}
case 'backup': {
$title = 'Backup | '.site_name();
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/head.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/backup.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/footer.php');
break;
}
case 'autorestart': {
$title = 'Auto Restart | '.site_name();
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/head.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/autorestart.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/footer.php');
break;
}
case 'admins': {
$title = 'Admins | '.site_name();
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/head.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/admins.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/partial/footer.php');
break;
}
case 'logout': {
if(session_destroy()) {
setcookie('user_login', NULL, time() - 604800);
header('Location: /');
exit();
}
}
break;
default: {
header('Location: /');
}
}
}