-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
182 lines (148 loc) · 5.2 KB
/
Copy pathindex.php
File metadata and controls
182 lines (148 loc) · 5.2 KB
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<?php
//$start = microtime(true);
require_once('includes/init.php');
//*** Global Variables.
$intCatId = request('cid');
$intElmntId = request('eid', 0);
$strCommand = request('cmd', CMD_LIST);
$strOutput = "";
//*** Take care of any login requests.
require_once('includes/inc.login.php');
//*** Find the first possible category Id if none given.
if (empty($intCatId)
|| !isset($_CONF['app']['navRights'][$intCatId])
|| !$objLiveUser->checkRight($_CONF['app']['navRights'][$intCatId])) {
foreach ($_CONF['app']['navRights'] as $key => $value) {
if ($objLiveUser->checkRight($value) == true) {
$intCatId = $key;
break;
}
}
}
//*** Check if the category is a top level product id.
if ($productKey = array_search($intCatId, $_CONF['app']['msMypunch']['product'])) {
foreach($_CONF['app']['ms' . ucfirst($productKey)] as $key => $value) {
if ($objLiveUser->checkRight($_CONF['app']['navRights'][$value]) == true) {
$intCatId = $value;
break;
}
}
}
//*** Handle data manipulation request.
switch ($strCommand) {
case CMD_SORT:
switch ($intCatId) {
case NAV_PCMS_ELEMENTS:
Elements::sortChildren($intElmntId);
$strCommand = CMD_LIST;
break;
case NAV_PCMS_TEMPLATES:
Templates::sortChildren($intElmntId);
$strCommand = CMD_LIST;
break;
case NAV_PCMS_LANGUAGES:
ContentLanguage::sort($intElmntId);
$strCommand = CMD_LIST;
break;
case NAV_PCMS_STORAGE:
StorageItems::sortChildren($intElmntId);
$strCommand = CMD_LIST;
break;
}
break;
}
//*** Verify software version
require_once('includes/inc.verify_version.php');
//*** Load the Template Parse methods.
require_once('includes/inc.tplparse_head.php');
require_once('includes/inc.tplparse_foot.php');
//*** Parse the HTML Header.
$strOutput .= parseHeader($intCatId, $strCommand, $intElmntId);
//*** Route to the correct HTML Body Parser.
switch ($intCatId) {
case NAV_MYPUNCH_LOGIN:
if ($_CONF['app']['secureLogin'] && Request::getProtocol() != "https") {
header("Location: " . Request::getURI("https") . "/?cid=" . NAV_MYPUNCH_LOGIN);
exit;
} else {
require_once('inc.tplparse_login.php');
$strOutput .= parseLogin($intElmntId, $strCommand);
}
break;
case NAV_MYPUNCH_NOACCOUNT:
require_once('includes/inc.tplparse_noaccount.php');
$strOutput .= parsePage($intElmntId, $strCommand);
break;
case NAV_MYPUNCH_USERS:
require_once('includes/inc.tplparse_user.php');
if ($intElmntId == 0) $intElmntId = NAV_MYPUNCH_USERS_USER;
$strOutput .= parseMenu($intCatId, $strCommand);
$strOutput .= parseUsers($intElmntId, $strCommand);
break;
case NAV_MYPUNCH_PROFILE:
require_once('includes/inc.tplparse_profile.php');
$strOutput .= parseMenu($intCatId, $strCommand);
$strOutput .= parseProfile($intElmntId, $strCommand);
break;
case NAV_MYPUNCH_ANNOUNCEMENTS:
require_once('includes/inc.tplparse_announcments.php');
$strOutput .= parseAnnouncment();
break;
case NAV_PCMS_TEMPLATES:
require_once('includes/inc.tplparse_template.php');
$strOutput .= parseMenu($intCatId, $strCommand);
$strOutput .= parseTemplates($intElmntId, $strCommand);
break;
case NAV_PCMS_FORMS:
require_once('includes/inc.tplparse_form.php');
$strOutput .= parseMenu($intCatId, $strCommand);
$strOutput .= parseForms($intElmntId, $strCommand);
break;
case NAV_PCMS_STORAGE:
require_once('includes/inc.tplparse_storage.php');
$strOutput .= parseMenu($intCatId, $strCommand);
$strOutput .= parseFiles($intElmntId, $strCommand);
break;
case NAV_PCMS_ALIASES:
require_once('includes/inc.tplparse_alias.php');
$strOutput .= parseMenu($intCatId, $strCommand);
$strOutput .= parseAlias($intElmntId, $strCommand);
break;
case NAV_PCMS_FEEDS:
require_once('includes/inc.tplparse_feeds.php');
$strOutput .= parseMenu($intCatId, $strCommand);
$strOutput .= parseFeeds($intElmntId, $strCommand);
break;
case NAV_PCMS_SETTINGS:
require_once('includes/inc.tplparse_setting.php');
$strOutput .= parseMenu($intCatId, $strCommand);
$strOutput .= parseSetting($intElmntId, $strCommand);
break;
case NAV_PCMS_LANGUAGES:
require_once('includes/inc.tplparse_language.php');
$strOutput .= parseMenu($intCatId, $strCommand);
$strOutput .= parseLanguage($intElmntId, $strCommand);
break;
case NAV_PCMS_HELP:
require_once('includes/inc.tplparse_help.php');
$strOutput .= parseMenu($intCatId, $strCommand);
$strOutput .= parseHelp($intElmntId, $strCommand);
break;
case NAV_PCMS_SEARCH:
require_once('includes/inc.tplparse_search.php');
$strOutput .= parseMenu($intCatId, $strCommand);
$strOutput .= parseSearch($intElmntId, $strCommand);
break;
case NAV_PCMS_ELEMENTS:
require_once('includes/inc.tplparse_element.php');
$strOutput .= parseMenu($intCatId, $strCommand);
$strOutput .= parsePages($intElmntId, $strCommand);
break;
default:
$strOutput .= parseMenu($intCatId, $strCommand);
$strOutput .= parseUndefined($intCatId, $strCommand);
}
//*** Parse the HTML Footer.
$strOutput .= parseFooter();
echo $strOutput;
//echo "<br /><br />Execution time: " . (microtime(true) - $start);