-
Notifications
You must be signed in to change notification settings - Fork 0
/
ImbaLoader.php
96 lines (78 loc) · 3.42 KB
/
ImbaLoader.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
<?php
header('Access-Control-Allow-Origin: *');
session_set_cookie_params(3600);
session_start();
require_once 'ImbaConstants.php';
require_once 'Controller/ImbaSharedFunctions.php';
$smarty = ImbaSharedFunctions::newSmarty();
$smarty->assign("thrustRoot", ImbaSharedFunctions::getTrustRoot());
$smarty->assign("phpSessionID", session_id());
switch ($_GET["load"]) {
case "js":
header('Content-Type: application/javascript');
require_once 'Model/ImbaUser.php';
require_once 'Model/ImbaNavigation.php';
require_once 'Controller/ImbaManagerDatabase.php';
require_once 'Controller/ImbaManagerNavigation.php';
require_once 'Controller/ImbaManagerUser.php';
require_once 'Controller/ImbaUserContext.php';
ImbaUserContext::setRedirectUrl(ImbaSharedFunctions::getTrustRoot());
$managerNavigation = ImbaManagerNavigation::getInstance();
$useProxy = false;
if (ImbaConstants::$WEB_FORCE_PROXY == 1) {
$useProxy = true;
} else if (ImbaConstants::$WEB_FORCE_PROXY == 0) {
if (($_SERVER['HTTP_REFERER'] != ImbaSharedFunctions::getTrustRoot())) {
$useProxy = true;
}
}
if (!$useProxy) {
$smarty->assign("authPath", ImbaConstants::$WEB_AUTH_MAIN_PATH);
$smarty->assign("ajaxPath", ImbaSharedFunctions::fixWebPath(ImbaConstants::$WEB_AJAX_MAIN_PATH));
} else {
$smarty->assign("authPath", ImbaConstants::$WEB_AUTH_PROXY_PATH);
$smarty->assign("ajaxPath", ImbaSharedFunctions::fixWebPath(ImbaConstants::$WEB_AJAX_PROXY_PATH));
}
/**
* Use no proxy for auth ("magic")
*/
$smarty->assign("authPath", ImbaConstants::$WEB_AUTH_MAIN_PATH);
$smarty->assign("PortalNavigation", $managerNavigation->displayLoaderPortalNavigation());
$smarty->assign("ImbaAdminNavigation", $managerNavigation->renderImbaAdminNavigation());
$smarty->assign("ImbaGameNavigation", $managerNavigation->renderImbaGameNavigation());
$smarty->assign("PortalChooser", $managerNavigation->renderPortalChooser());
/**
* Set Auth referer for automatic redirection
*/
$tmpAuthReferer = ImbaUserContext::getAuthReferer();
ImbaUserContext::setAuthReferer("");
$smarty->assign("imbaAuthReferer", $tmpAuthReferer);
/**
* Show Session Error Message
*/
$tmpImbaErrorMsgs = ImbaUserContext::getImbaErrorMessage();
ImbaUserContext::setImbaErrorMessage("");
$smarty->assign("imbaErrorMessage", $tmpImbaErrorMsgs);
/**
* Set Savascript Debug
*/
ImbaConstants::loadSettings();
if (!empty($_SESSION["IUC_Debug"])) {
$tmpJsDebug = ImbaUserContext::getDebug();
} elseif (empty(ImbaConstants::$SETTINGS['ENABLE_JS_DEBUG'])) {
$tmpJsDebug = "false";
} else {
$tmpJsDebug = ImbaConstants::$SETTINGS['ENABLE_JS_DEBUG'];
}
$smarty->assign("jsDebug", $tmpJsDebug);
$smarty->display('ImbaLoaderJs.tpl');
break;
case "css":
header('Content-type: text/css');
$smarty->display('ImbaLoaderCss.tpl');
break;
default:
header('Content-type: text/html');
$smarty->display('ImbaLoader.tpl');
}
?>