-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.php
58 lines (56 loc) · 1.82 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
<?php
define('gp', TRUE);
include_once($_SERVER['DOCUMENT_ROOT'].'/includes.php');
if(isset($_GET['action'])) {
$action = stripslashes(htmlspecialchars(trim($_GET['action'])));
$url = explode('/', $action);
} else {
$url[0] = "home";
}
if (!($User->IsLoged()) == true) {
switch ($url[0]) {
case 'home': {
$title = 'Home | '.$Config['Site']['Name'];
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/head.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/index.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/footer.php');
break;
}
case 'login': {
$title = 'Login | '.$Config['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 | '.$Config['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;
}
default: {
$title = 'Error 404';
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/404.php');
}
}
} else {
switch ($url[0]) {
case 'home': {
$title = 'Home | '.$Config['Site']['Name'];
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/head.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/home.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/footer.php');
break;
}
case 'logout': {
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/logout.php');
break;
}
default: {
$title = 'Error 404';
require_once($_SERVER['DOCUMENT_ROOT'].'/core/pages/404.php');
}
}
}