-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui.load.php
91 lines (81 loc) · 2.47 KB
/
gui.load.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
class GuiLoader{
public $HTML="";
public function __construct($page) {
require_once(dirname(__FILE__) . "/shared/SYSTEM/HOOKS/class.hooks.php");
require_once(dirname(__FILE__) . "/webService/package.spot.php");
require_once(dirname(__FILE__) . "/shared/package.main.php");
require_once(dirname(__FILE__) . "/webService/global.config.php");
$page=$this->getPage($page, $PUBLIC_SITES);
return $this->loadGUI($page);
}
public function loadGUI($page) {
include("dom.php");
include("_contents/cont.jsContent.php");
if ($page!="index.php")
include("_contents/cont.nav.php");
include("_contents/cont.footer.php");
if(file_exists("_contents/cont.".$page)) {
include("_contents/cont.".$page);
} else {
header("location: " . $this->getErrorPage());
}
$dom=str_replace('##JSHELPER##', $jsContent, $dom);
$inhalt=str_replace('##NAVIGATION##', $navigation, $inhalt);
$inhalt=str_replace('##FOOTER##', $footer, $inhalt);
$this->HTML=str_replace('##CONTENT##', $inhalt, $dom);
return $this;
}
public function getPage($page, $publicSites) {
$sessionKey=retrieveSkey();
if((empty($sessionKey) && (!in_array($page, $publicSites)))) {
return "index.php";
} else {
if ($page=="index.php") {
return "myspotlist.php";
} else {
return $page;
}
}
}
public function isPublic($page,$PUBLIC_SITES) {
if(in_array($page, $PUBLIC_SITES)) {
return true;
} else {
return false;
}
}
public function getNavigation($page) {
$sessionKey=retrieveSkey();
if(empty($sessionKey)) {
return "unlogged";
} else if (!isset($_GET["mandantID"])) {
return "unlogged";
} else if (empty($_GET["mandantID"])) {
return "unlogged";
}
return "logged";
}
public function getUserbar($userbar) {
$sessionKey=retrieveSkey();
if(empty($sessionKey)) {
return $userbar["unlogged"];
} else if (!isset($_GET["mandantID"])) {
return $userbar["unlogged"];
} else if (empty($_GET["mandantID"])) {
return $userbar["unlogged"];
}
$userbar=$userbar["logged"];
$session=getSession(retrieveSkey());
return str_replace('##USERMAIL##', $session->sessionUser, $userbar);
}
public function getHTML() {
return $this->HTML;
}
private function getErrorPage() {
return "404.php";
}
private function noRequirementsPage() {
return "login.php";
}
}