r2666 - introduced LDAPCache table (ticket:193)
[racktables] / inc / navigation.php
CommitLineData
b325120a 1<?php
e673ee24
DO
2/*
3*
4* This file implements generic navigation for RackTables.
5*
6*/
7
83dd1b15
DO
8$page = array();
9$tab = array();
83dd1b15
DO
10$trigger = array();
11$ophandler = array();
81bab70c 12$tabhandler = array();
2f48b72b
DO
13$tabextraclass = array();
14$delayauth = array();
baf37d01 15$msgcode = array();
83dd1b15 16
eebf9145 17$page['index']['title'] = 'Main page';
e673ee24
DO
18$page['index']['handler'] = 'renderIndex';
19
eebf9145 20$page['rackspace']['title'] = 'Rackspace';
e673ee24
DO
21$page['rackspace']['parent'] = 'index';
22$tab['rackspace']['default'] = 'Browse';
345fd640 23$tab['rackspace']['edit'] = 'Manage rows';
e673ee24 24$tab['rackspace']['history'] = 'History';
8b6ffe9c 25$tabhandler['rackspace']['default'] = 'renderRackspace';
345fd640 26$tabhandler['rackspace']['edit'] = 'renderRackspaceRowEditor';
8b6ffe9c 27$tabhandler['rackspace']['history'] = 'renderRackspaceHistory';
345fd640
AD
28$ophandler['rackspace']['edit']['addRow'] = 'addRow';
29$ophandler['rackspace']['edit']['updateRow'] = 'updateRow';
9f14a7ef 30$ophandler['rackspace']['edit']['delete'] = 'deleteRow';
135080d8
DO
31$msgcode['addRow']['OK'] = 74;
32$msgcode['addRow']['ERR'] = 100;
33$msgcode['updateRow']['OK'] = 75;
34$msgcode['updateRow']['ERR'] = 100;
8628ae44 35$msgcode['deleteRow']['OK'] = 77;
9f14a7ef 36$msgcode['deleteRow']['ERR'] = 100;
e673ee24 37
eebf9145 38$page['objects']['title'] = 'Objects';
e673ee24
DO
39$page['objects']['parent'] = 'index';
40$tab['objects']['default'] = 'View';
216c84bb 41$tab['objects']['addmore'] = 'Add more';
7cc02fc1 42$tabhandler['objects']['default'] = 'renderObjectSpace';
216c84bb 43$tabhandler['objects']['addmore'] = 'renderAddMultipleObjectsForm';
42d73cbf
DY
44$ophandler['objects']['addmore']['addObjects'] = 'addMultipleObjects';
45$ophandler['objects']['addmore']['addLotOfObjects'] = 'addLotOfObjects';
52b34485 46$ophandler['objects']['default']['deleteObject'] = 'deleteObject';
135080d8
DO
47$msgcode['deleteObject']['OK'] = 76;
48$msgcode['deleteObject']['ERR'] = 100;
e673ee24 49
eebf9145 50$page['row']['title_handler'] = 'dynamic_title_row';
e673ee24 51$page['row']['bypass'] = 'row_id';
8b6ffe9c 52$page['row']['bypass_type'] = 'uint';
e673ee24
DO
53$page['row']['parent'] = 'rackspace';
54$tab['row']['default'] = 'View';
55$tab['row']['newrack'] = 'Add new rack';
eb6ea26f 56$tab['row']['tagroller'] = 'Tag roller';
8b6ffe9c
DO
57$tabhandler['row']['default'] = 'renderRow';
58$tabhandler['row']['newrack'] = 'renderNewRackForm';
2f32cc32 59$tabhandler['row']['tagroller'] = 'renderTagRollerForRow';
eb6ea26f 60$ophandler['row']['tagroller']['rollTags'] = 'rollTags';
f19c75d6 61$ophandler['row']['newrack']['addRack'] = 'addRack';
135080d8
DO
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;
e673ee24 67
eebf9145 68$page['rack']['title_handler'] = 'dynamic_title_rack';
e673ee24 69$page['rack']['bypass'] = 'rack_id';
8b6ffe9c 70$page['rack']['bypass_type'] = 'uint';
e673ee24
DO
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';
41bd8c87 76$tab['rack']['tags'] = 'Tags';
e1ae3fb4 77$tab['rack']['files'] = 'Files';
8b6ffe9c
DO
78$tabhandler['rack']['default'] = 'renderRackPage';
79$tabhandler['rack']['edit'] = 'renderEditRackForm';
80$tabhandler['rack']['design'] = 'renderRackDesign';
81$tabhandler['rack']['problems'] = 'renderRackProblems';
482c7f35
DO
82$tabhandler['rack']['tags'] = 'renderEntityTags';
83$tabhandler['rack']['files'] = 'renderFilesForEntity';
41bd8c87 84$trigger['rack']['tags'] = 'trigger_tags';
4fbb5a00
DY
85$ophandler['rack']['design']['updateRack'] = 'updateRackDesign';
86$ophandler['rack']['problems']['updateRack'] = 'updateRackProblems';
7056988c 87$ophandler['rack']['edit']['updateRack'] = 'updateRack';
c8187437 88$ophandler['rack']['edit']['deleteRack'] = 'deleteRack';
3355ca56 89$ophandler['rack']['tags']['saveTags'] = 'saveEntityTags';
e1ae3fb4 90$ophandler['rack']['files']['addFile'] = 'addFileToEntity';
e1ae3fb4
AD
91$ophandler['rack']['files']['linkFile'] = 'linkFileToEntity';
92$ophandler['rack']['files']['unlinkFile'] = 'unlinkFile';
135080d8
DO
93$msgcode['updateRack']['OK'] = 68;
94$msgcode['updateRack']['ERR'] = 177;
95$msgcode['addFileToEntity']['OK'] = 69;
9a61c175
DO
96$msgcode['addFileToEntity']['ERR1'] = 187;
97$msgcode['addFileToEntity']['ERR2'] = 181;
98$msgcode['addFileToEntity']['ERR3'] = 182;
135080d8
DO
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;
9a61c175 105$msgcode['unlinkFile']['ERR'] = 182;
e673ee24 106
eebf9145 107$page['objgroup']['title_handler'] = 'dynamic_title_objgroup';
3aeb15f3 108$page['objgroup']['handler'] = 'renderObjectGroup';
e673ee24 109$page['objgroup']['bypass'] = 'group_id';
105cea6e 110$page['objgroup']['bypass_type'] = 'uint0';
e673ee24 111$page['objgroup']['parent'] = 'objects';
52b34485 112$ophandler['objgroup']['default']['deleteObject'] = 'deleteObject';
e673ee24 113
eebf9145 114$page['object']['title_handler'] = 'dynamic_title_object';
e673ee24 115$page['object']['bypass'] = 'object_id';
3bebaebd 116$page['object']['bypass_type'] = 'uint';
e673ee24
DO
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';
72d8ced3
DO
122$tab['object']['ipv4'] = 'IPv4';
123$tab['object']['nat4'] = 'NATv4';
46f92ff7 124$tab['object']['livevlans'] = 'Live VLANs';
9c67f713 125$tab['object']['snmpportfinder'] = 'SNMP port finder';
0dfaea8e 126$tab['object']['editrspvs'] = 'RS pools';
a0527aef 127$tab['object']['lvsconfig'] = 'keepalived.conf';
118e4c38 128$tab['object']['autoports'] = 'AutoPorts';
2fb24351 129$tab['object']['tags'] = 'Tags';
e1ae3fb4 130$tab['object']['files'] = 'Files';
e45a78d7
DO
131$tabhandler['object']['default'] = 'renderRackObject';
132$tabhandler['object']['edit'] = 'renderEditObjectForm';
133$tabhandler['object']['rackspace'] = 'renderRackSpaceForObject';
134$tabhandler['object']['ports'] = 'renderPortsForObject';
72d8ced3
DO
135$tabhandler['object']['ipv4'] = 'renderIPv4ForObject';
136$tabhandler['object']['nat4'] = 'renderNATv4ForObject';
46f92ff7 137$tabhandler['object']['livevlans'] = 'renderVLANMembership';
e45a78d7 138$tabhandler['object']['snmpportfinder'] = 'renderSNMPPortFinder';
3ee1252b 139$tabhandler['object']['lvsconfig'] = 'renderLVSConfig';
118e4c38 140$tabhandler['object']['autoports'] = 'renderAutoPortsForm';
482c7f35
DO
141$tabhandler['object']['tags'] = 'renderEntityTags';
142$tabhandler['object']['files'] = 'renderFilesForEntity';
0dfaea8e 143$tabhandler['object']['editrspvs'] = 'renderObjectSLB';
08b16bf5
DO
144$tabextraclass['object']['snmpportfinder'] = 'attn';
145$tabextraclass['object']['autoports'] = 'attn';
72d8ced3
DO
146$trigger['object']['ipv4'] = 'trigger_ipv4';
147$trigger['object']['nat4'] = 'trigger_natv4';
46f92ff7 148$trigger['object']['livevlans'] = 'trigger_livevlans';
9c67f713 149$trigger['object']['snmpportfinder'] = 'trigger_snmpportfinder';
a0527aef
DO
150$trigger['object']['editrspvs'] = 'trigger_isloadbalancer';
151$trigger['object']['lvsconfig'] = 'trigger_isloadbalancer';
118e4c38 152$trigger['object']['autoports'] = 'trigger_autoports';
91dbb8a3 153$trigger['object']['tags'] = 'trigger_tags';
4fbb5a00 154$ophandler['object']['rackspace']['updateObjectAllocation'] = 'updateObjectAllocation';
e673ee24
DO
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';
72d8ced3
DO
162$ophandler['object']['ipv4']['updIPv4Allocation'] = 'updIPv4Allocation';
163$ophandler['object']['ipv4']['addIPv4Allocation'] = 'addIPv4Allocation';
164$ophandler['object']['ipv4']['delIPv4Allocation'] = 'delIPv4Allocation';
22bb04da 165$ophandler['object']['edit']['clearSticker'] = 'clearSticker';
22bb04da 166$ophandler['object']['edit']['update'] = 'updateObject';
72d8ced3
DO
167$ophandler['object']['nat4']['addNATv4Rule'] = 'addPortForwarding';
168$ophandler['object']['nat4']['delNATv4Rule'] = 'delPortForwarding';
169$ophandler['object']['nat4']['updNATv4Rule'] = 'updPortForwarding';
46f92ff7 170$ophandler['object']['livevlans']['setPortVLAN'] = 'setPortVLAN';
f3f0161f 171$ophandler['object']['autoports']['generate'] = 'generateAutoPorts';
3355ca56 172$ophandler['object']['tags']['saveTags'] = 'saveEntityTags';
e1ae3fb4 173$ophandler['object']['files']['addFile'] = 'addFileToEntity';
e1ae3fb4
AD
174$ophandler['object']['files']['linkFile'] = 'linkFileToEntity';
175$ophandler['object']['files']['unlinkFile'] = 'unlinkFile';
0dfaea8e
DO
176$ophandler['object']['editrspvs']['addLB'] = 'addLoadBalancer';
177$ophandler['object']['editrspvs']['delLB'] = 'deleteLoadBalancer';
178$ophandler['object']['editrspvs']['updLB'] = 'updateLoadBalancer';
2987fc1f 179$ophandler['object']['lvsconfig']['submitSLBConfig'] = 'submitSLBConfig';
7056988c 180$ophandler['object']['snmpportfinder']['querySNMPData'] = 'querySNMPData';
46f92ff7 181$delayauth['object']['livevlans']['setPortVLAN'] = TRUE;
135080d8
DO
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;
9a61c175
DO
225$msgcode['saveEntityTags']['ERR1'] = 143;
226$msgcode['saveEntityTags']['ERR2'] = 187;
c8187437
DY
227$msgcode['deleteRack']['OK'] = 79;
228$msgcode['deleteRack']['ERR'] = 100;
229$msgcode['deleteRack']['ERR1'] = 206;
e673ee24 230
eebf9145 231$page['ipv4space']['title'] = 'IPv4 space';
e673ee24
DO
232$page['ipv4space']['parent'] = 'index';
233$tab['ipv4space']['default'] = 'Browse';
0bcdc163 234$tab['ipv4space']['newrange'] = 'Manage';
04d619d0
DO
235$tabhandler['ipv4space']['default'] = 'renderIPv4Space';
236$tabhandler['ipv4space']['newrange'] = 'renderIPv4SpaceEditor';
42023f03
DO
237$ophandler['ipv4space']['newrange']['addIPv4Prefix'] = 'addIPv4Prefix';
238$ophandler['ipv4space']['newrange']['delIPv4Prefix'] = 'delIPv4Prefix';
04d619d0 239$ophandler['ipv4space']['newrange']['updIPv4Prefix'] = 'updIPv4Prefix';
135080d8
DO
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;
e673ee24 248
e1ae3fb4
AD
249$page['ipv4net']['title_handler'] = 'dynamic_title_ipv4net';
250$page['ipv4net']['parent'] = 'ipv4space';
251$page['ipv4net']['bypass'] = 'id';
252$page['ipv4net']['bypass_type'] = 'uint';
e1ae3fb4
AD
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';
482c7f35
DO
261$tabhandler['ipv4net']['tags'] = 'renderEntityTags';
262$tabhandler['ipv4net']['files'] = 'renderFilesForEntity';
e1ae3fb4
AD
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';
e1ae3fb4
AD
268$ophandler['ipv4net']['files']['linkFile'] = 'linkFileToEntity';
269$ophandler['ipv4net']['files']['unlinkFile'] = 'unlinkFile';
135080d8
DO
270$msgcode['updIPv4Prefix']['OK'] = 25;
271$msgcode['updIPv4Prefix']['ERR'] = 100;
272$msgcode['importPTRData']['OK'] = 26;
273$msgcode['importPTRData']['ERR'] = 141;
e673ee24 274
eebf9145 275$page['ipaddress']['title_handler'] = 'dynamic_title_ipaddress';
e1ae3fb4 276$page['ipaddress']['parent'] = 'ipv4net';
e673ee24 277$page['ipaddress']['bypass'] = 'ip';
1fbc9fd6 278$page['ipaddress']['bypass_type'] = 'inet4';
e673ee24
DO
279$tab['ipaddress']['default'] = 'Browse';
280$tab['ipaddress']['properties'] = 'Properties';
281$tab['ipaddress']['assignment'] = 'Allocation';
7e13adfe 282$tab['ipaddress']['editrslist'] = '[SLB real servers]';
2d318652
DO
283$tabhandler['ipaddress']['default'] = 'renderIPv4Address';
284$tabhandler['ipaddress']['properties'] = 'renderIPv4AddressProperties';
285$tabhandler['ipaddress']['assignment'] = 'renderIPv4AddressAllocations';
1fbc9fd6 286$tabhandler['ipaddress']['editrslist'] = 'dragon';
e673ee24 287$ophandler['ipaddress']['properties']['editAddress'] = 'editAddress';
b4c1ef87
DO
288$ophandler['ipaddress']['assignment']['delIPv4Allocation'] = 'delIPv4Allocation';
289$ophandler['ipaddress']['assignment']['updIPv4Allocation'] = 'updIPv4Allocation';
290$ophandler['ipaddress']['assignment']['addIPv4Allocation'] = 'addIPv4Allocation';
135080d8
DO
291$msgcode['editAddress']['OK'] = 27;
292$msgcode['editAddress']['ERR'] = 100;
e673ee24 293
f973f491
DO
294$page['ipv4slb']['title'] = 'IPv4 SLB';
295$page['ipv4slb']['parent'] = 'index';
296$page['ipv4slb']['handler'] = 'renderIPv4SLB';
297
a239e016
DO
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';
135080d8
DO
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;
b3c50e6c 314
2bb798a3
DO
315$page['ipv4vs']['title_handler'] = 'dynamic_title_vservice';
316$page['ipv4vs']['parent'] = 'ipv4vslist';
49fb2686 317$page['ipv4vs']['bypass'] = 'vs_id';
2bb798a3 318$page['ipv4vs']['bypass_type'] = 'uint';
2bb798a3 319$tab['ipv4vs']['default'] = 'View';
c9890988 320$tab['ipv4vs']['edit'] = 'Edit';
49fb2686 321$tab['ipv4vs']['editlblist'] = 'Load balancers';
2bb798a3 322$tab['ipv4vs']['tags'] = 'Tags';
e1ae3fb4 323$tab['ipv4vs']['files'] = 'Files';
2bb798a3
DO
324$tabhandler['ipv4vs']['default'] = 'renderVirtualService';
325$tabhandler['ipv4vs']['edit'] = 'renderEditVService';
49fb2686 326$tabhandler['ipv4vs']['editlblist'] = 'renderVServiceLBForm';
482c7f35
DO
327$tabhandler['ipv4vs']['tags'] = 'renderEntityTags';
328$tabhandler['ipv4vs']['files'] = 'renderFilesForEntity';
e1ae3fb4 329$trigger['ipv4vs']['tags'] = 'trigger_tags';
e02e1941 330$ophandler['ipv4vs']['edit']['updIPv4VS'] = 'updateVService';
49fb2686
DO
331$ophandler['ipv4vs']['editlblist']['addLB'] = 'addLoadBalancer';
332$ophandler['ipv4vs']['editlblist']['delLB'] = 'deleteLoadBalancer';
333$ophandler['ipv4vs']['editlblist']['updLB'] = 'updateLoadBalancer';
e1ae3fb4
AD
334$ophandler['ipv4vs']['tags']['saveTags'] = 'saveEntityTags';
335$ophandler['ipv4vs']['files']['addFile'] = 'addFileToEntity';
e1ae3fb4
AD
336$ophandler['ipv4vs']['files']['linkFile'] = 'linkFileToEntity';
337$ophandler['ipv4vs']['files']['unlinkFile'] = 'unlinkFile';
c9b4588f 338
ee437dab
DO
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';
135080d8
DO
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;
e1ae3fb4
AD
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';
e1ae3fb4
AD
359$tab['ipv4rspool']['default'] = 'View';
360$tab['ipv4rspool']['edit'] = 'Edit';
4a04bcb1 361$tab['ipv4rspool']['editlblist'] = 'Load balancers';
e1ae3fb4
AD
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';
482c7f35
DO
373$tabhandler['ipv4rspool']['tags'] = 'renderEntityTags';
374$tabhandler['ipv4rspool']['files'] = 'renderFilesForEntity';
e1ae3fb4
AD
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';
e1ae3fb4
AD
386$ophandler['ipv4rspool']['files']['linkFile'] = 'linkFileToEntity';
387$ophandler['ipv4rspool']['files']['unlinkFile'] = 'unlinkFile';
135080d8
DO
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;
71b8bda1 399
8253d9f0 400$page['rservers']['title'] = 'Real servers';
f973f491 401$page['rservers']['parent'] = 'ipv4slb';
8253d9f0 402$page['rservers']['handler'] = 'renderRealServerList';
b3c50e6c 403
4b0932b6 404$page['lbs']['title'] = 'Load balancers';
f973f491 405$page['lbs']['parent'] = 'ipv4slb';
4b0932b6 406$page['lbs']['handler'] = 'renderLBList';
b3c50e6c 407
eebf9145 408$page['search']['title_handler'] = 'dynamic_title_search';
3aeb15f3 409$page['search']['handler'] = 'renderSearchResults';
e673ee24
DO
410$page['search']['parent'] = 'index';
411$page['search']['bypass'] = 'q';
412
eebf9145 413$page['config']['title'] = 'Configuration';
3aeb15f3 414$page['config']['handler'] = 'renderConfigMainpage';
e673ee24
DO
415$page['config']['parent'] = 'index';
416
9133d2c5 417$page['userlist']['title'] = 'Local users';
82627005
DO
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';
135080d8
DO
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;
82627005
DO
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';
82627005 435$tab['user']['default'] = 'View';
82627005 436$tab['user']['tags'] = 'Tags';
e1ae3fb4 437$tab['user']['files'] = 'Files';
82627005 438$tabhandler['user']['default'] = 'renderUser';
482c7f35
DO
439$tabhandler['user']['tags'] = 'renderEntityTags';
440$tabhandler['user']['files'] = 'renderFilesForEntity';
3355ca56 441$ophandler['user']['tags']['saveTags'] = 'saveEntityTags';
e1ae3fb4 442$ophandler['user']['files']['addFile'] = 'addFileToEntity';
e1ae3fb4
AD
443$ophandler['user']['files']['linkFile'] = 'linkFileToEntity';
444$ophandler['user']['files']['unlinkFile'] = 'unlinkFile';
e673ee24 445
eebf9145 446$page['perms']['title'] = 'Permissions';
e673ee24
DO
447$page['perms']['parent'] = 'config';
448$tab['perms']['default'] = 'View';
82627005
DO
449$tab['perms']['edit'] = 'Edit';
450$tabhandler['perms']['default'] = 'renderRackCodeViewer';
451$tabhandler['perms']['edit'] = 'renderRackCodeEditor';
452$ophandler['perms']['edit']['saveRackCode'] = 'saveRackCode';
135080d8
DO
453$msgcode['saveRackCode']['OK'] = 43;
454$msgcode['saveRackCode']['ERR1'] = 154;
455$msgcode['saveRackCode']['ERR2'] = 155;
e673ee24 456
eebf9145 457$page['portmap']['title'] = 'Port compatibility map';
e673ee24
DO
458$page['portmap']['parent'] = 'config';
459$tab['portmap']['default'] = 'View';
460$tab['portmap']['edit'] = 'Change';
17c32f4c
DO
461$tabhandler['portmap']['default'] = 'renderPortMapViewer';
462$tabhandler['portmap']['edit'] = 'renderPortMapEditor';
e673ee24 463$ophandler['portmap']['edit']['save'] = 'savePortMap';
135080d8
DO
464$msgcode['savePortMap']['OK'] = 44;
465$msgcode['savePortMap']['ERR'] = 108;
e673ee24 466
eebf9145 467$page['attrs']['title'] = 'Attributes';
e673ee24
DO
468$page['attrs']['parent'] = 'config';
469$tab['attrs']['default'] = 'View';
470$tab['attrs']['editattrs'] = 'Edit attributes';
471$tab['attrs']['editmap'] = 'Edit map';
8b6ffe9c
DO
472$tabhandler['attrs']['default'] = 'renderAttributes';
473$tabhandler['attrs']['editattrs'] = 'renderEditAttributesForm';
474$tabhandler['attrs']['editmap'] = 'renderEditAttrMapForm';
e673ee24
DO
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';
135080d8
DO
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;
e673ee24 490
eebf9145 491$page['dict']['title'] = 'Dictionary';
e673ee24
DO
492$page['dict']['parent'] = 'config';
493$tab['dict']['default'] = 'View';
e673ee24 494$tab['dict']['chapters'] = 'Manage chapters';
8b6ffe9c 495$tabhandler['dict']['default'] = 'renderDictionary';
8b6ffe9c 496$tabhandler['dict']['chapters'] = 'renderChaptersEditor';
e673ee24
DO
497$ophandler['dict']['chapters']['del'] = 'delChapter';
498$ophandler['dict']['chapters']['upd'] = 'updateChapter';
499$ophandler['dict']['chapters']['add'] = 'addChapter';
135080d8
DO
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;
e673ee24 506
4034ab9e
DO
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
eebf9145 525$page['ui']['title'] = 'User interface';
e673ee24 526$page['ui']['parent'] = 'config';
0a1b1268 527$tab['ui']['default'] = 'View';
4fe32e78 528$tab['ui']['edit'] = 'Change';
b07f617c 529$tab['ui']['reset'] = 'Reset';
8b6ffe9c
DO
530$tabhandler['ui']['default'] = 'renderUIConfig';
531$tabhandler['ui']['edit'] = 'renderUIConfigEditForm';
532$tabhandler['ui']['reset'] = 'renderUIResetForm';
4fe32e78 533$ophandler['ui']['edit']['upd'] = 'updateUI';
b07f617c 534$ophandler['ui']['reset']['go'] = 'resetUIConfig';
135080d8
DO
535$msgcode['updateUI']['OK'] = 56;
536$msgcode['updateUI']['ERR'] = 125;
537$msgcode['resetUIConfig']['OK'] = 57;
e673ee24 538
931bf334
DO
539$page['tagtree']['title'] = 'Tag tree';
540$page['tagtree']['parent'] = 'config';
541$tab['tagtree']['default'] = 'View';
49fb1027 542$tab['tagtree']['edit'] = 'Edit';
931bf334
DO
543$tabhandler['tagtree']['default'] = 'renderTagTree';
544$tabhandler['tagtree']['edit'] = 'renderTagTreeEditor';
fe7044ad
DO
545$ophandler['tagtree']['edit']['destroyTag'] = 'destroyTag';
546$ophandler['tagtree']['edit']['createTag'] = 'createTag';
547$ophandler['tagtree']['edit']['updateTag'] = 'updateTag';
135080d8 548$msgcode['destroyTag']['OK'] = 58;
c615a655
DO
549$msgcode['destroyTag']['ERR1'] = 183;
550$msgcode['destroyTag']['ERR2'] = 144;
135080d8
DO
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;
931bf334 558
9457ca59
DO
559$page['myaccount']['title'] = 'My account';
560$page['myaccount']['parent'] = 'config';
561$tab['myaccount']['default'] = 'Info';
0ac7e4b3
DO
562$tab['myaccount']['mypassword'] = 'Password change';
563$tab['myaccount']['myrealname'] = '[Real name change]';
564$trigger['myaccount']['mypassword'] = 'trigger_passwdchange';
9457ca59
DO
565$tabhandler['myaccount']['default'] = 'renderMyAccount';
566$tabhandler['myaccount']['mypassword'] = 'renderMyPasswordEditor';
0ac7e4b3 567$tabhandler['myaccount']['myrealname'] = 'dragon';
9457ca59 568$ophandler['myaccount']['mypassword']['changeMyPassword'] = 'changeMyPassword';
135080d8
DO
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;
9457ca59 574
eebf9145 575$page['reports']['title'] = 'Reports';
e673ee24 576$page['reports']['parent'] = 'index';
e5c4506d 577$tab['reports']['default'] = 'System';
88d513cd 578$tab['reports']['rackcode'] = 'RackCode';
09620506 579$tab['reports']['ipv4'] = 'IPv4';
09f6104a 580$tab['reports']['local'] = getConfigVar ('enterprise');
e5c4506d
DO
581$trigger['reports']['local'] = 'trigger_localreports';
582$tabhandler['reports']['default'] = 'renderSystemReports';
88d513cd 583$tabhandler['reports']['rackcode'] = 'renderRackCodeReports';
09620506 584$tabhandler['reports']['ipv4'] = 'renderIPv4Reports';
e5c4506d 585$tabhandler['reports']['local'] = 'renderLocalReports';
e673ee24 586
e1ae3fb4
AD
587$page['files']['title'] = 'Files';
588$page['files']['parent'] = 'index';
8bc5d1e4
DO
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';
71118db6 595$ophandler['files']['manage']['deleteFile'] = 'deleteFile';
135080d8
DO
596$msgcode['addFileWithoutLink']['OK'] = 69;
597$msgcode['addFileWithoutLink']['ERR'] = 100;
71118db6
DO
598$msgcode['deleteFile']['OK'] = 73;
599$msgcode['deleteFile']['ERR'] = 100;
e1ae3fb4 600
cd35db83 601$page['file']['title_handler'] = 'dynamic_title_file';
e1ae3fb4
AD
602$page['file']['bypass'] = 'file_id';
603$page['file']['bypass_type'] = 'uint';
f4d879a9 604$page['file']['parent'] = 'files';
e1ae3fb4 605$tab['file']['default'] = 'View';
6ee41bd4 606$tab['file']['edit'] = 'Properties';
e1ae3fb4 607$tab['file']['tags'] = 'Tags';
8628ae44 608$tab['file']['editText'] = 'Edit text';
db55cf54 609$tab['file']['replaceData'] = 'Upload replacement';
e1ae3fb4 610$trigger['file']['tags'] = 'trigger_tags';
8628ae44 611$trigger['file']['editText'] = 'trigger_file_editText';
e1ae3fb4 612$tabhandler['file']['default'] = 'renderFile';
6ee41bd4
DO
613$tabhandler['file']['edit'] = 'renderFileProperties';
614$tabhandler['file']['tags'] = 'renderEntityTags';
8628ae44 615$tabhandler['file']['editText'] = 'renderTextEditor';
db55cf54 616$tabhandler['file']['replaceData'] = 'renderFileReuploader';
6ee41bd4 617$ophandler['file']['edit']['updateFile'] = 'updateFile';
e1ae3fb4 618$ophandler['file']['tags']['saveTags'] = 'saveEntityTags';
8628ae44 619$ophandler['file']['editText']['updateFileText'] = 'updateFileText';
db55cf54
DO
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;
8628ae44 625$msgcode['updateFileText']['OK'] = 78;
70cb9b56
DO
626$msgcode['updateFileText']['ERR1'] = 179;
627$msgcode['updateFileText']['ERR2'] = 180;
e1ae3fb4 628
e673ee24
DO
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.
632function 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
647function showPathAndSearch ($pageno)
648{
9c0b0016 649 global $root, $page;
e673ee24 650 // Path.
73635d32 651 echo "<td class=activemenuitem width='99%'>" . getConfigVar ('enterprise');
eebf9145
DO
652 $path = getPath ($pageno);
653 foreach ($path as $no)
e673ee24 654 {
eebf9145
DO
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]';
52c836b1 662 echo ": <a href='${root}?page=${no}&tab=default";
eebf9145
DO
663 foreach ($title['params'] as $param_name => $param_value)
664 echo "&${param_name}=${param_value}";
665 echo "'>" . $title['name'] . "</a>";
e673ee24
DO
666 }
667 echo "</td>";
668 // Search form.
669 echo "<td><table border=0 cellpadding=0 cellspacing=0><tr><td>Search:</td>";
e09e31d5 670 echo "<form name=search method=get action='${root}'><td>";
e673ee24
DO
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
676function getTitle ($pageno, $tabno)
677{
9c0b0016 678 global $page;
eebf9145
DO
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
9c0b0016 687 return getConfigVar ('enterprise');
e673ee24
DO
688}
689
690function showTabs ($pageno, $tabno)
691{
08b16bf5 692 global $tab, $root, $page, $remote_username, $trigger, $tabextraclass;
e673ee24
DO
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.
810e3422 699 if (!permitted ($pageno, $tabidx))
e673ee24 700 continue;
641fe9b0 701 // Dynamic tabs should only be shown in certain cases (trigger exists and returns true).
545eaaca
DO
702 if (isset ($trigger[$pageno][$tabidx]))
703 {
545eaaca 704 $ok = $trigger[$pageno][$tabidx] ();
545eaaca
DO
705 if (!$ok)
706 continue;
707 }
08b16bf5
DO
708 $class = ($tabidx == $tabno) ? 'current' : 'std';
709 $extra = (isset ($tabextraclass[$pageno][$tabidx])) ? $tabextraclass[$pageno][$tabidx] : '';
710 echo "<li><a class=${class}{$extra}";
e673ee24
DO
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.
725function 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
00f887f4 733 $cpage['parent'] == $pageno
e673ee24
DO
734 )
735 $children[$cpageno] = $cpage;
736 return $children;
737}
738
739function 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?>