forked from beratkara/EcosystemFeed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
123 lines (110 loc) · 2.13 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
<?php
/* *******************************
**** [email protected] ****
*********** BERAT KARA ***********
************** 2018 **************
*************** _ ****************
******************************* */
include_once("page/header.php");
$page = $SqlChecker->imtsqlclean(@$_GET["page"]);
$page = $SqlChecker->CheckGET(htmlspecialchars($page));
if($page != "admin")
include_once("page/user/topmenu.php");
$redirect = false;
$incpage = "page/";
switch($page) {
case "linkedin":
if($isOnline)
{
$incpage = "dashboard.html";
$redirect = true;
}
else
$incpage .= "linkedin.php";
break;
case "logout":
if(!$isOnline)
{
$incpage = "homepage.html";
$redirect = true;
}
else
$incpage .= "logout.php";
break;
case "dashboard":
$incpage .= "dashboard.php";
break;
case "homepage":
if($isOnline)
{
$incpage = "home.html";
$redirect = true;
}
else
$incpage .= "homepage.php";
break;
case "home":
if(!$isOnline)
{
$incpage = "homepage.html";
$redirect = true;
}
else
$incpage .= "home.php";
break;
case "settings":
if(!$isOnline)
{
$incpage = "homepage.html";
$redirect = true;
}
else
$incpage .= "settings.php";
break;
case "createpost":
if(!$isOnline)
{
$incpage = "homepage.html";
$redirect = true;
}
else if($isPublisher)
$incpage .= "createpost.php";
else
{
$incpage = "home.html";
$redirect = true;
}
break;
case "admin":
if($isOnline && $isAdmin)
$incpage .= "admin.php";
else
$incpage .= "linkedin.php";
break;
default:
if($isOnline)
{
if($_SESSION["user"]->authority == "admin")
$incpage .= "admin.php";
elseif($_SESSION["user"]->authority == "authproblem")
$redirect = "index.html";
else
$incpage .= "home.php";
}
else
{
$incpage = "homepage.html"; //login.html admin girişi için
$redirect = true;
}
break;
} // switch end
if($page != "homepage" && $page != "admin")
include("page/menu.php");
if($redirect)
header("Location: ".$incpage);
else if (file_exists($incpage))
include($incpage);
else
include("page/404.php");
include_once("page/footer.php");
?>