r2090 + fixed find_object_ip_helper and some underlying code
[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';
23$tab['rackspace']['history'] = 'History';
9b0cf84f
DO
24$tab['rackspace']['firstrow'] = 'Click me!';
25$trigger['rackspace']['firstrow'] = 'trigger_emptyRackspace';
8b6ffe9c
DO
26$tabhandler['rackspace']['default'] = 'renderRackspace';
27$tabhandler['rackspace']['history'] = 'renderRackspaceHistory';
28$tabhandler['rackspace']['firstrow'] = 'renderFirstRowForm';
08b16bf5 29$tabextraclass['rackspace']['firstrow'] = 'attn';
e673ee24 30
eebf9145 31$page['objects']['title'] = 'Objects';
e673ee24
DO
32$page['objects']['parent'] = 'index';
33$tab['objects']['default'] = 'View';
216c84bb 34$tab['objects']['addmore'] = 'Add more';
7cc02fc1 35$tabhandler['objects']['default'] = 'renderObjectSpace';
216c84bb 36$tabhandler['objects']['addmore'] = 'renderAddMultipleObjectsForm';
e673ee24 37
eebf9145 38$page['row']['title_handler'] = 'dynamic_title_row';
e673ee24 39$page['row']['bypass'] = 'row_id';
8b6ffe9c 40$page['row']['bypass_type'] = 'uint';
e673ee24
DO
41$page['row']['parent'] = 'rackspace';
42$tab['row']['default'] = 'View';
43$tab['row']['newrack'] = 'Add new rack';
eb6ea26f 44$tab['row']['tagroller'] = 'Tag roller';
8b6ffe9c
DO
45$tabhandler['row']['default'] = 'renderRow';
46$tabhandler['row']['newrack'] = 'renderNewRackForm';
2f32cc32 47$tabhandler['row']['tagroller'] = 'renderTagRollerForRow';
eb6ea26f 48$ophandler['row']['tagroller']['rollTags'] = 'rollTags';
baf37d01 49$msgcode['row']['tagroller']['rollTags']['OK'] = 1;
ebb5441d 50$msgcode['row']['tagroller']['rollTags']['ERR'] = 149;
e673ee24 51
eebf9145 52$page['rack']['title_handler'] = 'dynamic_title_rack';
e673ee24 53$page['rack']['bypass'] = 'rack_id';
8b6ffe9c 54$page['rack']['bypass_type'] = 'uint';
e673ee24 55$page['rack']['parent'] = 'row';
41bd8c87
DO
56$page['rack']['tagloader'] = 'loadRackTags';
57$page['rack']['autotagloader'] = 'loadRackAutoTags';
e673ee24
DO
58$tab['rack']['default'] = 'View';
59$tab['rack']['edit'] = 'Properties';
60$tab['rack']['design'] = 'Design';
61$tab['rack']['problems'] = 'Problems';
41bd8c87 62$tab['rack']['tags'] = 'Tags';
8b6ffe9c
DO
63$tabhandler['rack']['default'] = 'renderRackPage';
64$tabhandler['rack']['edit'] = 'renderEditRackForm';
65$tabhandler['rack']['design'] = 'renderRackDesign';
66$tabhandler['rack']['problems'] = 'renderRackProblems';
41bd8c87
DO
67$tabhandler['rack']['tags'] = 'renderRackTags';
68$trigger['rack']['tags'] = 'trigger_tags';
82627005 69$ophandler['rack']['tags']['saveTags'] = 'saveRackTags';
ebb5441d 70$msgcode['rack']['tags']['saveTags'] = $msgcode['object']['tags']['saveTags'];
e673ee24 71
eebf9145 72$page['objgroup']['title_handler'] = 'dynamic_title_objgroup';
3aeb15f3 73$page['objgroup']['handler'] = 'renderObjectGroup';
e673ee24 74$page['objgroup']['bypass'] = 'group_id';
105cea6e 75$page['objgroup']['bypass_type'] = 'uint0';
e673ee24
DO
76$page['objgroup']['parent'] = 'objects';
77
eebf9145 78$page['object']['title_handler'] = 'dynamic_title_object';
e673ee24 79$page['object']['bypass'] = 'object_id';
3bebaebd 80$page['object']['bypass_type'] = 'uint';
e673ee24 81$page['object']['parent'] = 'objgroup';
2fb24351
DO
82$page['object']['tagloader'] = 'loadRackObjectTags';
83$page['object']['autotagloader'] = 'loadRackObjectAutoTags';
e673ee24
DO
84$tab['object']['default'] = 'View';
85$tab['object']['edit'] = 'Properties';
86$tab['object']['rackspace'] = 'Rackspace';
87$tab['object']['ports'] = 'Ports';
72d8ced3
DO
88$tab['object']['ipv4'] = 'IPv4';
89$tab['object']['nat4'] = 'NATv4';
46f92ff7 90$tab['object']['livevlans'] = 'Live VLANs';
9c67f713 91$tab['object']['snmpportfinder'] = 'SNMP port finder';
0dfaea8e 92$tab['object']['editrspvs'] = 'RS pools';
3ee1252b 93$tab['object']['lvsconfig'] = 'LVS configuration';
118e4c38 94$tab['object']['autoports'] = 'AutoPorts';
2fb24351 95$tab['object']['tags'] = 'Tags';
e45a78d7
DO
96$tabhandler['object']['default'] = 'renderRackObject';
97$tabhandler['object']['edit'] = 'renderEditObjectForm';
98$tabhandler['object']['rackspace'] = 'renderRackSpaceForObject';
99$tabhandler['object']['ports'] = 'renderPortsForObject';
72d8ced3
DO
100$tabhandler['object']['ipv4'] = 'renderIPv4ForObject';
101$tabhandler['object']['nat4'] = 'renderNATv4ForObject';
46f92ff7 102$tabhandler['object']['livevlans'] = 'renderVLANMembership';
e45a78d7 103$tabhandler['object']['snmpportfinder'] = 'renderSNMPPortFinder';
3ee1252b 104$tabhandler['object']['lvsconfig'] = 'renderLVSConfig';
118e4c38 105$tabhandler['object']['autoports'] = 'renderAutoPortsForm';
2fb24351 106$tabhandler['object']['tags'] = 'renderObjectTags';
0dfaea8e 107$tabhandler['object']['editrspvs'] = 'renderObjectSLB';
08b16bf5
DO
108$tabextraclass['object']['snmpportfinder'] = 'attn';
109$tabextraclass['object']['autoports'] = 'attn';
72d8ced3
DO
110$trigger['object']['ipv4'] = 'trigger_ipv4';
111$trigger['object']['nat4'] = 'trigger_natv4';
46f92ff7 112$trigger['object']['livevlans'] = 'trigger_livevlans';
9c67f713 113$trigger['object']['snmpportfinder'] = 'trigger_snmpportfinder';
0dfaea8e 114$trigger['object']['editrspvs'] = 'trigger_natv4';
094bb33c 115$trigger['object']['lvsconfig'] = 'trigger_lvsconfig';
118e4c38 116$trigger['object']['autoports'] = 'trigger_autoports';
91dbb8a3 117$trigger['object']['tags'] = 'trigger_tags';
e673ee24
DO
118$ophandler['object']['ports']['addPort'] = 'addPortForObject';
119$ophandler['object']['ports']['delPort'] = 'delPortFromObject';
120$ophandler['object']['ports']['editPort'] = 'editPortForObject';
121$ophandler['object']['ports']['linkPort'] = 'linkPortForObject';
122$ophandler['object']['ports']['unlinkPort'] = 'unlinkPortForObject';
123$ophandler['object']['ports']['addMultiPorts'] = 'addMultiPorts';
124$ophandler['object']['ports']['useup'] = 'useupPort';
72d8ced3
DO
125$ophandler['object']['ipv4']['updIPv4Allocation'] = 'updIPv4Allocation';
126$ophandler['object']['ipv4']['addIPv4Allocation'] = 'addIPv4Allocation';
127$ophandler['object']['ipv4']['delIPv4Allocation'] = 'delIPv4Allocation';
22bb04da
DO
128$ophandler['object']['edit']['clearSticker'] = 'clearSticker';
129$ophandler['object']['edit']['updateStickers'] = 'updateStickers';
130$ophandler['object']['edit']['update'] = 'updateObject';
72d8ced3
DO
131$ophandler['object']['nat4']['addNATv4Rule'] = 'addPortForwarding';
132$ophandler['object']['nat4']['delNATv4Rule'] = 'delPortForwarding';
133$ophandler['object']['nat4']['updNATv4Rule'] = 'updPortForwarding';
46f92ff7 134$ophandler['object']['livevlans']['setPortVLAN'] = 'setPortVLAN';
f3f0161f 135$ophandler['object']['autoports']['generate'] = 'generateAutoPorts';
82627005 136$ophandler['object']['tags']['saveTags'] = 'saveObjectTags';
0dfaea8e
DO
137$ophandler['object']['editrspvs']['addLB'] = 'addLoadBalancer';
138$ophandler['object']['editrspvs']['delLB'] = 'deleteLoadBalancer';
139$ophandler['object']['editrspvs']['updLB'] = 'updateLoadBalancer';
2987fc1f 140$ophandler['object']['lvsconfig']['submitSLBConfig'] = 'submitSLBConfig';
46f92ff7 141$delayauth['object']['livevlans']['setPortVLAN'] = TRUE;
baf37d01 142$msgcode['object']['nat4']['addNATv4Rule']['OK'] = 2;
ebb5441d 143$msgcode['object']['nat4']['addNATv4Rule']['ERR'] = 100;
baf37d01 144$msgcode['object']['nat4']['delNATv4Rule']['OK'] = 3;
ebb5441d 145$msgcode['object']['nat4']['delNATv4Rule']['ERR'] = 100;
baf37d01 146$msgcode['object']['nat4']['updNATv4Rule']['OK'] = 4;
ebb5441d 147$msgcode['object']['nat4']['updNATv4Rule']['ERR'] = 100;
baf37d01 148$msgcode['object']['ports']['addPort']['OK'] = 5;
ebb5441d
DO
149$msgcode['object']['ports']['addPort']['ERR1'] = 101;
150$msgcode['object']['ports']['addPort']['ERR2'] = 100;
baf37d01 151$msgcode['object']['ports']['editPort']['OK'] = 6;
ebb5441d
DO
152$msgcode['object']['ports']['editPort']['ERR1'] = 101;
153$msgcode['object']['ports']['editPort']['ERR2'] = 100;
baf37d01 154$msgcode['object']['ports']['delPort']['OK'] = 7;
ebb5441d 155$msgcode['object']['ports']['delPort']['ERR'] = 100;
baf37d01 156$msgcode['object']['ports']['linkPort']['OK'] = 8;
ebb5441d 157$msgcode['object']['ports']['linkPort']['ERR'] = 100;
baf37d01 158$msgcode['object']['ports']['unlinkPort']['OK'] = 9;
ebb5441d 159$msgcode['object']['ports']['unlinkPort']['ERR'] = 100;
baf37d01 160$msgcode['object']['ports']['addMultiPorts']['OK'] = 10;
ebb5441d 161$msgcode['object']['ports']['addMultiPorts']['ERR'] = 123;
baf37d01 162$msgcode['object']['ports']['useup']['OK'] = 11;
ebb5441d 163$msgcode['object']['ports']['useup']['ERR'] = 124;
baf37d01 164$msgcode['object']['ipv4']['updIPv4Allocation']['OK'] = 12;
ebb5441d 165$msgcode['object']['ipv4']['updIPv4Allocation']['ERR'] = 100;
baf37d01 166$msgcode['object']['ipv4']['addIPv4Allocation']['OK'] = 13;
ebb5441d 167$msgcode['object']['ipv4']['addIPv4Allocation']['ERR'] = 100;
baf37d01 168$msgcode['object']['ipv4']['delIPv4Allocation']['OK'] = 14;
ebb5441d 169$msgcode['object']['ipv4']['delIPv4Allocation']['ERR'] = 100;
baf37d01 170$msgcode['object']['edit']['clearSticker']['OK'] = 15;
ebb5441d 171$msgcode['object']['edit']['clearSticker']['ERR'] = 120;
baf37d01 172$msgcode['object']['edit']['update']['OK'] = 16;
ebb5441d 173$msgcode['object']['edit']['update']['ERR'] = 121;
baf37d01 174$msgcode['object']['edit']['updateStickers']['OK'] = 17;
ebb5441d 175$msgcode['object']['edit']['updateStickers']['ERR'] = 122;
baf37d01 176$msgcode['object']['editrspvs']['addLB']['OK'] = 18;
ebb5441d 177$msgcode['object']['editrspvs']['addLB']['ERR'] = 137;
baf37d01 178$msgcode['object']['editrspvs']['delLB']['OK'] = 19;
ebb5441d 179$msgcode['object']['editrspvs']['delLB']['ERR'] = 129;
baf37d01 180$msgcode['object']['editrspvs']['updLB']['OK'] = 20;
ebb5441d 181$msgcode['object']['editrspvs']['updLB']['ERR'] = 134;
baf37d01 182$msgcode['object']['autoports']['generate']['OK'] = 21;
ebb5441d 183$msgcode['object']['autoports']['generate']['ERR'] = 142;
baf37d01 184$msgcode['object']['tags']['saveTags']['OK'] = 22;
ebb5441d
DO
185$msgcode['object']['tags']['saveTags']['ERR'] = 143;
186$msgcode['object']['livevlans']['setPortVLAN']['ERR1'] = 156;
e673ee24 187
eebf9145 188$page['ipv4space']['title'] = 'IPv4 space';
e673ee24
DO
189$page['ipv4space']['parent'] = 'index';
190$tab['ipv4space']['default'] = 'Browse';
0bcdc163 191$tab['ipv4space']['newrange'] = 'Manage';
8b6ffe9c
DO
192$tabhandler['ipv4space']['default'] = 'renderAddressspace';
193$tabhandler['ipv4space']['newrange'] = 'renderAddNewRange';
42023f03
DO
194$ophandler['ipv4space']['newrange']['addIPv4Prefix'] = 'addIPv4Prefix';
195$ophandler['ipv4space']['newrange']['delIPv4Prefix'] = 'delIPv4Prefix';
baf37d01 196$msgcode['ipv4space']['newrange']['addIPv4Prefix']['OK'] = 23;
ebb5441d 197$msgcode['ipv4space']['newrange']['addIPv4Prefix']['ERR'] = 100;
baf37d01 198$msgcode['ipv4space']['newrange']['delIPv4Prefix']['OK'] = 24;
ebb5441d 199$msgcode['ipv4space']['newrange']['delIPv4Prefix']['ERR'] = 100;
e673ee24 200
eebf9145 201$page['iprange']['title_handler'] = 'dynamic_title_iprange';
e673ee24
DO
202$page['iprange']['parent'] = 'ipv4space';
203$page['iprange']['bypass'] = 'id';
2fe5476a 204$page['iprange']['bypass_type'] = 'uint';
f9bc186f
DO
205$page['iprange']['autotagloader'] = 'loadIPv4PrefixAutoTags';
206$page['iprange']['tagloader'] = 'loadIPv4PrefixTags';
e673ee24
DO
207$tab['iprange']['default'] = 'Browse';
208$tab['iprange']['properties'] = 'Properties';
2fe5476a 209$tab['iprange']['liveptr'] = 'Live PTR';
2034d968 210$tab['iprange']['tags'] = 'Tags';
8b6ffe9c
DO
211$tabhandler['iprange']['default'] = 'renderIPRange';
212$tabhandler['iprange']['properties'] = 'renderIPRangeProperties';
2fe5476a 213$tabhandler['iprange']['liveptr'] = 'renderLivePTR';
2034d968
DO
214$tabhandler['iprange']['tags'] = 'renderIPv4PrefixTags';
215$trigger['iprange']['tags'] = 'trigger_tags';
e673ee24 216$ophandler['iprange']['properties']['editRange'] = 'editRange';
da958e52 217$ophandler['iprange']['liveptr']['importPTRData'] = 'importPTRData';
82627005 218$ophandler['iprange']['tags']['saveTags'] = 'saveIPv4PrefixTags';
baf37d01 219$msgcode['iprange']['properties']['editRange']['OK'] = 25;
ebb5441d 220$msgcode['iprange']['properties']['editRange']['ERR'] = 100;
baf37d01 221$msgcode['iprange']['liveptr']['importPTRData']['OK'] = 26;
ebb5441d
DO
222$msgcode['iprange']['liveptr']['importPTRData']['ERR'] = 141;
223$msgcode['iprange']['tags']['saveTags'] = $msgcode['object']['tags']['saveTags'];
e673ee24 224
eebf9145 225$page['ipaddress']['title_handler'] = 'dynamic_title_ipaddress';
e673ee24
DO
226$page['ipaddress']['parent'] = 'iprange';
227$page['ipaddress']['bypass'] = 'ip';
1fbc9fd6 228$page['ipaddress']['bypass_type'] = 'inet4';
d817ba03 229$page['ipaddress']['autotagloader'] = 'loadIPv4AddressAutoTags';
e673ee24
DO
230$tab['ipaddress']['default'] = 'Browse';
231$tab['ipaddress']['properties'] = 'Properties';
232$tab['ipaddress']['assignment'] = 'Allocation';
7e13adfe 233$tab['ipaddress']['editrslist'] = '[SLB real servers]';
8b6ffe9c
DO
234$tabhandler['ipaddress']['default'] = 'renderIPAddress';
235$tabhandler['ipaddress']['properties'] = 'renderIPAddressProperties';
236$tabhandler['ipaddress']['assignment'] = 'renderIPAddressAssignment';
1fbc9fd6 237$tabhandler['ipaddress']['editrslist'] = 'dragon';
e673ee24 238$ophandler['ipaddress']['properties']['editAddress'] = 'editAddress';
b4c1ef87
DO
239$ophandler['ipaddress']['assignment']['delIPv4Allocation'] = 'delIPv4Allocation';
240$ophandler['ipaddress']['assignment']['updIPv4Allocation'] = 'updIPv4Allocation';
241$ophandler['ipaddress']['assignment']['addIPv4Allocation'] = 'addIPv4Allocation';
baf37d01 242$msgcode['ipaddress']['properties']['editAddress']['OK'] = 27;
ebb5441d 243$msgcode['ipaddress']['properties']['editAddress']['ERR'] = 100;
e673ee24 244
f973f491
DO
245$page['ipv4slb']['title'] = 'IPv4 SLB';
246$page['ipv4slb']['parent'] = 'index';
247$page['ipv4slb']['handler'] = 'renderIPv4SLB';
248
a239e016
DO
249$page['ipv4vslist']['title'] = 'Virtual services';
250$page['ipv4vslist']['parent'] = 'ipv4slb';
251$tab['ipv4vslist']['default'] = 'View';
252$tab['ipv4vslist']['edit'] = 'Edit';
253$tabhandler['ipv4vslist']['default'] = 'renderVSList';
254$tabhandler['ipv4vslist']['edit'] = 'renderVSListEditForm';
255$ophandler['ipv4vslist']['edit']['add'] = 'addVService';
256$ophandler['ipv4vslist']['edit']['del'] = 'deleteVService';
257$ophandler['ipv4vslist']['edit']['upd'] = 'updateVService';
baf37d01 258$msgcode['ipv4vslist']['edit']['add']['OK'] = 28;
ebb5441d
DO
259$msgcode['ipv4vslist']['edit']['add']['ERR1'] = 132;
260$msgcode['ipv4vslist']['edit']['add']['ERR2'] = 100;
baf37d01 261$msgcode['ipv4vslist']['edit']['del']['OK'] = 29;
ebb5441d 262$msgcode['ipv4vslist']['edit']['del']['ERR'] = 130;
baf37d01 263$msgcode['ipv4vslist']['edit']['upd']['OK'] = 30;
ebb5441d 264$msgcode['ipv4vslist']['edit']['upd']['ERR'] = 135;
b3c50e6c 265
2bb798a3
DO
266$page['ipv4vs']['title_handler'] = 'dynamic_title_vservice';
267$page['ipv4vs']['parent'] = 'ipv4vslist';
49fb2686 268$page['ipv4vs']['bypass'] = 'vs_id';
2bb798a3
DO
269$page['ipv4vs']['bypass_type'] = 'uint';
270$page['ipv4vs']['tagloader'] = 'loadIPv4VSTags';
271$page['ipv4vs']['autotagloader'] = 'loadIPv4VSAutoTags';
272$tab['ipv4vs']['default'] = 'View';
c9890988 273$tab['ipv4vs']['edit'] = 'Edit';
49fb2686 274$tab['ipv4vs']['editlblist'] = 'Load balancers';
2bb798a3
DO
275$tab['ipv4vs']['tags'] = 'Tags';
276$tabhandler['ipv4vs']['default'] = 'renderVirtualService';
277$tabhandler['ipv4vs']['edit'] = 'renderEditVService';
49fb2686 278$tabhandler['ipv4vs']['editlblist'] = 'renderVServiceLBForm';
2bb798a3 279$tabhandler['ipv4vs']['tags'] = 'renderIPv4VSTags';
e02e1941 280$ophandler['ipv4vs']['edit']['updIPv4VS'] = 'updateVService';
2bb798a3 281$ophandler['ipv4vs']['tags']['saveTags'] = 'saveIPv4VSTags';
49fb2686
DO
282$ophandler['ipv4vs']['editlblist']['addLB'] = 'addLoadBalancer';
283$ophandler['ipv4vs']['editlblist']['delLB'] = 'deleteLoadBalancer';
284$ophandler['ipv4vs']['editlblist']['updLB'] = 'updateLoadBalancer';
2bb798a3 285$trigger['ipv4vs']['tags'] = 'trigger_tags';
baf37d01 286$msgcode['ipv4vs']['editlblist'] = $msgcode['object']['editrspvs'];
ebb5441d 287$msgcode['ipv4vs']['tags']['saveTags'] = $msgcode['object']['tags']['saveTags'];
c9b4588f 288
ee437dab
DO
289$page['ipv4rsplist']['title'] = 'RS pools';
290$page['ipv4rsplist']['parent'] = 'ipv4slb';
291$tab['ipv4rsplist']['default'] = 'View';
292$tab['ipv4rsplist']['edit'] = 'Edit';
293$tabhandler['ipv4rsplist']['default'] = 'renderRSPoolList';
294$tabhandler['ipv4rsplist']['edit'] = 'editRSPools';
295$ophandler['ipv4rsplist']['edit']['add'] = 'addRSPool';
296$ophandler['ipv4rsplist']['edit']['del'] = 'deleteRSPool';
297$ophandler['ipv4rsplist']['edit']['upd'] = 'updateRSPool';
baf37d01 298$msgcode['ipv4rsplist']['edit']['add']['OK'] = 31;
ebb5441d 299$msgcode['ipv4rsplist']['edit']['add']['ERR'] = 100;
baf37d01 300$msgcode['ipv4rsplist']['edit']['del']['OK'] = 32;
ebb5441d 301$msgcode['ipv4rsplist']['edit']['del']['ERR'] = 138;
baf37d01 302$msgcode['ipv4rsplist']['edit']['upd']['OK'] = 33;
ebb5441d 303$msgcode['ipv4rsplist']['edit']['upd']['ERR'] = 139;
b3c50e6c 304
0e692350
DO
305$page['ipv4rsp']['title_handler'] = 'dynamic_title_rspool';
306$page['ipv4rsp']['parent'] = 'ipv4rsplist';
307$page['ipv4rsp']['bypass'] = 'pool_id';
308$page['ipv4rsp']['bypass_type'] = 'uint';
309$page['ipv4rsp']['tagloader'] = 'loadIPv4RSPoolTags';
310$page['ipv4rsp']['autotagloader'] = 'loadIPv4RSPoolAutoTags';
311$tab['ipv4rsp']['default'] = 'View';
ea5a3250 312$tab['ipv4rsp']['edit'] = 'Edit';
0e692350
DO
313$tab['ipv4rsp']['editlblist'] = 'Load Balancers';
314$tab['ipv4rsp']['editrslist'] = 'RS list';
315$tab['ipv4rsp']['rsinservice'] = 'RS in service';
316$tab['ipv4rsp']['tags'] = 'Tags';
317$trigger['ipv4rsp']['rsinservice'] = 'trigger_poolrscount';
318$trigger['ipv4rsp']['tags'] = 'trigger_tags';
319$tabhandler['ipv4rsp']['default'] = 'renderRSPool';
320$tabhandler['ipv4rsp']['edit'] = 'renderEditRSPool';
321$tabhandler['ipv4rsp']['editrslist'] = 'renderRSPoolServerForm';
322$tabhandler['ipv4rsp']['editlblist'] = 'renderRSPoolLBForm';
323$tabhandler['ipv4rsp']['rsinservice'] = 'renderRSPoolRSInServiceForm';
324$tabhandler['ipv4rsp']['tags'] = 'renderIPv4RSPoolTags';
325$ophandler['ipv4rsp']['editrslist']['addRS'] = 'addRealServer';
326$ophandler['ipv4rsp']['editrslist']['delRS'] = 'deleteRealServer';
327$ophandler['ipv4rsp']['editrslist']['updRS'] = 'updateRealServer';
328$ophandler['ipv4rsp']['editrslist']['addMany'] = 'addRealServers';
329$ophandler['ipv4rsp']['editlblist']['addLB'] = 'addLoadBalancer';
330$ophandler['ipv4rsp']['editlblist']['delLB'] = 'deleteLoadBalancer';
331$ophandler['ipv4rsp']['editlblist']['updLB'] = 'updateLoadBalancer';
332$ophandler['ipv4rsp']['rsinservice']['upd'] = 'updateRSInService';
333$ophandler['ipv4rsp']['tags']['saveTags'] = 'saveIPv4RSPoolTags';
ea5a3250 334$ophandler['ipv4rsp']['edit']['updIPv4RSP'] = 'updateRSPool';
baf37d01 335$msgcode['ipv4rsp']['editrslist']['addRS']['OK'] = 34;
ebb5441d 336$msgcode['ipv4rsp']['editrslist']['addRS']['ERR'] = 126;
baf37d01 337$msgcode['ipv4rsp']['editrslist']['delRS']['OK'] = 35;
ebb5441d 338$msgcode['ipv4rsp']['editrslist']['delRS']['ERR'] = 128;
baf37d01 339$msgcode['ipv4rsp']['editrslist']['updRS']['OK'] = 36;
ebb5441d 340$msgcode['ipv4rsp']['editrslist']['updRS']['ERR'] = 133;
baf37d01 341$msgcode['ipv4rsp']['editrslist']['addMany']['OK'] = 37;
ebb5441d
DO
342$msgcode['ipv4rsp']['editrslist']['addMany']['ERR1'] = 131;
343$msgcode['ipv4rsp']['editrslist']['addMany']['ERR2'] = 127;
baf37d01 344$msgcode['ipv4rsp']['editlblist'] = $msgcode['object']['editrspvs'];
ebb5441d 345$msgcode['ipv4rsp']['edit']['updIPv4RSP'] = $msgcode['ipv4rsplist']['edit']['upd'];
baf37d01 346$msgcode['ipv4rsp']['rsinservice']['upd']['OK'] = 38;
ebb5441d
DO
347$msgcode['ipv4rsp']['rsinservice']['upd']['ERR'] = 140;
348$msgcode['ipv4rsp']['tags']['saveTags'] = $msgcode['object']['tags']['saveTags'];
71b8bda1 349
8253d9f0 350$page['rservers']['title'] = 'Real servers';
f973f491 351$page['rservers']['parent'] = 'ipv4slb';
8253d9f0 352$page['rservers']['handler'] = 'renderRealServerList';
b3c50e6c 353
4b0932b6 354$page['lbs']['title'] = 'Load balancers';
f973f491 355$page['lbs']['parent'] = 'ipv4slb';
4b0932b6 356$page['lbs']['handler'] = 'renderLBList';
b3c50e6c 357
eebf9145 358$page['search']['title_handler'] = 'dynamic_title_search';
3aeb15f3 359$page['search']['handler'] = 'renderSearchResults';
e673ee24
DO
360$page['search']['parent'] = 'index';
361$page['search']['bypass'] = 'q';
362
eebf9145 363$page['config']['title'] = 'Configuration';
3aeb15f3 364$page['config']['handler'] = 'renderConfigMainpage';
e673ee24
DO
365$page['config']['parent'] = 'index';
366
82627005
DO
367$page['userlist']['title'] = 'Users';
368$page['userlist']['parent'] = 'config';
369$tab['userlist']['default'] = 'View';
370$tab['userlist']['edit'] = 'Edit';
371$tabhandler['userlist']['default'] = 'renderUserList';
372$tabhandler['userlist']['edit'] = 'renderUserListEditor';
373$ophandler['userlist']['edit']['updateUser'] = 'updateUser';
374$ophandler['userlist']['edit']['createUser'] = 'createUser';
375$ophandler['userlist']['edit']['disableUser'] = 'disableUser';
376$ophandler['userlist']['edit']['enableUser'] = 'enableUser';
baf37d01 377$msgcode['userlist']['edit']['updateUser']['OK'] = 39;
ebb5441d
DO
378$msgcode['userlist']['edit']['updateUser']['ERR1'] = 103;
379$msgcode['userlist']['edit']['updateUser']['ERR1'] = 104;
baf37d01 380$msgcode['userlist']['edit']['createUser']['OK'] = 40;
ebb5441d 381$msgcode['userlist']['edit']['createUser']['ERR'] = 102;
baf37d01 382$msgcode['userlist']['edit']['disableUser']['OK'] = 41;
ebb5441d
DO
383$msgcode['userlist']['edit']['disableUser']['ERR1'] = 107;
384$msgcode['userlist']['edit']['disableUser']['ERR2'] = 106;
baf37d01 385$msgcode['userlist']['edit']['enableUser']['OK'] = 42;
ebb5441d 386$msgcode['userlist']['edit']['enableUser']['ERR'] = 105;
82627005
DO
387
388$page['user']['title_handler'] = 'dynamic_title_user';
389$page['user']['parent'] = 'userlist';
390$page['user']['bypass'] = 'user_id';
391$page['user']['bypass_type'] = 'uint';
392$page['user']['tagloader'] = 'loadUserTags';
da958e52 393$page['user']['autotagloader'] = 'getUserAutoTags';
82627005 394$tab['user']['default'] = 'View';
82627005
DO
395$tab['user']['tags'] = 'Tags';
396$tabhandler['user']['default'] = 'renderUser';
82627005
DO
397$tabhandler['user']['tags'] = 'renderUserTags';
398$ophandler['user']['tags']['saveTags'] = 'saveUserTags';
ebb5441d 399$msgcode['user']['tags']['saveTags'] = $msgcode['object']['tags']['saveTags'];
e673ee24 400
eebf9145 401$page['perms']['title'] = 'Permissions';
e673ee24
DO
402$page['perms']['parent'] = 'config';
403$tab['perms']['default'] = 'View';
82627005
DO
404$tab['perms']['edit'] = 'Edit';
405$tabhandler['perms']['default'] = 'renderRackCodeViewer';
406$tabhandler['perms']['edit'] = 'renderRackCodeEditor';
407$ophandler['perms']['edit']['saveRackCode'] = 'saveRackCode';
baf37d01 408$msgcode['perms']['edit']['saveRackCode']['OK'] = 43;
ebb5441d
DO
409$msgcode['perms']['edit']['saveRackCode']['ERR1'] = 154;
410$msgcode['perms']['edit']['saveRackCode']['ERR2'] = 155;
e673ee24 411
eebf9145 412$page['portmap']['title'] = 'Port compatibility map';
e673ee24
DO
413$page['portmap']['parent'] = 'config';
414$tab['portmap']['default'] = 'View';
415$tab['portmap']['edit'] = 'Change';
17c32f4c
DO
416$tabhandler['portmap']['default'] = 'renderPortMapViewer';
417$tabhandler['portmap']['edit'] = 'renderPortMapEditor';
e673ee24 418$ophandler['portmap']['edit']['save'] = 'savePortMap';
baf37d01 419$msgcode['portmap']['edit']['save']['OK'] = 44;
ebb5441d 420$msgcode['portmap']['edit']['save']['ERR'] = 108;
e673ee24 421
eebf9145 422$page['attrs']['title'] = 'Attributes';
e673ee24
DO
423$page['attrs']['parent'] = 'config';
424$tab['attrs']['default'] = 'View';
425$tab['attrs']['editattrs'] = 'Edit attributes';
426$tab['attrs']['editmap'] = 'Edit map';
8b6ffe9c
DO
427$tabhandler['attrs']['default'] = 'renderAttributes';
428$tabhandler['attrs']['editattrs'] = 'renderEditAttributesForm';
429$tabhandler['attrs']['editmap'] = 'renderEditAttrMapForm';
e673ee24
DO
430$ophandler['attrs']['editattrs']['add'] = 'createAttribute';
431$ophandler['attrs']['editattrs']['upd'] = 'changeAttribute';
432$ophandler['attrs']['editattrs']['del'] = 'deleteAttribute';
433$ophandler['attrs']['editmap']['add'] = 'supplementAttrMap';
434$ophandler['attrs']['editmap']['del'] = 'reduceAttrMap';
baf37d01 435$msgcode['attrs']['editattrs']['add']['OK'] = 45;
ebb5441d 436$msgcode['attrs']['editattrs']['add']['ERR'] = 116;
baf37d01 437$msgcode['attrs']['editattrs']['upd']['OK'] = 46;
ebb5441d 438$msgcode['attrs']['editattrs']['upd']['ERR'] = 115;
baf37d01 439$msgcode['attrs']['editattrs']['del']['OK'] = 47;
ebb5441d 440$msgcode['attrs']['editattrs']['del']['ERR'] = 117;
baf37d01 441$msgcode['attrs']['editmap']['add']['OK'] = 48;
ebb5441d 442$msgcode['attrs']['editmap']['add']['ERR'] = 118;
baf37d01 443$msgcode['attrs']['editmap']['del']['OK'] = 49;
ebb5441d 444$msgcode['attrs']['editmap']['del']['ERR'] = 119;
e673ee24 445
eebf9145 446$page['dict']['title'] = 'Dictionary';
e673ee24
DO
447$page['dict']['parent'] = 'config';
448$tab['dict']['default'] = 'View';
449$tab['dict']['edit'] = 'Edit words';
450$tab['dict']['chapters'] = 'Manage chapters';
8b6ffe9c
DO
451$tabhandler['dict']['default'] = 'renderDictionary';
452$tabhandler['dict']['edit'] = 'renderDictionaryEditor';
453$tabhandler['dict']['chapters'] = 'renderChaptersEditor';
e673ee24
DO
454$ophandler['dict']['edit']['del'] = 'reduceDictionary';
455$ophandler['dict']['edit']['upd'] = 'updateDictionary';
456$ophandler['dict']['edit']['add'] = 'supplementDictionary';
457$ophandler['dict']['chapters']['del'] = 'delChapter';
458$ophandler['dict']['chapters']['upd'] = 'updateChapter';
459$ophandler['dict']['chapters']['add'] = 'addChapter';
baf37d01 460$msgcode['dict']['edit']['del']['OK'] = 50;
ebb5441d 461$msgcode['dict']['edit']['del']['ERR'] = 111;
baf37d01 462$msgcode['dict']['edit']['upd']['OK'] = 51;
ebb5441d 463$msgcode['dict']['edit']['upd']['ERR'] = 109;
baf37d01 464$msgcode['dict']['edit']['add']['OK'] = 52;
ebb5441d 465$msgcode['dict']['edit']['add']['ERR'] = 110;
baf37d01 466$msgcode['dict']['chapters']['del']['OK'] = 53;
ebb5441d 467$msgcode['dict']['chapters']['del']['ERR'] = 114;
baf37d01 468$msgcode['dict']['chapters']['upd']['OK'] = 54;
ebb5441d 469$msgcode['dict']['chapters']['upd']['ERR'] = 113;
baf37d01 470$msgcode['dict']['chapters']['add']['OK'] = 55;
ebb5441d 471$msgcode['dict']['chapters']['add']['ERR'] = 112;
e673ee24 472
eebf9145 473$page['ui']['title'] = 'User interface';
e673ee24 474$page['ui']['parent'] = 'config';
0a1b1268 475$tab['ui']['default'] = 'View';
4fe32e78 476$tab['ui']['edit'] = 'Change';
b07f617c 477$tab['ui']['reset'] = 'Reset';
8b6ffe9c
DO
478$tabhandler['ui']['default'] = 'renderUIConfig';
479$tabhandler['ui']['edit'] = 'renderUIConfigEditForm';
480$tabhandler['ui']['reset'] = 'renderUIResetForm';
4fe32e78 481$ophandler['ui']['edit']['upd'] = 'updateUI';
b07f617c 482$ophandler['ui']['reset']['go'] = 'resetUIConfig';
baf37d01 483$msgcode['ui']['edit']['upd']['OK'] = 56;
ebb5441d 484$msgcode['ui']['edit']['upd']['ERR'] = 125;
baf37d01 485$msgcode['ui']['reset']['go']['OK'] = 57;
e673ee24 486
931bf334
DO
487$page['tagtree']['title'] = 'Tag tree';
488$page['tagtree']['parent'] = 'config';
489$tab['tagtree']['default'] = 'View';
49fb1027 490$tab['tagtree']['edit'] = 'Edit';
931bf334
DO
491$tabhandler['tagtree']['default'] = 'renderTagTree';
492$tabhandler['tagtree']['edit'] = 'renderTagTreeEditor';
fe7044ad
DO
493$ophandler['tagtree']['edit']['destroyTag'] = 'destroyTag';
494$ophandler['tagtree']['edit']['createTag'] = 'createTag';
495$ophandler['tagtree']['edit']['updateTag'] = 'updateTag';
baf37d01 496$msgcode['tagtree']['edit']['destroyTag']['OK'] = 58;
ebb5441d 497$msgcode['tagtree']['edit']['destroyTag']['ERR'] = 144;
baf37d01 498$msgcode['tagtree']['edit']['createTag']['OK'] = 59;
ebb5441d
DO
499$msgcode['tagtree']['edit']['createTag']['ERR1'] = 145;
500$msgcode['tagtree']['edit']['createTag']['ERR2'] = 146;
501$msgcode['tagtree']['edit']['createTag']['ERR3'] = 147;
baf37d01 502$msgcode['tagtree']['edit']['updateTag']['OK'] = 60;
ebb5441d
DO
503$msgcode['tagtree']['edit']['updateTag']['ERR1'] = 145;
504$msgcode['tagtree']['edit']['updateTag']['ERR2'] = 148;
931bf334 505
9457ca59
DO
506$page['myaccount']['title'] = 'My account';
507$page['myaccount']['parent'] = 'config';
508$tab['myaccount']['default'] = 'Info';
0ac7e4b3
DO
509$tab['myaccount']['mypassword'] = 'Password change';
510$tab['myaccount']['myrealname'] = '[Real name change]';
511$trigger['myaccount']['mypassword'] = 'trigger_passwdchange';
9457ca59
DO
512$tabhandler['myaccount']['default'] = 'renderMyAccount';
513$tabhandler['myaccount']['mypassword'] = 'renderMyPasswordEditor';
0ac7e4b3 514$tabhandler['myaccount']['myrealname'] = 'dragon';
9457ca59 515$ophandler['myaccount']['mypassword']['changeMyPassword'] = 'changeMyPassword';
baf37d01 516$msgcode['myaccount']['mypassword']['changeMyPassword']['OK'] = 61;
ebb5441d
DO
517$msgcode['myaccount']['mypassword']['changeMyPassword']['ERR1'] = 150;
518$msgcode['myaccount']['mypassword']['changeMyPassword']['ERR2'] = 151;
519$msgcode['myaccount']['mypassword']['changeMyPassword']['ERR3'] = 152;
520$msgcode['myaccount']['mypassword']['changeMyPassword']['ERR4'] = 153;
9457ca59 521
eebf9145 522$page['reports']['title'] = 'Reports';
e673ee24 523$page['reports']['parent'] = 'index';
79a10049 524$page['reports']['handler'] = 'renderReportSummary';
e673ee24
DO
525
526// This function returns array if page numbers leading to the target page
527// plus page number of target page itself. The first element is the target
528// page number and the last element is the index page number.
529function getPath ($targetno)
530{
531 global $page;
532 $path = array();
533 // Recursion breaks at first parentless page.
534 if (!isset ($page[$targetno]['parent']))
535 $path = array ($targetno);
536 else
537 {
538 $path = getPath ($page[$targetno]['parent']);
539 $path[] = $targetno;
540 }
541 return $path;
542}
543
544function showPathAndSearch ($pageno)
545{
9c0b0016 546 global $root, $page;
e673ee24 547 // Path.
73635d32 548 echo "<td class=activemenuitem width='99%'>" . getConfigVar ('enterprise');
eebf9145
DO
549 $path = getPath ($pageno);
550 foreach ($path as $no)
e673ee24 551 {
eebf9145
DO
552 $title['params'] = array();
553 if (isset ($page[$no]['title']))
554 $title['name'] = $page[$no]['title'];
555 elseif (isset ($page[$no]['title_handler']))
556 $title = $page[$no]['title_handler']($no);
557 else
558 $title['name'] = '[N/A]';
559 echo ": <a href='${root}?page=${no}";
560 foreach ($title['params'] as $param_name => $param_value)
561 echo "&${param_name}=${param_value}";
562 echo "'>" . $title['name'] . "</a>";
e673ee24
DO
563 }
564 echo "</td>";
565 // Search form.
566 echo "<td><table border=0 cellpadding=0 cellspacing=0><tr><td>Search:</td>";
e09e31d5 567 echo "<form name=search method=get action='${root}'><td>";
e673ee24
DO
568 echo '<input type=hidden name=page value=search>';
569 // This input will be the first, if we don't add ports or addresses.
570 echo "<input type=text name=q size=20 tabindex=1000></td></form></tr></table></td>";
571}
572
573function getTitle ($pageno, $tabno)
574{
9c0b0016 575 global $page;
eebf9145
DO
576 if (isset ($page[$pageno]['title']))
577 return $page[$pageno]['title'];
578 elseif (isset ($page[$pageno]['title_handler']))
579 {
580 $tmp = $page[$pageno]['title_handler']($pageno);
581 return $tmp['name'];
582 }
583 else
9c0b0016 584 return getConfigVar ('enterprise');
e673ee24
DO
585}
586
587function showTabs ($pageno, $tabno)
588{
08b16bf5 589 global $tab, $root, $page, $remote_username, $trigger, $tabextraclass;
e673ee24
DO
590 if (!isset ($tab[$pageno]['default']))
591 return;
592 echo "<td><div class=greynavbar><ul id=foldertab style='margin-bottom: 0px; padding-top: 10px;'>";
593 foreach ($tab[$pageno] as $tabidx => $tabtitle)
594 {
595 // Hide forbidden tabs.
810e3422 596 if (!permitted ($pageno, $tabidx))
e673ee24 597 continue;
641fe9b0 598 // Dynamic tabs should only be shown in certain cases (trigger exists and returns true).
545eaaca
DO
599 if (isset ($trigger[$pageno][$tabidx]))
600 {
601// $t1 = microtime (TRUE);
602 $ok = $trigger[$pageno][$tabidx] ();
603// $t2 = microtime (TRUE);
604// echo 'DEBUG: ' . $trigger[$pageno][$tabidx] . ': ' . sprintf ('%0.4f', $t2 - $t1) . '<br>';
605 if (!$ok)
606 continue;
607 }
08b16bf5
DO
608 $class = ($tabidx == $tabno) ? 'current' : 'std';
609 $extra = (isset ($tabextraclass[$pageno][$tabidx])) ? $tabextraclass[$pageno][$tabidx] : '';
610 echo "<li><a class=${class}{$extra}";
e673ee24
DO
611 echo " href='${root}?page=${pageno}&tab=${tabidx}";
612 if (isset ($page[$pageno]['bypass']) and isset ($_REQUEST[$page[$pageno]['bypass']]))
613 {
614 $bpname = $page[$pageno]['bypass'];
615 $bpval = $_REQUEST[$bpname];
616 echo "&${bpname}=${bpval}";
617 }
618 echo "'>${tabtitle}</a></li>\n";
619 }
620 echo "</ul></div></td>\n";
621}
622
623// This function returns pages, which are direct children of the requested
624// page and are accessible by the current user.
625function getDirectChildPages ($pageno)
626{
627 global $page, $remote_username;
628 $children = array();
629 foreach ($page as $cpageno => $cpage)
630 if
631 (
632 isset ($cpage['parent']) and
633 $cpage['parent'] == $pageno and
810e3422 634 accessibleSubpage ($cpageno) == TRUE
e673ee24
DO
635 )
636 $children[$cpageno] = $cpage;
637 return $children;
638}
639
640function getAllChildPages ($parent)
641{
642 global $page;
643 // Array pointer is global, so if we don't create local copies of
644 // the global array, we can't advance any more after nested call
645 // of getAllChildPages returns.
646 $mypage = $page;
647 $mykids = array();
648 foreach ($mypage as $ctitle => $cpage)
649 if (isset ($cpage['parent']) and $cpage['parent'] == $parent)
650 $mykids[] = array ('title' => $ctitle, 'kids' => getAllChildPages ($ctitle));
651 return $mykids;
652}
653
654?>