r2380 - accessibleSubpage(): sayonara
[racktables] / inc / navigation.php
1 <?php
2 /*
3 *
4 * This file implements generic navigation for RackTables.
5 *
6 */
7
8 $page = array();
9 $tab = array();
10 $trigger = array();
11 $ophandler = array();
12 $tabhandler = array();
13 $tabextraclass = array();
14 $delayauth = array();
15 $msgcode = array();
16
17 $page['index']['title'] = 'Main page';
18 $page['index']['handler'] = 'renderIndex';
19
20 $page['rackspace']['title'] = 'Rackspace';
21 $page['rackspace']['parent'] = 'index';
22 $tab['rackspace']['default'] = 'Browse';
23 $tab['rackspace']['edit'] = 'Manage rows';
24 $tab['rackspace']['history'] = 'History';
25 $tabhandler['rackspace']['default'] = 'renderRackspace';
26 $tabhandler['rackspace']['edit'] = 'renderRackspaceRowEditor';
27 $tabhandler['rackspace']['history'] = 'renderRackspaceHistory';
28 $ophandler['rackspace']['edit']['addRow'] = 'addRow';
29 $ophandler['rackspace']['edit']['updateRow'] = 'updateRow';
30 $msgcode['addRow']['OK'] = 74;
31 $msgcode['addRow']['ERR'] = 100;
32 $msgcode['updateRow']['OK'] = 75;
33 $msgcode['updateRow']['ERR'] = 100;
34
35 $page['objects']['title'] = 'Objects';
36 $page['objects']['parent'] = 'index';
37 $tab['objects']['default'] = 'View';
38 $tab['objects']['addmore'] = 'Add more';
39 $tabhandler['objects']['default'] = 'renderObjectSpace';
40 $tabhandler['objects']['addmore'] = 'renderAddMultipleObjectsForm';
41 $ophandler['objects']['default']['deleteObject'] = 'deleteObject';
42 $msgcode['deleteObject']['OK'] = 76;
43 $msgcode['deleteObject']['ERR'] = 100;
44
45 $page['row']['title_handler'] = 'dynamic_title_row';
46 $page['row']['bypass'] = 'row_id';
47 $page['row']['bypass_type'] = 'uint';
48 $page['row']['parent'] = 'rackspace';
49 $tab['row']['default'] = 'View';
50 $tab['row']['newrack'] = 'Add new rack';
51 $tab['row']['tagroller'] = 'Tag roller';
52 $tabhandler['row']['default'] = 'renderRow';
53 $tabhandler['row']['newrack'] = 'renderNewRackForm';
54 $tabhandler['row']['tagroller'] = 'renderTagRollerForRow';
55 $ophandler['row']['tagroller']['rollTags'] = 'rollTags';
56 $ophandler['row']['newrack']['addRack'] = 'addRack';
57 $msgcode['rollTags']['OK'] = 67;
58 $msgcode['rollTags']['ERR'] = 149;
59 $msgcode['addRack']['OK'] = 65;
60 $msgcode['addRack']['ERR1'] = 171;
61 $msgcode['addRack']['ERR2'] = 172;
62
63 $page['rack']['title_handler'] = 'dynamic_title_rack';
64 $page['rack']['bypass'] = 'rack_id';
65 $page['rack']['bypass_type'] = 'uint';
66 $page['rack']['parent'] = 'row';
67 $page['rack']['tagloader'] = 'loadRackTags';
68 $page['rack']['autotagloader'] = 'loadRackAutoTags';
69 $tab['rack']['default'] = 'View';
70 $tab['rack']['edit'] = 'Properties';
71 $tab['rack']['design'] = 'Design';
72 $tab['rack']['problems'] = 'Problems';
73 $tab['rack']['tags'] = 'Tags';
74 $tab['rack']['files'] = 'Files';
75 $tabhandler['rack']['default'] = 'renderRackPage';
76 $tabhandler['rack']['edit'] = 'renderEditRackForm';
77 $tabhandler['rack']['design'] = 'renderRackDesign';
78 $tabhandler['rack']['problems'] = 'renderRackProblems';
79 $tabhandler['rack']['tags'] = 'renderEntityTags';
80 $tabhandler['rack']['files'] = 'renderFilesForEntity';
81 $trigger['rack']['tags'] = 'trigger_tags';
82 $ophandler['rack']['edit']['updateRack'] = 'updateRack';
83 $ophandler['rack']['tags']['saveTags'] = 'saveEntityTags';
84 $ophandler['rack']['files']['addFile'] = 'addFileToEntity';
85 $ophandler['rack']['files']['updateFile'] = 'updateFile';
86 $ophandler['rack']['files']['linkFile'] = 'linkFileToEntity';
87 $ophandler['rack']['files']['unlinkFile'] = 'unlinkFile';
88 $ophandler['rack']['files']['deleteFile'] = 'deleteFile';
89 $msgcode['updateRack']['OK'] = 68;
90 $msgcode['updateRack']['ERR'] = 177;
91 $msgcode['addFileToEntity']['OK'] = 69;
92 $msgcode['addFileToEntity']['ERR'] = 100;
93 $msgcode['updateFile']['OK'] = 70;
94 $msgcode['updateFile']['ERR'] = 100;
95 $msgcode['linkFileToEntity']['OK'] = 71;
96 $msgcode['linkFileToEntity']['ERR1'] = 178;
97 $msgcode['linkFileToEntity']['ERR2'] = 100;
98 $msgcode['unlinkFile']['OK'] = 72;
99 $msgcode['unlinkFile']['ERR'] = 100;
100 $msgcode['deleteFile']['OK'] = 73;
101 $msgcode['deleteFile']['ERR'] = 100;
102
103 $page['objgroup']['title_handler'] = 'dynamic_title_objgroup';
104 $page['objgroup']['handler'] = 'renderObjectGroup';
105 $page['objgroup']['bypass'] = 'group_id';
106 $page['objgroup']['bypass_type'] = 'uint0';
107 $page['objgroup']['parent'] = 'objects';
108 $ophandler['objgroup']['default']['deleteObject'] = 'deleteObject';
109
110 $page['object']['title_handler'] = 'dynamic_title_object';
111 $page['object']['bypass'] = 'object_id';
112 $page['object']['bypass_type'] = 'uint';
113 $page['object']['parent'] = 'objgroup';
114 $page['object']['tagloader'] = 'loadRackObjectTags';
115 $page['object']['autotagloader'] = 'loadRackObjectAutoTags';
116 $tab['object']['default'] = 'View';
117 $tab['object']['edit'] = 'Properties';
118 $tab['object']['rackspace'] = 'Rackspace';
119 $tab['object']['ports'] = 'Ports';
120 $tab['object']['ipv4'] = 'IPv4';
121 $tab['object']['nat4'] = 'NATv4';
122 $tab['object']['livevlans'] = 'Live VLANs';
123 $tab['object']['snmpportfinder'] = 'SNMP port finder';
124 $tab['object']['editrspvs'] = 'RS pools';
125 $tab['object']['lvsconfig'] = 'LVS config';
126 $tab['object']['autoports'] = 'AutoPorts';
127 $tab['object']['tags'] = 'Tags';
128 $tab['object']['files'] = 'Files';
129 $tabhandler['object']['default'] = 'renderRackObject';
130 $tabhandler['object']['edit'] = 'renderEditObjectForm';
131 $tabhandler['object']['rackspace'] = 'renderRackSpaceForObject';
132 $tabhandler['object']['ports'] = 'renderPortsForObject';
133 $tabhandler['object']['ipv4'] = 'renderIPv4ForObject';
134 $tabhandler['object']['nat4'] = 'renderNATv4ForObject';
135 $tabhandler['object']['livevlans'] = 'renderVLANMembership';
136 $tabhandler['object']['snmpportfinder'] = 'renderSNMPPortFinder';
137 $tabhandler['object']['lvsconfig'] = 'renderLVSConfig';
138 $tabhandler['object']['autoports'] = 'renderAutoPortsForm';
139 $tabhandler['object']['tags'] = 'renderEntityTags';
140 $tabhandler['object']['files'] = 'renderFilesForEntity';
141 $tabhandler['object']['editrspvs'] = 'renderObjectSLB';
142 $tabextraclass['object']['snmpportfinder'] = 'attn';
143 $tabextraclass['object']['autoports'] = 'attn';
144 $trigger['object']['ipv4'] = 'trigger_ipv4';
145 $trigger['object']['nat4'] = 'trigger_natv4';
146 $trigger['object']['livevlans'] = 'trigger_livevlans';
147 $trigger['object']['snmpportfinder'] = 'trigger_snmpportfinder';
148 $trigger['object']['editrspvs'] = 'trigger_natv4';
149 $trigger['object']['lvsconfig'] = 'trigger_lvsconfig';
150 $trigger['object']['autoports'] = 'trigger_autoports';
151 $trigger['object']['tags'] = 'trigger_tags';
152 $ophandler['object']['ports']['addPort'] = 'addPortForObject';
153 $ophandler['object']['ports']['delPort'] = 'delPortFromObject';
154 $ophandler['object']['ports']['editPort'] = 'editPortForObject';
155 $ophandler['object']['ports']['linkPort'] = 'linkPortForObject';
156 $ophandler['object']['ports']['unlinkPort'] = 'unlinkPortForObject';
157 $ophandler['object']['ports']['addMultiPorts'] = 'addMultiPorts';
158 $ophandler['object']['ports']['useup'] = 'useupPort';
159 $ophandler['object']['ipv4']['updIPv4Allocation'] = 'updIPv4Allocation';
160 $ophandler['object']['ipv4']['addIPv4Allocation'] = 'addIPv4Allocation';
161 $ophandler['object']['ipv4']['delIPv4Allocation'] = 'delIPv4Allocation';
162 $ophandler['object']['edit']['clearSticker'] = 'clearSticker';
163 $ophandler['object']['edit']['update'] = 'updateObject';
164 $ophandler['object']['nat4']['addNATv4Rule'] = 'addPortForwarding';
165 $ophandler['object']['nat4']['delNATv4Rule'] = 'delPortForwarding';
166 $ophandler['object']['nat4']['updNATv4Rule'] = 'updPortForwarding';
167 $ophandler['object']['livevlans']['setPortVLAN'] = 'setPortVLAN';
168 $ophandler['object']['autoports']['generate'] = 'generateAutoPorts';
169 $ophandler['object']['tags']['saveTags'] = 'saveEntityTags';
170 $ophandler['object']['files']['addFile'] = 'addFileToEntity';
171 $ophandler['object']['files']['updateFile'] = 'updateFile';
172 $ophandler['object']['files']['linkFile'] = 'linkFileToEntity';
173 $ophandler['object']['files']['unlinkFile'] = 'unlinkFile';
174 $ophandler['object']['files']['deleteFile'] = 'deleteFile';
175 $ophandler['object']['editrspvs']['addLB'] = 'addLoadBalancer';
176 $ophandler['object']['editrspvs']['delLB'] = 'deleteLoadBalancer';
177 $ophandler['object']['editrspvs']['updLB'] = 'updateLoadBalancer';
178 $ophandler['object']['lvsconfig']['submitSLBConfig'] = 'submitSLBConfig';
179 $ophandler['object']['snmpportfinder']['querySNMPData'] = 'querySNMPData';
180 $delayauth['object']['livevlans']['setPortVLAN'] = TRUE;
181 $msgcode['addPortForwarding']['OK'] = 2;
182 $msgcode['addPortForwarding']['ERR'] = 100;
183 $msgcode['delPortForwarding']['OK'] = 3;
184 $msgcode['delPortForwarding']['ERR'] = 100;
185 $msgcode['updPortForwarding']['OK'] = 4;
186 $msgcode['updPortForwarding']['ERR'] = 100;
187 $msgcode['addPortForObject']['OK'] = 5;
188 $msgcode['addPortForObject']['ERR1'] = 101;
189 $msgcode['addPortForObject']['ERR2'] = 100;
190 $msgcode['editPortForObject']['OK'] = 6;
191 $msgcode['editPortForObject']['ERR1'] = 101;
192 $msgcode['editPortForObject']['ERR2'] = 100;
193 $msgcode['delPortFromObject']['OK'] = 7;
194 $msgcode['delPortFromObject']['ERR'] = 100;
195 $msgcode['linkPortForObject']['OK'] = 8;
196 $msgcode['linkPortForObject']['ERR'] = 100;
197 $msgcode['unlinkPortForObject']['OK'] = 9;
198 $msgcode['unlinkPortForObject']['ERR'] = 100;
199 $msgcode['addMultiPorts']['OK'] = 10;
200 $msgcode['addMultiPorts']['ERR'] = 123;
201 $msgcode['useupPort']['OK'] = 11;
202 $msgcode['useupPort']['ERR'] = 124;
203 $msgcode['updIPv4Allocation']['OK'] = 12;
204 $msgcode['updIPv4Allocation']['ERR'] = 100;
205 $msgcode['addIPv4Allocation']['OK'] = 13;
206 $msgcode['addIPv4Allocation']['ERR1'] = 170;
207 $msgcode['addIPv4Allocation']['ERR2'] = 100;
208 $msgcode['delIPv4Allocation']['OK'] = 14;
209 $msgcode['delIPv4Allocation']['ERR'] = 100;
210 $msgcode['clearSticker']['OK'] = 15;
211 $msgcode['clearSticker']['ERR'] = 120;
212 $msgcode['updateObject']['OK'] = 16;
213 $msgcode['updateObject']['ERR'] = 121;
214 $msgcode['addLoadBalancer']['OK'] = 18;
215 $msgcode['addLoadBalancer']['ERR'] = 137;
216 $msgcode['delLoadBalancer']['OK'] = 19;
217 $msgcode['deleteLoadBalancer']['ERR'] = 129;
218 $msgcode['updateLoadBalancer']['OK'] = 20;
219 $msgcode['updateLoadBalancer']['ERR'] = 134;
220 $msgcode['generateAutoPorts']['OK'] = 21;
221 $msgcode['generateAutoPorts']['ERR'] = 142;
222 $msgcode['setPortVLAN']['ERR1'] = 156;
223 $msgcode['saveEntityTags']['OK'] = 22;
224 $msgcode['saveEntityTags']['ERR'] = 143;
225
226 $page['ipv4space']['title'] = 'IPv4 space';
227 $page['ipv4space']['parent'] = 'index';
228 $tab['ipv4space']['default'] = 'Browse';
229 $tab['ipv4space']['newrange'] = 'Manage';
230 $tabhandler['ipv4space']['default'] = 'renderIPv4Space';
231 $tabhandler['ipv4space']['newrange'] = 'renderIPv4SpaceEditor';
232 $ophandler['ipv4space']['newrange']['addIPv4Prefix'] = 'addIPv4Prefix';
233 $ophandler['ipv4space']['newrange']['delIPv4Prefix'] = 'delIPv4Prefix';
234 $ophandler['ipv4space']['newrange']['updIPv4Prefix'] = 'updIPv4Prefix';
235 $msgcode['addIPv4Prefix']['OK'] = 23;
236 $msgcode['addIPv4Prefix']['ERR'] = 100;
237 $msgcode['addIPv4Prefix']['ERR1'] = 173;
238 $msgcode['addIPv4Prefix']['ERR2'] = 174;
239 $msgcode['addIPv4Prefix']['ERR3'] = 175;
240 $msgcode['addIPv4Prefix']['ERR4'] = 176;
241 $msgcode['delIPv4Prefix']['OK'] = 24;
242 $msgcode['delIPv4Prefix']['ERR'] = 100;
243
244 $page['ipv4net']['title_handler'] = 'dynamic_title_ipv4net';
245 $page['ipv4net']['parent'] = 'ipv4space';
246 $page['ipv4net']['bypass'] = 'id';
247 $page['ipv4net']['bypass_type'] = 'uint';
248 $page['ipv4net']['autotagloader'] = 'loadIPv4PrefixAutoTags';
249 $page['ipv4net']['tagloader'] = 'loadIPv4PrefixTags';
250 $tab['ipv4net']['default'] = 'Browse';
251 $tab['ipv4net']['properties'] = 'Properties';
252 $tab['ipv4net']['liveptr'] = 'Live PTR';
253 $tab['ipv4net']['tags'] = 'Tags';
254 $tab['ipv4net']['files'] = 'Files';
255 $tabhandler['ipv4net']['default'] = 'renderIPv4Network';
256 $tabhandler['ipv4net']['properties'] = 'renderIPv4NetworkProperties';
257 $tabhandler['ipv4net']['liveptr'] = 'renderLivePTR';
258 $tabhandler['ipv4net']['tags'] = 'renderEntityTags';
259 $tabhandler['ipv4net']['files'] = 'renderFilesForEntity';
260 $trigger['ipv4net']['tags'] = 'trigger_tags';
261 $ophandler['ipv4net']['properties']['editRange'] = 'updIPv4Prefix';
262 $ophandler['ipv4net']['liveptr']['importPTRData'] = 'importPTRData';
263 $ophandler['ipv4net']['tags']['saveTags'] = 'saveEntityTags';
264 $ophandler['ipv4net']['files']['addFile'] = 'addFileToEntity';
265 $ophandler['ipv4net']['files']['updateFile'] = 'updateFile';
266 $ophandler['ipv4net']['files']['linkFile'] = 'linkFileToEntity';
267 $ophandler['ipv4net']['files']['unlinkFile'] = 'unlinkFile';
268 $ophandler['ipv4net']['files']['deleteFile'] = 'deleteFile';
269 $msgcode['updIPv4Prefix']['OK'] = 25;
270 $msgcode['updIPv4Prefix']['ERR'] = 100;
271 $msgcode['importPTRData']['OK'] = 26;
272 $msgcode['importPTRData']['ERR'] = 141;
273
274 $page['ipaddress']['title_handler'] = 'dynamic_title_ipaddress';
275 $page['ipaddress']['parent'] = 'ipv4net';
276 $page['ipaddress']['bypass'] = 'ip';
277 $page['ipaddress']['bypass_type'] = 'inet4';
278 $page['ipaddress']['autotagloader'] = 'loadIPv4AddressAutoTags';
279 $tab['ipaddress']['default'] = 'Browse';
280 $tab['ipaddress']['properties'] = 'Properties';
281 $tab['ipaddress']['assignment'] = 'Allocation';
282 $tab['ipaddress']['editrslist'] = '[SLB real servers]';
283 $tabhandler['ipaddress']['default'] = 'renderIPv4Address';
284 $tabhandler['ipaddress']['properties'] = 'renderIPv4AddressProperties';
285 $tabhandler['ipaddress']['assignment'] = 'renderIPv4AddressAllocations';
286 $tabhandler['ipaddress']['editrslist'] = 'dragon';
287 $ophandler['ipaddress']['properties']['editAddress'] = 'editAddress';
288 $ophandler['ipaddress']['assignment']['delIPv4Allocation'] = 'delIPv4Allocation';
289 $ophandler['ipaddress']['assignment']['updIPv4Allocation'] = 'updIPv4Allocation';
290 $ophandler['ipaddress']['assignment']['addIPv4Allocation'] = 'addIPv4Allocation';
291 $msgcode['editAddress']['OK'] = 27;
292 $msgcode['editAddress']['ERR'] = 100;
293
294 $page['ipv4slb']['title'] = 'IPv4 SLB';
295 $page['ipv4slb']['parent'] = 'index';
296 $page['ipv4slb']['handler'] = 'renderIPv4SLB';
297
298 $page['ipv4vslist']['title'] = 'Virtual services';
299 $page['ipv4vslist']['parent'] = 'ipv4slb';
300 $tab['ipv4vslist']['default'] = 'View';
301 $tab['ipv4vslist']['edit'] = 'Edit';
302 $tabhandler['ipv4vslist']['default'] = 'renderVSList';
303 $tabhandler['ipv4vslist']['edit'] = 'renderVSListEditForm';
304 $ophandler['ipv4vslist']['edit']['add'] = 'addVService';
305 $ophandler['ipv4vslist']['edit']['del'] = 'deleteVService';
306 $ophandler['ipv4vslist']['edit']['upd'] = 'updateVService';
307 $msgcode['addVService']['OK'] = 28;
308 $msgcode['addVService']['ERR1'] = 132;
309 $msgcode['addVService']['ERR2'] = 100;
310 $msgcode['deleteVService']['OK'] = 29;
311 $msgcode['deleteVService']['ERR'] = 130;
312 $msgcode['updateVService']['OK'] = 30;
313 $msgcode['updateVService']['ERR'] = 135;
314
315 $page['ipv4vs']['title_handler'] = 'dynamic_title_vservice';
316 $page['ipv4vs']['parent'] = 'ipv4vslist';
317 $page['ipv4vs']['bypass'] = 'vs_id';
318 $page['ipv4vs']['bypass_type'] = 'uint';
319 $page['ipv4vs']['tagloader'] = 'loadIPv4VSTags';
320 $page['ipv4vs']['autotagloader'] = 'loadIPv4VSAutoTags';
321 $tab['ipv4vs']['default'] = 'View';
322 $tab['ipv4vs']['edit'] = 'Edit';
323 $tab['ipv4vs']['editlblist'] = 'Load balancers';
324 $tab['ipv4vs']['tags'] = 'Tags';
325 $tab['ipv4vs']['files'] = 'Files';
326 $tabhandler['ipv4vs']['default'] = 'renderVirtualService';
327 $tabhandler['ipv4vs']['edit'] = 'renderEditVService';
328 $tabhandler['ipv4vs']['editlblist'] = 'renderVServiceLBForm';
329 $tabhandler['ipv4vs']['tags'] = 'renderEntityTags';
330 $tabhandler['ipv4vs']['files'] = 'renderFilesForEntity';
331 $trigger['ipv4vs']['tags'] = 'trigger_tags';
332 $ophandler['ipv4vs']['edit']['updIPv4VS'] = 'updateVService';
333 $ophandler['ipv4vs']['editlblist']['addLB'] = 'addLoadBalancer';
334 $ophandler['ipv4vs']['editlblist']['delLB'] = 'deleteLoadBalancer';
335 $ophandler['ipv4vs']['editlblist']['updLB'] = 'updateLoadBalancer';
336 $ophandler['ipv4vs']['tags']['saveTags'] = 'saveEntityTags';
337 $ophandler['ipv4vs']['files']['addFile'] = 'addFileToEntity';
338 $ophandler['ipv4vs']['files']['updateFile'] = 'updateFile';
339 $ophandler['ipv4vs']['files']['linkFile'] = 'linkFileToEntity';
340 $ophandler['ipv4vs']['files']['unlinkFile'] = 'unlinkFile';
341 $ophandler['ipv4vs']['files']['deleteFile'] = 'deleteFile';
342
343 $page['ipv4rsplist']['title'] = 'RS pools';
344 $page['ipv4rsplist']['parent'] = 'ipv4slb';
345 $tab['ipv4rsplist']['default'] = 'View';
346 $tab['ipv4rsplist']['edit'] = 'Edit';
347 $tabhandler['ipv4rsplist']['default'] = 'renderRSPoolList';
348 $tabhandler['ipv4rsplist']['edit'] = 'editRSPools';
349 $ophandler['ipv4rsplist']['edit']['add'] = 'addRSPool';
350 $ophandler['ipv4rsplist']['edit']['del'] = 'deleteRSPool';
351 $ophandler['ipv4rsplist']['edit']['upd'] = 'updateRSPool';
352 $msgcode['addRSPool']['OK'] = 31;
353 $msgcode['addRSPool']['ERR'] = 100;
354 $msgcode['deleteRSPool']['OK'] = 32;
355 $msgcode['deleteRSPool']['ERR'] = 138;
356 $msgcode['updateRSPool']['OK'] = 33;
357 $msgcode['updateRSPool']['ERR'] = 139;
358
359 $page['ipv4rspool']['title_handler'] = 'dynamic_title_rspool';
360 $page['ipv4rspool']['parent'] = 'ipv4rsplist';
361 $page['ipv4rspool']['bypass'] = 'pool_id';
362 $page['ipv4rspool']['bypass_type'] = 'uint';
363 $page['ipv4rspool']['tagloader'] = 'loadIPv4RSPoolTags';
364 $page['ipv4rspool']['autotagloader'] = 'loadIPv4RSPoolAutoTags';
365 $tab['ipv4rspool']['default'] = 'View';
366 $tab['ipv4rspool']['edit'] = 'Edit';
367 $tab['ipv4rspool']['editlblist'] = 'Load Balancers';
368 $tab['ipv4rspool']['editrslist'] = 'RS list';
369 $tab['ipv4rspool']['rsinservice'] = 'RS in service';
370 $tab['ipv4rspool']['tags'] = 'Tags';
371 $tab['ipv4rspool']['files'] = 'Files';
372 $trigger['ipv4rspool']['rsinservice'] = 'trigger_poolrscount';
373 $trigger['ipv4rspool']['tags'] = 'trigger_tags';
374 $tabhandler['ipv4rspool']['default'] = 'renderRSPool';
375 $tabhandler['ipv4rspool']['edit'] = 'renderEditRSPool';
376 $tabhandler['ipv4rspool']['editrslist'] = 'renderRSPoolServerForm';
377 $tabhandler['ipv4rspool']['editlblist'] = 'renderRSPoolLBForm';
378 $tabhandler['ipv4rspool']['rsinservice'] = 'renderRSPoolRSInServiceForm';
379 $tabhandler['ipv4rspool']['tags'] = 'renderEntityTags';
380 $tabhandler['ipv4rspool']['files'] = 'renderFilesForEntity';
381 $ophandler['ipv4rspool']['edit']['updIPv4RSP'] = 'updateRSPool';
382 $ophandler['ipv4rspool']['editrslist']['addRS'] = 'addRealServer';
383 $ophandler['ipv4rspool']['editrslist']['delRS'] = 'deleteRealServer';
384 $ophandler['ipv4rspool']['editrslist']['updRS'] = 'updateRealServer';
385 $ophandler['ipv4rspool']['editrslist']['addMany'] = 'addRealServers';
386 $ophandler['ipv4rspool']['editlblist']['addLB'] = 'addLoadBalancer';
387 $ophandler['ipv4rspool']['editlblist']['delLB'] = 'deleteLoadBalancer';
388 $ophandler['ipv4rspool']['editlblist']['updLB'] = 'updateLoadBalancer';
389 $ophandler['ipv4rspool']['rsinservice']['upd'] = 'updateRSInService';
390 $ophandler['ipv4rspool']['tags']['saveTags'] = 'saveEntityTags';
391 $ophandler['ipv4rspool']['files']['addFile'] = 'addFileToEntity';
392 $ophandler['ipv4rspool']['files']['updateFile'] = 'updateFile';
393 $ophandler['ipv4rspool']['files']['linkFile'] = 'linkFileToEntity';
394 $ophandler['ipv4rspool']['files']['unlinkFile'] = 'unlinkFile';
395 $ophandler['ipv4rspool']['files']['deleteFile'] = 'deleteFile';
396 $msgcode['addRealServer']['OK'] = 34;
397 $msgcode['addRealServer']['ERR'] = 126;
398 $msgcode['deleteRealServer']['OK'] = 35;
399 $msgcode['deleteRealServer']['ERR'] = 128;
400 $msgcode['updateRealServer']['OK'] = 36;
401 $msgcode['updateRealServer']['ERR'] = 133;
402 $msgcode['addRealServers']['OK'] = 37;
403 $msgcode['addRealServers']['ERR1'] = 131;
404 $msgcode['addRealServers']['ERR2'] = 127;
405 $msgcode['updateRSInService']['OK'] = 38;
406 $msgcode['updateRSInService']['ERR'] = 140;
407
408 $page['rservers']['title'] = 'Real servers';
409 $page['rservers']['parent'] = 'ipv4slb';
410 $page['rservers']['handler'] = 'renderRealServerList';
411
412 $page['lbs']['title'] = 'Load balancers';
413 $page['lbs']['parent'] = 'ipv4slb';
414 $page['lbs']['handler'] = 'renderLBList';
415
416 $page['search']['title_handler'] = 'dynamic_title_search';
417 $page['search']['handler'] = 'renderSearchResults';
418 $page['search']['parent'] = 'index';
419 $page['search']['bypass'] = 'q';
420
421 $page['config']['title'] = 'Configuration';
422 $page['config']['handler'] = 'renderConfigMainpage';
423 $page['config']['parent'] = 'index';
424
425 $page['userlist']['title'] = 'Users';
426 $page['userlist']['parent'] = 'config';
427 $tab['userlist']['default'] = 'View';
428 $tab['userlist']['edit'] = 'Edit';
429 $tabhandler['userlist']['default'] = 'renderUserList';
430 $tabhandler['userlist']['edit'] = 'renderUserListEditor';
431 $ophandler['userlist']['edit']['updateUser'] = 'updateUser';
432 $ophandler['userlist']['edit']['createUser'] = 'createUser';
433 $msgcode['updateUser']['OK'] = 39;
434 $msgcode['updateUser']['ERR1'] = 103;
435 $msgcode['updateUser']['ERR1'] = 104;
436 $msgcode['createUser']['OK'] = 40;
437 $msgcode['createUser']['ERR'] = 102;
438
439 $page['user']['title_handler'] = 'dynamic_title_user';
440 $page['user']['parent'] = 'userlist';
441 $page['user']['bypass'] = 'user_id';
442 $page['user']['bypass_type'] = 'uint';
443 $page['user']['tagloader'] = 'loadUserTags';
444 $page['user']['autotagloader'] = 'getUserAutoTags';
445 $tab['user']['default'] = 'View';
446 $tab['user']['tags'] = 'Tags';
447 $tab['user']['files'] = 'Files';
448 $tabhandler['user']['default'] = 'renderUser';
449 $tabhandler['user']['tags'] = 'renderEntityTags';
450 $tabhandler['user']['files'] = 'renderFilesForEntity';
451 $ophandler['user']['tags']['saveTags'] = 'saveEntityTags';
452 $ophandler['user']['files']['addFile'] = 'addFileToEntity';
453 $ophandler['user']['files']['updateFile'] = 'updateFile';
454 $ophandler['user']['files']['linkFile'] = 'linkFileToEntity';
455 $ophandler['user']['files']['unlinkFile'] = 'unlinkFile';
456 $ophandler['user']['files']['deleteFile'] = 'deleteFile';
457
458 $page['perms']['title'] = 'Permissions';
459 $page['perms']['parent'] = 'config';
460 $tab['perms']['default'] = 'View';
461 $tab['perms']['edit'] = 'Edit';
462 $tabhandler['perms']['default'] = 'renderRackCodeViewer';
463 $tabhandler['perms']['edit'] = 'renderRackCodeEditor';
464 $ophandler['perms']['edit']['saveRackCode'] = 'saveRackCode';
465 $msgcode['saveRackCode']['OK'] = 43;
466 $msgcode['saveRackCode']['ERR1'] = 154;
467 $msgcode['saveRackCode']['ERR2'] = 155;
468
469 $page['portmap']['title'] = 'Port compatibility map';
470 $page['portmap']['parent'] = 'config';
471 $tab['portmap']['default'] = 'View';
472 $tab['portmap']['edit'] = 'Change';
473 $tabhandler['portmap']['default'] = 'renderPortMapViewer';
474 $tabhandler['portmap']['edit'] = 'renderPortMapEditor';
475 $ophandler['portmap']['edit']['save'] = 'savePortMap';
476 $msgcode['savePortMap']['OK'] = 44;
477 $msgcode['savePortMap']['ERR'] = 108;
478
479 $page['attrs']['title'] = 'Attributes';
480 $page['attrs']['parent'] = 'config';
481 $tab['attrs']['default'] = 'View';
482 $tab['attrs']['editattrs'] = 'Edit attributes';
483 $tab['attrs']['editmap'] = 'Edit map';
484 $tabhandler['attrs']['default'] = 'renderAttributes';
485 $tabhandler['attrs']['editattrs'] = 'renderEditAttributesForm';
486 $tabhandler['attrs']['editmap'] = 'renderEditAttrMapForm';
487 $ophandler['attrs']['editattrs']['add'] = 'createAttribute';
488 $ophandler['attrs']['editattrs']['upd'] = 'changeAttribute';
489 $ophandler['attrs']['editattrs']['del'] = 'deleteAttribute';
490 $ophandler['attrs']['editmap']['add'] = 'supplementAttrMap';
491 $ophandler['attrs']['editmap']['del'] = 'reduceAttrMap';
492 $msgcode['createAttribute']['OK'] = 45;
493 $msgcode['createAttribute']['ERR'] = 116;
494 $msgcode['changeAttribute']['OK'] = 46;
495 $msgcode['changeAttribute']['ERR'] = 115;
496 $msgcode['deleteAttribute']['OK'] = 47;
497 $msgcode['deleteAttribute']['ERR'] = 117;
498 $msgcode['supplementAttrMap']['OK'] = 48;
499 $msgcode['supplementAttrMap']['ERR'] = 118;
500 $msgcode['reduceAttrMap']['OK'] = 49;
501 $msgcode['reduceAttrMap']['ERR'] = 119;
502
503 $page['dict']['title'] = 'Dictionary';
504 $page['dict']['parent'] = 'config';
505 $tab['dict']['default'] = 'View';
506 $tab['dict']['chapters'] = 'Manage chapters';
507 $tabhandler['dict']['default'] = 'renderDictionary';
508 $tabhandler['dict']['chapters'] = 'renderChaptersEditor';
509 $ophandler['dict']['chapters']['del'] = 'delChapter';
510 $ophandler['dict']['chapters']['upd'] = 'updateChapter';
511 $ophandler['dict']['chapters']['add'] = 'addChapter';
512 $msgcode['delChapter']['OK'] = 53;
513 $msgcode['delChapter']['ERR'] = 114;
514 $msgcode['updateChapter']['OK'] = 54;
515 $msgcode['updateChapter']['ERR'] = 113;
516 $msgcode['addChapter']['OK'] = 55;
517 $msgcode['addChapter']['ERR'] = 112;
518
519 $page['chapter']['title_handler'] = 'dynamic_title_chapter';
520 $page['chapter']['parent'] = 'dict';
521 $page['chapter']['bypass'] = 'chapter_no';
522 $page['chapter']['bypass_type'] = 'uint';
523 $tab['chapter']['default'] = 'View';
524 $tab['chapter']['edit'] = 'Edit';
525 $tabhandler['chapter']['default'] = 'renderChapter';
526 $tabhandler['chapter']['edit'] = 'renderChapterEditor';
527 $ophandler['chapter']['edit']['del'] = 'reduceDictionary';
528 $ophandler['chapter']['edit']['upd'] = 'updateDictionary';
529 $ophandler['chapter']['edit']['add'] = 'supplementDictionary';
530 $msgcode['reduceDictionary']['OK'] = 50;
531 $msgcode['reduceDictionary']['ERR'] = 111;
532 $msgcode['updateDictionary']['OK'] = 51;
533 $msgcode['updateDictionary']['ERR'] = 109;
534 $msgcode['supplementDictionary']['OK'] = 52;
535 $msgcode['supplementDictionary']['ERR'] = 110;
536
537 $page['ui']['title'] = 'User interface';
538 $page['ui']['parent'] = 'config';
539 $tab['ui']['default'] = 'View';
540 $tab['ui']['edit'] = 'Change';
541 $tab['ui']['reset'] = 'Reset';
542 $tabhandler['ui']['default'] = 'renderUIConfig';
543 $tabhandler['ui']['edit'] = 'renderUIConfigEditForm';
544 $tabhandler['ui']['reset'] = 'renderUIResetForm';
545 $ophandler['ui']['edit']['upd'] = 'updateUI';
546 $ophandler['ui']['reset']['go'] = 'resetUIConfig';
547 $msgcode['updateUI']['OK'] = 56;
548 $msgcode['updateUI']['ERR'] = 125;
549 $msgcode['resetUIConfig']['OK'] = 57;
550
551 $page['tagtree']['title'] = 'Tag tree';
552 $page['tagtree']['parent'] = 'config';
553 $tab['tagtree']['default'] = 'View';
554 $tab['tagtree']['edit'] = 'Edit';
555 $tabhandler['tagtree']['default'] = 'renderTagTree';
556 $tabhandler['tagtree']['edit'] = 'renderTagTreeEditor';
557 $ophandler['tagtree']['edit']['destroyTag'] = 'destroyTag';
558 $ophandler['tagtree']['edit']['createTag'] = 'createTag';
559 $ophandler['tagtree']['edit']['updateTag'] = 'updateTag';
560 $msgcode['destroyTag']['OK'] = 58;
561 $msgcode['destroyTag']['ERR'] = 144;
562 $msgcode['createTag']['OK'] = 59;
563 $msgcode['createTag']['ERR1'] = 145;
564 $msgcode['createTag']['ERR2'] = 146;
565 $msgcode['createTag']['ERR3'] = 147;
566 $msgcode['updateTag']['OK'] = 60;
567 $msgcode['updateTag']['ERR1'] = 145;
568 $msgcode['updateTag']['ERR2'] = 148;
569
570 $page['myaccount']['title'] = 'My account';
571 $page['myaccount']['parent'] = 'config';
572 $tab['myaccount']['default'] = 'Info';
573 $tab['myaccount']['mypassword'] = 'Password change';
574 $tab['myaccount']['myrealname'] = '[Real name change]';
575 $trigger['myaccount']['mypassword'] = 'trigger_passwdchange';
576 $tabhandler['myaccount']['default'] = 'renderMyAccount';
577 $tabhandler['myaccount']['mypassword'] = 'renderMyPasswordEditor';
578 $tabhandler['myaccount']['myrealname'] = 'dragon';
579 $ophandler['myaccount']['mypassword']['changeMyPassword'] = 'changeMyPassword';
580 $msgcode['changeMyPassword']['OK'] = 61;
581 $msgcode['changeMyPassword']['ERR1'] = 150;
582 $msgcode['changeMyPassword']['ERR2'] = 151;
583 $msgcode['changeMyPassword']['ERR3'] = 152;
584 $msgcode['changeMyPassword']['ERR4'] = 153;
585
586 $page['reports']['title'] = 'Reports';
587 $page['reports']['parent'] = 'index';
588 $tab['reports']['default'] = 'System';
589 $tab['reports']['rackcode'] = 'RackCode';
590 $tab['reports']['ipv4'] = 'IPv4';
591 $tab['reports']['local'] = 'Local';
592 $trigger['reports']['local'] = 'trigger_localreports';
593 $tabhandler['reports']['default'] = 'renderSystemReports';
594 $tabhandler['reports']['rackcode'] = 'renderRackCodeReports';
595 $tabhandler['reports']['ipv4'] = 'renderIPv4Reports';
596 $tabhandler['reports']['local'] = 'renderLocalReports';
597
598 $page['files']['title'] = 'Files';
599 $page['files']['parent'] = 'index';
600 $tab['files']['default'] = 'View';
601 $tab['files']['addmore'] = 'Upload';
602 $tabhandler['files']['default'] = 'renderFileSpace';
603 $tabhandler['files']['addmore'] = 'renderFileUploadForm';
604 $ophandler['files']['addmore']['addFile'] = 'addFileWithoutLink';
605 $msgcode['addFileWithoutLink']['OK'] = 69;
606 $msgcode['addFileWithoutLink']['ERR'] = 100;
607
608 $page['filesbylink']['title_handler'] = 'dynamic_title_file';
609 $page['filesbylink']['handler'] = 'renderFilesByLink'; //renderObjectGroup
610 $page['filesbylink']['bypass'] = 'entity_type';
611 $page['filesbylink']['bypass_type'] = 'string';
612 $page['filesbylink']['parent'] = 'files';
613 $ophandler['filesbylink']['default']['deleteFile'] = 'deleteFile';
614
615 $page['file']['title_handler'] = 'dynamic_title_file';
616 $page['file']['bypass'] = 'file_id';
617 $page['file']['bypass_type'] = 'uint';
618 $page['file']['parent'] = 'files';
619 $page['file']['tagloader'] = 'loadFileTags';
620 $page['file']['autotagloader'] = 'loadFileAutoTags';
621 $tab['file']['default'] = 'View';
622 $tab['file']['tags'] = 'Tags';
623 $trigger['file']['tags'] = 'trigger_tags';
624 $tabhandler['file']['tags'] = 'renderEntityTags';
625 $tabhandler['file']['default'] = 'renderFile';
626 $ophandler['file']['tags']['saveTags'] = 'saveEntityTags';
627
628 // This function returns array if page numbers leading to the target page
629 // plus page number of target page itself. The first element is the target
630 // page number and the last element is the index page number.
631 function getPath ($targetno)
632 {
633 global $page;
634 $path = array();
635 // Recursion breaks at first parentless page.
636 if (!isset ($page[$targetno]['parent']))
637 $path = array ($targetno);
638 else
639 {
640 $path = getPath ($page[$targetno]['parent']);
641 $path[] = $targetno;
642 }
643 return $path;
644 }
645
646 function showPathAndSearch ($pageno)
647 {
648 global $root, $page;
649 // Path.
650 echo "<td class=activemenuitem width='99%'>" . getConfigVar ('enterprise');
651 $path = getPath ($pageno);
652 foreach ($path as $no)
653 {
654 $title['params'] = array();
655 if (isset ($page[$no]['title']))
656 $title['name'] = $page[$no]['title'];
657 elseif (isset ($page[$no]['title_handler']))
658 $title = $page[$no]['title_handler']($no);
659 else
660 $title['name'] = '[N/A]';
661 echo ": <a href='${root}?page=${no}&tab=default";
662 foreach ($title['params'] as $param_name => $param_value)
663 echo "&${param_name}=${param_value}";
664 echo "'>" . $title['name'] . "</a>";
665 }
666 echo "</td>";
667 // Search form.
668 echo "<td><table border=0 cellpadding=0 cellspacing=0><tr><td>Search:</td>";
669 echo "<form name=search method=get action='${root}'><td>";
670 echo '<input type=hidden name=page value=search>';
671 // This input will be the first, if we don't add ports or addresses.
672 echo "<input type=text name=q size=20 tabindex=1000></td></form></tr></table></td>";
673 }
674
675 function getTitle ($pageno, $tabno)
676 {
677 global $page;
678 if (isset ($page[$pageno]['title']))
679 return $page[$pageno]['title'];
680 elseif (isset ($page[$pageno]['title_handler']))
681 {
682 $tmp = $page[$pageno]['title_handler']($pageno);
683 return $tmp['name'];
684 }
685 else
686 return getConfigVar ('enterprise');
687 }
688
689 function showTabs ($pageno, $tabno)
690 {
691 global $tab, $root, $page, $remote_username, $trigger, $tabextraclass;
692 if (!isset ($tab[$pageno]['default']))
693 return;
694 echo "<td><div class=greynavbar><ul id=foldertab style='margin-bottom: 0px; padding-top: 10px;'>";
695 foreach ($tab[$pageno] as $tabidx => $tabtitle)
696 {
697 // Hide forbidden tabs.
698 if (!permitted ($pageno, $tabidx))
699 continue;
700 // Dynamic tabs should only be shown in certain cases (trigger exists and returns true).
701 if (isset ($trigger[$pageno][$tabidx]))
702 {
703 // $t1 = microtime (TRUE);
704 $ok = $trigger[$pageno][$tabidx] ();
705 // $t2 = microtime (TRUE);
706 // echo 'DEBUG: ' . $trigger[$pageno][$tabidx] . ': ' . sprintf ('%0.4f', $t2 - $t1) . '<br>';
707 if (!$ok)
708 continue;
709 }
710 $class = ($tabidx == $tabno) ? 'current' : 'std';
711 $extra = (isset ($tabextraclass[$pageno][$tabidx])) ? $tabextraclass[$pageno][$tabidx] : '';
712 echo "<li><a class=${class}{$extra}";
713 echo " href='${root}?page=${pageno}&tab=${tabidx}";
714 if (isset ($page[$pageno]['bypass']) and isset ($_REQUEST[$page[$pageno]['bypass']]))
715 {
716 $bpname = $page[$pageno]['bypass'];
717 $bpval = $_REQUEST[$bpname];
718 echo "&${bpname}=${bpval}";
719 }
720 echo "'>${tabtitle}</a></li>\n";
721 }
722 echo "</ul></div></td>\n";
723 }
724
725 // This function returns pages, which are direct children of the requested
726 // page and are accessible by the current user.
727 function getDirectChildPages ($pageno)
728 {
729 global $page, $remote_username;
730 $children = array();
731 foreach ($page as $cpageno => $cpage)
732 if
733 (
734 isset ($cpage['parent']) and
735 $cpage['parent'] == $pageno
736 )
737 $children[$cpageno] = $cpage;
738 return $children;
739 }
740
741 function getAllChildPages ($parent)
742 {
743 global $page;
744 // Array pointer is global, so if we don't create local copies of
745 // the global array, we can't advance any more after nested call
746 // of getAllChildPages returns.
747 $mypage = $page;
748 $mykids = array();
749 foreach ($mypage as $ctitle => $cpage)
750 if (isset ($cpage['parent']) and $cpage['parent'] == $parent)
751 $mykids[] = array ('title' => $ctitle, 'kids' => getAllChildPages ($ctitle));
752 return $mykids;
753 }
754
755 ?>