-
Notifications
You must be signed in to change notification settings - Fork 0
/
ImbaAjax.php
91 lines (77 loc) · 2.21 KB
/
ImbaAjax.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
header('Access-Control-Allow-Origin: *');
session_start();
/**
* Single point of Ajax entry
*
*/
require_once 'ImbaConstants.php';
require_once 'Controller/ImbaManagerUser.php';
require_once 'Controller/ImbaManagerLog.php';
require_once 'Controller/ImbaUserContext.php';
switch ($_POST["action"]) {
case "messenger":
include 'Ajax/Messenger.php';
break;
case "user":
include 'Ajax/User.php';
break;
case "portal":
include 'Ajax/Portal.php';
break;
case "navigation":
include 'Ajax/Navigation.php';
break;
case "game":
if (ImbaUserContext::getLoggedIn()) {
$managerUser = ImbaManagerUser::getInstance();
$managerUser->setMeOnline();
unset($managerUser);
}
/**
* Load my module navigation
*/
$moduleConfigFile = "Ajax/IMBAdminGames/" . $_POST["game"] . ".Navigation.php";
if (file_exists($moduleConfigFile)) {
include $moduleConfigFile;
}
$moduleFile = "Ajax/IMBAdminGames/" . $_POST["game"] . ".php";
if (file_exists($moduleFile)) {
include $moduleFile;
}
break;
case "module":
if (ImbaUserContext::getLoggedIn()) {
$managerUser = ImbaManagerUser::getInstance();
$managerUser->setMeOnline();
unset($managerUser);
}
/**
* Load my module navigation
*/
$moduleConfigFile = "Ajax/IMBAdminModules/" . $_POST["module"] . ".Navigation.php";
if (file_exists($moduleConfigFile)) {
include $moduleConfigFile;
}
$moduleFile = "Ajax/IMBAdminModules/" . $_POST["module"] . ".php";
if (file_exists($moduleFile)) {
include $moduleFile;
}
break;
/**
* Some other examples
case "role":
include 'Ajax/Role.php';
break;
case "chat":
include 'Ajax/Chat.php';
break;
case "event":
include 'Ajax/Event.php';
break;
*/
// TODO: use default case for event polling?
default:
break;
}
?>