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