r2335 - overhaul buildRedirectURL() and $msgcode to get smaller message structure
authorDenis Ovsienko <infrastation@yandex.ru>
Wed, 14 Jan 2009 23:13:07 +0000 (23:13 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Wed, 14 Jan 2009 23:13:07 +0000 (23:13 +0000)
inc/functions.php
inc/navigation.php
inc/ophandlers.php

index 85b568204d6342785bb18bd9799fd9169b3fa8ae..71f477a8dc51cf99c6b98c5f92abf9a41f8300a8 100644 (file)
@@ -1224,14 +1224,14 @@ function buildWideRedirectURL ($log, $nextpage = NULL, $nexttab = NULL)
        return $url;
 }
 
-function buildRedirectURL ($status, $args = array(), $nextpage = NULL, $nexttab = NULL)
+function buildRedirectURL ($callfunc, $status, $args = array(), $nextpage = NULL, $nexttab = NULL)
 {
        global $pageno, $tabno;
        if ($nextpage === NULL)
                $nextpage = $pageno;
        if ($nexttab === NULL)
                $nexttab = $tabno;
-       return buildWideRedirectURL (oneLiner (getMessageCode ($status), $args), $nextpage, $nexttab);
+       return buildWideRedirectURL (oneLiner (getMessageCode ($callfunc, $status), $args), $nextpage, $nexttab);
 }
 
 // Return a message log consisting of only one message.
@@ -1243,10 +1243,10 @@ function oneLiner ($code, $args = array())
 }
 
 // Return mesage code by status code.
-function getMessageCode ($status)
+function getMessageCode ($callfunc, $status)
 {
-       global $pageno, $tabno, $op, $msgcode;
-       return $msgcode[$pageno][$tabno][$op][$status];
+       global $msgcode;
+       return $msgcode[$callfunc][$status];
 }
 
 function validTagName ($s, $allow_autotag = FALSE)
index 42362e9b3c4ce091bd67fd57b58bc0298c5df816..14e9b221738b2ff4f8fb0c5872df4125d89780b3 100644 (file)
@@ -27,10 +27,10 @@ $tabhandler['rackspace']['edit'] = 'renderRackspaceRowEditor';
 $tabhandler['rackspace']['history'] = 'renderRackspaceHistory';
 $ophandler['rackspace']['edit']['addRow'] = 'addRow';
 $ophandler['rackspace']['edit']['updateRow'] = 'updateRow';
-$msgcode['rackspace']['edit']['addRow']['OK'] = 74;
-$msgcode['rackspace']['edit']['addRow']['ERR'] = 100;
-$msgcode['rackspace']['edit']['updateRow']['OK'] = 75;
-$msgcode['rackspace']['edit']['updateRow']['ERR'] = 100;
+$msgcode['addRow']['OK'] = 74;
+$msgcode['addRow']['ERR'] = 100;
+$msgcode['updateRow']['OK'] = 75;
+$msgcode['updateRow']['ERR'] = 100;
 
 $page['objects']['title'] = 'Objects';
 $page['objects']['parent'] = 'index';
@@ -39,8 +39,8 @@ $tab['objects']['addmore'] = 'Add more';
 $tabhandler['objects']['default'] = 'renderObjectSpace';
 $tabhandler['objects']['addmore'] = 'renderAddMultipleObjectsForm';
 $ophandler['objects']['default']['deleteObject'] = 'deleteObject';
-$msgcode['objects']['default']['deleteObject']['OK'] = 76;
-$msgcode['objects']['default']['deleteObject']['ERR'] = 100;
+$msgcode['deleteObject']['OK'] = 76;
+$msgcode['deleteObject']['ERR'] = 100;
 
 $page['row']['title_handler'] = 'dynamic_title_row';
 $page['row']['bypass'] = 'row_id';
@@ -54,11 +54,11 @@ $tabhandler['row']['newrack'] = 'renderNewRackForm';
 $tabhandler['row']['tagroller'] = 'renderTagRollerForRow';
 $ophandler['row']['tagroller']['rollTags'] = 'rollTags';
 $ophandler['row']['newrack']['addRack'] = 'addRack';
-$msgcode['row']['tagroller']['rollTags']['OK'] = 67;
-$msgcode['row']['tagroller']['rollTags']['ERR'] = 149;
-$msgcode['row']['newrack']['addRack']['OK'] = 65;
-$msgcode['row']['newrack']['addRack']['ERR1'] = 171;
-$msgcode['row']['newrack']['addRack']['ERR2'] = 172;
+$msgcode['rollTags']['OK'] = 67;
+$msgcode['rollTags']['ERR'] = 149;
+$msgcode['addRack']['OK'] = 65;
+$msgcode['addRack']['ERR1'] = 171;
+$msgcode['addRack']['ERR2'] = 172;
 
 $page['rack']['title_handler'] = 'dynamic_title_rack';
 $page['rack']['bypass'] = 'rack_id';
@@ -86,19 +86,19 @@ $ophandler['rack']['files']['updateFile'] = 'updateFile';
 $ophandler['rack']['files']['linkFile'] = 'linkFileToEntity';
 $ophandler['rack']['files']['unlinkFile'] = 'unlinkFile';
 $ophandler['rack']['files']['deleteFile'] = 'deleteFile';
-$msgcode['rack']['edit']['updateRack']['OK'] = 68;
-$msgcode['rack']['edit']['updateRack']['ERR'] = 177;
-$msgcode['rack']['files']['addFile']['OK'] = 69;
-$msgcode['rack']['files']['addFile']['ERR'] = 100;
-$msgcode['rack']['files']['updateFile']['OK'] = 70;
-$msgcode['rack']['files']['updateFile']['ERR'] = 100;
-$msgcode['rack']['files']['linkFile']['OK'] = 71;
-$msgcode['rack']['files']['linkFile']['ERR1'] = 178;
-$msgcode['rack']['files']['linkFile']['ERR2'] = 100;
-$msgcode['rack']['files']['unlinkFile']['OK'] = 72;
-$msgcode['rack']['files']['unlinkFile']['ERR'] = 100;
-$msgcode['rack']['files']['deleteFile']['OK'] = 73;
-$msgcode['rack']['files']['deleteFile']['ERR'] = 100;
+$msgcode['updateRack']['OK'] = 68;
+$msgcode['updateRack']['ERR'] = 177;
+$msgcode['addFileToEntity']['OK'] = 69;
+$msgcode['addFileToEntity']['ERR'] = 100;
+$msgcode['updateFile']['OK'] = 70;
+$msgcode['updateFile']['ERR'] = 100;
+$msgcode['linkFileToEntity']['OK'] = 71;
+$msgcode['linkFileToEntity']['ERR1'] = 178;
+$msgcode['linkFileToEntity']['ERR2'] = 100;
+$msgcode['unlinkFile']['OK'] = 72;
+$msgcode['unlinkFile']['ERR'] = 100;
+$msgcode['deleteFile']['OK'] = 73;
+$msgcode['deleteFile']['ERR'] = 100;
 
 $page['objgroup']['title_handler'] = 'dynamic_title_objgroup';
 $page['objgroup']['handler'] = 'renderObjectGroup';
@@ -106,8 +106,6 @@ $page['objgroup']['bypass'] = 'group_id';
 $page['objgroup']['bypass_type'] = 'uint0';
 $page['objgroup']['parent'] = 'objects';
 $ophandler['objgroup']['default']['deleteObject'] = 'deleteObject';
-$msgcode['objgroup']['default']['deleteObject']['OK'] = 76;
-$msgcode['objgroup']['default']['deleteObject']['ERR'] = 100;
 
 $page['object']['title_handler'] = 'dynamic_title_object';
 $page['object']['bypass'] = 'object_id';
@@ -180,69 +178,50 @@ $ophandler['object']['editrspvs']['updLB'] = 'updateLoadBalancer';
 $ophandler['object']['lvsconfig']['submitSLBConfig'] = 'submitSLBConfig';
 $ophandler['object']['snmpportfinder']['querySNMPData'] = 'querySNMPData';
 $delayauth['object']['livevlans']['setPortVLAN'] = TRUE;
-$msgcode['object']['nat4']['addNATv4Rule']['OK'] = 2;
-$msgcode['object']['nat4']['addNATv4Rule']['ERR'] = 100;
-$msgcode['object']['nat4']['delNATv4Rule']['OK'] = 3;
-$msgcode['object']['nat4']['delNATv4Rule']['ERR'] = 100;
-$msgcode['object']['nat4']['updNATv4Rule']['OK'] = 4;
-$msgcode['object']['nat4']['updNATv4Rule']['ERR'] = 100;
-$msgcode['object']['ports']['addPort']['OK'] = 5;
-$msgcode['object']['ports']['addPort']['ERR1'] = 101;
-$msgcode['object']['ports']['addPort']['ERR2'] = 100;
-$msgcode['object']['ports']['editPort']['OK'] = 6;
-$msgcode['object']['ports']['editPort']['ERR1'] = 101;
-$msgcode['object']['ports']['editPort']['ERR2'] = 100;
-$msgcode['object']['ports']['delPort']['OK'] = 7;
-$msgcode['object']['ports']['delPort']['ERR'] = 100;
-$msgcode['object']['ports']['linkPort']['OK'] = 8;
-$msgcode['object']['ports']['linkPort']['ERR'] = 100;
-$msgcode['object']['ports']['unlinkPort']['OK'] = 9;
-$msgcode['object']['ports']['unlinkPort']['ERR'] = 100;
-$msgcode['object']['ports']['addMultiPorts']['OK'] = 10;
-$msgcode['object']['ports']['addMultiPorts']['ERR'] = 123;
-$msgcode['object']['ports']['useup']['OK'] = 11;
-$msgcode['object']['ports']['useup']['ERR'] = 124;
-$msgcode['object']['ipv4']['updIPv4Allocation']['OK'] = 12;
-$msgcode['object']['ipv4']['updIPv4Allocation']['ERR'] = 100;
-$msgcode['object']['ipv4']['addIPv4Allocation']['OK'] = 13;
-$msgcode['object']['ipv4']['addIPv4Allocation']['ERR1'] = 170;
-$msgcode['object']['ipv4']['addIPv4Allocation']['ERR2'] = 100;
-$msgcode['object']['ipv4']['delIPv4Allocation']['OK'] = 14;
-$msgcode['object']['ipv4']['delIPv4Allocation']['ERR'] = 100;
-$msgcode['object']['edit']['clearSticker']['OK'] = 15;
-$msgcode['object']['edit']['clearSticker']['ERR'] = 120;
-$msgcode['object']['edit']['update']['OK'] = 16;
-$msgcode['object']['edit']['update']['ERR'] = 121;
-$msgcode['object']['editrspvs']['addLB']['OK'] = 18;
-$msgcode['object']['editrspvs']['addLB']['ERR'] = 137;
-$msgcode['object']['editrspvs']['delLB']['OK'] = 19;
-$msgcode['object']['editrspvs']['delLB']['ERR'] = 129;
-$msgcode['object']['editrspvs']['updLB']['OK'] = 20;
-$msgcode['object']['editrspvs']['updLB']['ERR'] = 134;
-$msgcode['object']['autoports']['generate']['OK'] = 21;
-$msgcode['object']['autoports']['generate']['ERR'] = 142;
-$msgcode['object']['livevlans']['setPortVLAN']['ERR1'] = 156;
-$msgcode['object']['tags']['saveTags']['OK'] = 22;
-$msgcode['object']['tags']['saveTags']['ERR'] = 143;
-$msgcode['object']['files']['addFile']['OK'] = $msgcode['rack']['files']['addFile']['OK'];
-$msgcode['object']['files']['addFile']['ERR'] = $msgcode['rack']['files']['addFile']['ERR'];
-$msgcode['object']['files']['updateFile']['OK'] = $msgcode['rack']['files']['updateFile']['OK'];
-$msgcode['object']['files']['updateFile']['ERR'] = $msgcode['rack']['files']['updateFile']['ERR'];
-$msgcode['object']['files']['linkFile']['OK'] = $msgcode['rack']['files']['linkFile']['OK'];
-$msgcode['object']['files']['linkFile']['ERR1'] = $msgcode['rack']['files']['linkFile']['ERR1'];
-$msgcode['object']['files']['linkFile']['ERR2'] = $msgcode['rack']['files']['linkFile']['ERR2'];
-$msgcode['object']['files']['unlinkFile']['OK'] = $msgcode['rack']['files']['unlinkFile']['OK'];
-$msgcode['object']['files']['unlinkFile']['ERR'] = $msgcode['rack']['files']['unlinkFile']['ERR'];
-$msgcode['object']['files']['deleteFile']['OK'] = $msgcode['rack']['files']['deleteFile']['OK'];
-$msgcode['object']['files']['deleteFile']['ERR'] = $msgcode['rack']['files']['deleteFile']['ERR'];
-$msgcode['rack']['tags']['saveTags'] = $msgcode['object']['tags']['saveTags'];
-$msgcode['ipv4net']['tags']['saveTags'] = $msgcode['object']['tags']['saveTags'];
-$msgcode['ipv4vs']['tags']['saveTags'] = $msgcode['object']['tags']['saveTags'];
-$msgcode['ipv4rspool']['tags']['saveTags'] = $msgcode['object']['tags']['saveTags'];
-$msgcode['user']['tags']['saveTags'] = $msgcode['object']['tags']['saveTags'];
-$msgcode['ipv4vs']['editlblist'] = $msgcode['object']['editrspvs'];
-$msgcode['ipv4rspool']['editlblist'] = $msgcode['object']['editrspvs'];
-$msgcode['ipaddress']['assignment'] = $msgcode['object']['ipv4'];
+$msgcode['addPortForwarding']['OK'] = 2;
+$msgcode['addPortForwarding']['ERR'] = 100;
+$msgcode['delPortForwarding']['OK'] = 3;
+$msgcode['delPortForwarding']['ERR'] = 100;
+$msgcode['updPortForwarding']['OK'] = 4;
+$msgcode['updPortForwarding']['ERR'] = 100;
+$msgcode['addPortForObject']['OK'] = 5;
+$msgcode['addPortForObject']['ERR1'] = 101;
+$msgcode['addPortForObject']['ERR2'] = 100;
+$msgcode['editPortForObject']['OK'] = 6;
+$msgcode['editPortForObject']['ERR1'] = 101;
+$msgcode['editPortForObject']['ERR2'] = 100;
+$msgcode['delPortFromObject']['OK'] = 7;
+$msgcode['delPortFromObject']['ERR'] = 100;
+$msgcode['linkPortForObject']['OK'] = 8;
+$msgcode['linkPortForObject']['ERR'] = 100;
+$msgcode['unlinkPortForObject']['OK'] = 9;
+$msgcode['unlinkPortForObject']['ERR'] = 100;
+$msgcode['addMultiPorts']['OK'] = 10;
+$msgcode['addMultiPorts']['ERR'] = 123;
+$msgcode['useupPort']['OK'] = 11;
+$msgcode['useupPort']['ERR'] = 124;
+$msgcode['updIPv4Allocation']['OK'] = 12;
+$msgcode['updIPv4Allocation']['ERR'] = 100;
+$msgcode['addIPv4Allocation']['OK'] = 13;
+$msgcode['addIPv4Allocation']['ERR1'] = 170;
+$msgcode['addIPv4Allocation']['ERR2'] = 100;
+$msgcode['delIPv4Allocation']['OK'] = 14;
+$msgcode['delIPv4Allocation']['ERR'] = 100;
+$msgcode['clearSticker']['OK'] = 15;
+$msgcode['clearSticker']['ERR'] = 120;
+$msgcode['updateObject']['OK'] = 16;
+$msgcode['updateObject']['ERR'] = 121;
+$msgcode['addLoadBalancer']['OK'] = 18;
+$msgcode['addLoadBalancer']['ERR'] = 137;
+$msgcode['delLoadBalancer']['OK'] = 19;
+$msgcode['deleteLoadBalancer']['ERR'] = 129;
+$msgcode['updateLoadBalancer']['OK'] = 20;
+$msgcode['updateLoadBalancer']['ERR'] = 134;
+$msgcode['generateAutoPorts']['OK'] = 21;
+$msgcode['generateAutoPorts']['ERR'] = 142;
+$msgcode['setPortVLAN']['ERR1'] = 156;
+$msgcode['saveEntityTags']['OK'] = 22;
+$msgcode['saveEntityTags']['ERR'] = 143;
 
 $page['ipv4space']['title'] = 'IPv4 space';
 $page['ipv4space']['parent'] = 'index';
@@ -253,14 +232,14 @@ $tabhandler['ipv4space']['newrange'] = 'renderIPv4SpaceEditor';
 $ophandler['ipv4space']['newrange']['addIPv4Prefix'] = 'addIPv4Prefix';
 $ophandler['ipv4space']['newrange']['delIPv4Prefix'] = 'delIPv4Prefix';
 $ophandler['ipv4space']['newrange']['updIPv4Prefix'] = 'updIPv4Prefix';
-$msgcode['ipv4space']['newrange']['addIPv4Prefix']['OK'] = 23;
-$msgcode['ipv4space']['newrange']['addIPv4Prefix']['ERR'] = 100;
-$msgcode['ipv4space']['newrange']['addIPv4Prefix']['ERR1'] = 173;
-$msgcode['ipv4space']['newrange']['addIPv4Prefix']['ERR2'] = 174;
-$msgcode['ipv4space']['newrange']['addIPv4Prefix']['ERR3'] = 175;
-$msgcode['ipv4space']['newrange']['addIPv4Prefix']['ERR4'] = 176;
-$msgcode['ipv4space']['newrange']['delIPv4Prefix']['OK'] = 24;
-$msgcode['ipv4space']['newrange']['delIPv4Prefix']['ERR'] = 100;
+$msgcode['addIPv4Prefix']['OK'] = 23;
+$msgcode['addIPv4Prefix']['ERR'] = 100;
+$msgcode['addIPv4Prefix']['ERR1'] = 173;
+$msgcode['addIPv4Prefix']['ERR2'] = 174;
+$msgcode['addIPv4Prefix']['ERR3'] = 175;
+$msgcode['addIPv4Prefix']['ERR4'] = 176;
+$msgcode['delIPv4Prefix']['OK'] = 24;
+$msgcode['delIPv4Prefix']['ERR'] = 100;
 
 $page['ipv4net']['title_handler'] = 'dynamic_title_ipv4net';
 $page['ipv4net']['parent'] = 'ipv4space';
@@ -287,22 +266,10 @@ $ophandler['ipv4net']['files']['updateFile'] = 'updateFile';
 $ophandler['ipv4net']['files']['linkFile'] = 'linkFileToEntity';
 $ophandler['ipv4net']['files']['unlinkFile'] = 'unlinkFile';
 $ophandler['ipv4net']['files']['deleteFile'] = 'deleteFile';
-$msgcode['ipv4net']['properties']['editRange']['OK'] = 25;
-$msgcode['ipv4net']['properties']['editRange']['ERR'] = 100;
-$msgcode['ipv4net']['liveptr']['importPTRData']['OK'] = 26;
-$msgcode['ipv4net']['liveptr']['importPTRData']['ERR'] = 141;
-$msgcode['ipv4space']['newrange']['updIPv4Prefix'] = $msgcode['ipv4net']['properties']['editRange'];
-$msgcode['ipv4net']['files']['addFile']['OK'] = $msgcode['rack']['files']['addFile']['OK'];
-$msgcode['ipv4net']['files']['addFile']['ERR'] = $msgcode['rack']['files']['addFile']['ERR'];
-$msgcode['ipv4net']['files']['updateFile']['OK'] = $msgcode['rack']['files']['updateFile']['OK'];
-$msgcode['ipv4net']['files']['updateFile']['ERR'] = $msgcode['rack']['files']['updateFile']['ERR'];
-$msgcode['ipv4net']['files']['linkFile']['OK'] = $msgcode['rack']['files']['linkFile']['OK'];
-$msgcode['ipv4net']['files']['linkFile']['ERR1'] = $msgcode['rack']['files']['linkFile']['ERR1'];
-$msgcode['ipv4net']['files']['linkFile']['ERR2'] = $msgcode['rack']['files']['linkFile']['ERR2'];
-$msgcode['ipv4net']['files']['unlinkFile']['OK'] = $msgcode['rack']['files']['unlinkFile']['OK'];
-$msgcode['ipv4net']['files']['unlinkFile']['ERR'] = $msgcode['rack']['files']['unlinkFile']['ERR'];
-$msgcode['ipv4net']['files']['deleteFile']['OK'] = $msgcode['rack']['files']['deleteFile']['OK'];
-$msgcode['ipv4net']['files']['deleteFile']['ERR'] = $msgcode['rack']['files']['deleteFile']['ERR'];
+$msgcode['updIPv4Prefix']['OK'] = 25;
+$msgcode['updIPv4Prefix']['ERR'] = 100;
+$msgcode['importPTRData']['OK'] = 26;
+$msgcode['importPTRData']['ERR'] = 141;
 
 $page['ipaddress']['title_handler'] = 'dynamic_title_ipaddress';
 $page['ipaddress']['parent'] = 'ipv4net';
@@ -321,8 +288,8 @@ $ophandler['ipaddress']['properties']['editAddress'] = 'editAddress';
 $ophandler['ipaddress']['assignment']['delIPv4Allocation'] = 'delIPv4Allocation';
 $ophandler['ipaddress']['assignment']['updIPv4Allocation'] = 'updIPv4Allocation';
 $ophandler['ipaddress']['assignment']['addIPv4Allocation'] = 'addIPv4Allocation';
-$msgcode['ipaddress']['properties']['editAddress']['OK'] = 27;
-$msgcode['ipaddress']['properties']['editAddress']['ERR'] = 100;
+$msgcode['editAddress']['OK'] = 27;
+$msgcode['editAddress']['ERR'] = 100;
 
 $page['ipv4slb']['title'] = 'IPv4 SLB';
 $page['ipv4slb']['parent'] = 'index';
@@ -337,14 +304,13 @@ $tabhandler['ipv4vslist']['edit'] = 'renderVSListEditForm';
 $ophandler['ipv4vslist']['edit']['add'] = 'addVService';
 $ophandler['ipv4vslist']['edit']['del'] = 'deleteVService';
 $ophandler['ipv4vslist']['edit']['upd'] = 'updateVService';
-$msgcode['ipv4vslist']['edit']['add']['OK'] = 28;
-$msgcode['ipv4vslist']['edit']['add']['ERR1'] = 132;
-$msgcode['ipv4vslist']['edit']['add']['ERR2'] = 100;
-$msgcode['ipv4vslist']['edit']['del']['OK'] = 29;
-$msgcode['ipv4vslist']['edit']['del']['ERR'] = 130;
-$msgcode['ipv4vslist']['edit']['upd']['OK'] = 30;
-$msgcode['ipv4vslist']['edit']['upd']['ERR'] = 135;
-$msgcode['ipv4vs']['edit']['updIPv4VS'] = $msgcode['ipv4vslist']['edit']['upd'];
+$msgcode['addVService']['OK'] = 28;
+$msgcode['addVService']['ERR1'] = 132;
+$msgcode['addVService']['ERR2'] = 100;
+$msgcode['deleteVService']['OK'] = 29;
+$msgcode['deleteVService']['ERR'] = 130;
+$msgcode['updateVService']['OK'] = 30;
+$msgcode['updateVService']['ERR'] = 135;
 
 $page['ipv4vs']['title_handler'] = 'dynamic_title_vservice';
 $page['ipv4vs']['parent'] = 'ipv4vslist';
@@ -373,17 +339,6 @@ $ophandler['ipv4vs']['files']['updateFile'] = 'updateFile';
 $ophandler['ipv4vs']['files']['linkFile'] = 'linkFileToEntity';
 $ophandler['ipv4vs']['files']['unlinkFile'] = 'unlinkFile';
 $ophandler['ipv4vs']['files']['deleteFile'] = 'deleteFile';
-$msgcode['ipv4vs']['files']['addFile']['OK'] = $msgcode['rack']['files']['addFile']['OK'];
-$msgcode['ipv4vs']['files']['addFile']['ERR'] = $msgcode['rack']['files']['addFile']['ERR'];
-$msgcode['ipv4vs']['files']['updateFile']['OK'] = $msgcode['rack']['files']['updateFile']['OK'];
-$msgcode['ipv4vs']['files']['updateFile']['ERR'] = $msgcode['rack']['files']['updateFile']['ERR'];
-$msgcode['ipv4vs']['files']['linkFile']['OK'] = $msgcode['rack']['files']['linkFile']['OK'];
-$msgcode['ipv4vs']['files']['linkFile']['ERR1'] = $msgcode['rack']['files']['linkFile']['ERR1'];
-$msgcode['ipv4vs']['files']['linkFile']['ERR2'] = $msgcode['rack']['files']['linkFile']['ERR2'];
-$msgcode['ipv4vs']['files']['unlinkFile']['OK'] = $msgcode['rack']['files']['unlinkFile']['OK'];
-$msgcode['ipv4vs']['files']['unlinkFile']['ERR'] = $msgcode['rack']['files']['unlinkFile']['ERR'];
-$msgcode['ipv4vs']['files']['deleteFile']['OK'] = $msgcode['rack']['files']['deleteFile']['OK'];
-$msgcode['ipv4vs']['files']['deleteFile']['ERR'] = $msgcode['rack']['files']['deleteFile']['ERR'];
 
 $page['ipv4rsplist']['title'] = 'RS pools';
 $page['ipv4rsplist']['parent'] = 'ipv4slb';
@@ -394,13 +349,12 @@ $tabhandler['ipv4rsplist']['edit'] = 'editRSPools';
 $ophandler['ipv4rsplist']['edit']['add'] = 'addRSPool';
 $ophandler['ipv4rsplist']['edit']['del'] = 'deleteRSPool';
 $ophandler['ipv4rsplist']['edit']['upd'] = 'updateRSPool';
-$msgcode['ipv4rsplist']['edit']['add']['OK'] = 31;
-$msgcode['ipv4rsplist']['edit']['add']['ERR'] = 100;
-$msgcode['ipv4rsplist']['edit']['del']['OK'] = 32;
-$msgcode['ipv4rsplist']['edit']['del']['ERR'] = 138;
-$msgcode['ipv4rsplist']['edit']['upd']['OK'] = 33;
-$msgcode['ipv4rsplist']['edit']['upd']['ERR'] = 139;
-$msgcode['ipv4rspool']['edit']['updIPv4RSP'] = $msgcode['ipv4rsplist']['edit']['upd'];
+$msgcode['addRSPool']['OK'] = 31;
+$msgcode['addRSPool']['ERR'] = 100;
+$msgcode['deleteRSPool']['OK'] = 32;
+$msgcode['deleteRSPool']['ERR'] = 138;
+$msgcode['updateRSPool']['OK'] = 33;
+$msgcode['updateRSPool']['ERR'] = 139;
 
 $page['ipv4rspool']['title_handler'] = 'dynamic_title_rspool';
 $page['ipv4rspool']['parent'] = 'ipv4rsplist';
@@ -439,28 +393,17 @@ $ophandler['ipv4rspool']['files']['updateFile'] = 'updateFile';
 $ophandler['ipv4rspool']['files']['linkFile'] = 'linkFileToEntity';
 $ophandler['ipv4rspool']['files']['unlinkFile'] = 'unlinkFile';
 $ophandler['ipv4rspool']['files']['deleteFile'] = 'deleteFile';
-$msgcode['ipv4rspool']['editrslist']['addRS']['OK'] = 34;
-$msgcode['ipv4rspool']['editrslist']['addRS']['ERR'] = 126;
-$msgcode['ipv4rspool']['editrslist']['delRS']['OK'] = 35;
-$msgcode['ipv4rspool']['editrslist']['delRS']['ERR'] = 128;
-$msgcode['ipv4rspool']['editrslist']['updRS']['OK'] = 36;
-$msgcode['ipv4rspool']['editrslist']['updRS']['ERR'] = 133;
-$msgcode['ipv4rspool']['editrslist']['addMany']['OK'] = 37;
-$msgcode['ipv4rspool']['editrslist']['addMany']['ERR1'] = 131;
-$msgcode['ipv4rspool']['editrslist']['addMany']['ERR2'] = 127;
-$msgcode['ipv4rspool']['rsinservice']['upd']['OK'] = 38;
-$msgcode['ipv4rspool']['rsinservice']['upd']['ERR'] = 140;
-$msgcode['ipv4rspool']['files']['addFile']['OK'] = $msgcode['rack']['files']['addFile']['OK'];
-$msgcode['ipv4rspool']['files']['addFile']['ERR'] = $msgcode['rack']['files']['addFile']['ERR'];
-$msgcode['ipv4rspool']['files']['updateFile']['OK'] = $msgcode['rack']['files']['updateFile']['OK'];
-$msgcode['ipv4rspool']['files']['updateFile']['ERR'] = $msgcode['rack']['files']['updateFile']['ERR'];
-$msgcode['ipv4rspool']['files']['linkFile']['OK'] = $msgcode['rack']['files']['linkFile']['OK'];
-$msgcode['ipv4rspool']['files']['linkFile']['ERR1'] = $msgcode['rack']['files']['linkFile']['ERR1'];
-$msgcode['ipv4rspool']['files']['linkFile']['ERR2'] = $msgcode['rack']['files']['linkFile']['ERR2'];
-$msgcode['ipv4rspool']['files']['unlinkFile']['OK'] = $msgcode['rack']['files']['unlinkFile']['OK'];
-$msgcode['ipv4rspool']['files']['unlinkFile']['ERR'] = $msgcode['rack']['files']['unlinkFile']['ERR'];
-$msgcode['ipv4rspool']['files']['deleteFile']['OK'] = $msgcode['rack']['files']['deleteFile']['OK'];
-$msgcode['ipv4rspool']['files']['deleteFile']['ERR'] = $msgcode['rack']['files']['deleteFile']['ERR'];
+$msgcode['addRealServer']['OK'] = 34;
+$msgcode['addRealServer']['ERR'] = 126;
+$msgcode['deleteRealServer']['OK'] = 35;
+$msgcode['deleteRealServer']['ERR'] = 128;
+$msgcode['updateRealServer']['OK'] = 36;
+$msgcode['updateRealServer']['ERR'] = 133;
+$msgcode['addRealServers']['OK'] = 37;
+$msgcode['addRealServers']['ERR1'] = 131;
+$msgcode['addRealServers']['ERR2'] = 127;
+$msgcode['updateRSInService']['OK'] = 38;
+$msgcode['updateRSInService']['ERR'] = 140;
 
 $page['rservers']['title'] = 'Real servers';
 $page['rservers']['parent'] = 'ipv4slb';
@@ -489,16 +432,16 @@ $ophandler['userlist']['edit']['updateUser'] = 'updateUser';
 $ophandler['userlist']['edit']['createUser'] = 'createUser';
 $ophandler['userlist']['edit']['disableUser'] = 'disableUser';
 $ophandler['userlist']['edit']['enableUser'] = 'enableUser';
-$msgcode['userlist']['edit']['updateUser']['OK'] = 39;
-$msgcode['userlist']['edit']['updateUser']['ERR1'] = 103;
-$msgcode['userlist']['edit']['updateUser']['ERR1'] = 104;
-$msgcode['userlist']['edit']['createUser']['OK'] = 40;
-$msgcode['userlist']['edit']['createUser']['ERR'] = 102;
-$msgcode['userlist']['edit']['disableUser']['OK'] = 41;
-$msgcode['userlist']['edit']['disableUser']['ERR1'] = 107;
-$msgcode['userlist']['edit']['disableUser']['ERR2'] = 106;
-$msgcode['userlist']['edit']['enableUser']['OK'] = 42;
-$msgcode['userlist']['edit']['enableUser']['ERR'] = 105;
+$msgcode['updateUser']['OK'] = 39;
+$msgcode['updateUser']['ERR1'] = 103;
+$msgcode['updateUser']['ERR1'] = 104;
+$msgcode['createUser']['OK'] = 40;
+$msgcode['createUser']['ERR'] = 102;
+$msgcode['disableUser']['OK'] = 41;
+$msgcode['disableUser']['ERR1'] = 107;
+$msgcode['disableUser']['ERR2'] = 106;
+$msgcode['enableUser']['OK'] = 42;
+$msgcode['enableUser']['ERR'] = 105;
 
 $page['user']['title_handler'] = 'dynamic_title_user';
 $page['user']['parent'] = 'userlist';
@@ -518,17 +461,6 @@ $ophandler['user']['files']['updateFile'] = 'updateFile';
 $ophandler['user']['files']['linkFile'] = 'linkFileToEntity';
 $ophandler['user']['files']['unlinkFile'] = 'unlinkFile';
 $ophandler['user']['files']['deleteFile'] = 'deleteFile';
-$msgcode['user']['files']['addFile']['OK'] = $msgcode['rack']['files']['addFile']['OK'];
-$msgcode['user']['files']['addFile']['ERR'] = $msgcode['rack']['files']['addFile']['ERR'];
-$msgcode['user']['files']['updateFile']['OK'] = $msgcode['rack']['files']['updateFile']['OK'];
-$msgcode['user']['files']['updateFile']['ERR'] = $msgcode['rack']['files']['updateFile']['ERR'];
-$msgcode['user']['files']['linkFile']['OK'] = $msgcode['rack']['files']['linkFile']['OK'];
-$msgcode['user']['files']['linkFile']['ERR1'] = $msgcode['rack']['files']['linkFile']['ERR1'];
-$msgcode['user']['files']['linkFile']['ERR2'] = $msgcode['rack']['files']['linkFile']['ERR2'];
-$msgcode['user']['files']['unlinkFile']['OK'] = $msgcode['rack']['files']['unlinkFile']['OK'];
-$msgcode['user']['files']['unlinkFile']['ERR'] = $msgcode['rack']['files']['unlinkFile']['ERR'];
-$msgcode['user']['files']['deleteFile']['OK'] = $msgcode['rack']['files']['deleteFile']['OK'];
-$msgcode['user']['files']['deleteFile']['ERR'] = $msgcode['rack']['files']['deleteFile']['ERR'];
 
 $page['perms']['title'] = 'Permissions';
 $page['perms']['parent'] = 'config';
@@ -537,9 +469,9 @@ $tab['perms']['edit'] = 'Edit';
 $tabhandler['perms']['default'] = 'renderRackCodeViewer';
 $tabhandler['perms']['edit'] = 'renderRackCodeEditor';
 $ophandler['perms']['edit']['saveRackCode'] = 'saveRackCode';
-$msgcode['perms']['edit']['saveRackCode']['OK'] = 43;
-$msgcode['perms']['edit']['saveRackCode']['ERR1'] = 154;
-$msgcode['perms']['edit']['saveRackCode']['ERR2'] = 155;
+$msgcode['saveRackCode']['OK'] = 43;
+$msgcode['saveRackCode']['ERR1'] = 154;
+$msgcode['saveRackCode']['ERR2'] = 155;
 
 $page['portmap']['title'] = 'Port compatibility map';
 $page['portmap']['parent'] = 'config';
@@ -548,8 +480,8 @@ $tab['portmap']['edit'] = 'Change';
 $tabhandler['portmap']['default'] = 'renderPortMapViewer';
 $tabhandler['portmap']['edit'] = 'renderPortMapEditor';
 $ophandler['portmap']['edit']['save'] = 'savePortMap';
-$msgcode['portmap']['edit']['save']['OK'] = 44;
-$msgcode['portmap']['edit']['save']['ERR'] = 108;
+$msgcode['savePortMap']['OK'] = 44;
+$msgcode['savePortMap']['ERR'] = 108;
 
 $page['attrs']['title'] = 'Attributes';
 $page['attrs']['parent'] = 'config';
@@ -564,16 +496,16 @@ $ophandler['attrs']['editattrs']['upd'] = 'changeAttribute';
 $ophandler['attrs']['editattrs']['del'] = 'deleteAttribute';
 $ophandler['attrs']['editmap']['add'] = 'supplementAttrMap';
 $ophandler['attrs']['editmap']['del'] = 'reduceAttrMap';
-$msgcode['attrs']['editattrs']['add']['OK'] = 45;
-$msgcode['attrs']['editattrs']['add']['ERR'] = 116;
-$msgcode['attrs']['editattrs']['upd']['OK'] = 46;
-$msgcode['attrs']['editattrs']['upd']['ERR'] = 115;
-$msgcode['attrs']['editattrs']['del']['OK'] = 47;
-$msgcode['attrs']['editattrs']['del']['ERR'] = 117;
-$msgcode['attrs']['editmap']['add']['OK'] = 48;
-$msgcode['attrs']['editmap']['add']['ERR'] = 118;
-$msgcode['attrs']['editmap']['del']['OK'] = 49;
-$msgcode['attrs']['editmap']['del']['ERR'] = 119;
+$msgcode['createAttribute']['OK'] = 45;
+$msgcode['createAttribute']['ERR'] = 116;
+$msgcode['changeAttribute']['OK'] = 46;
+$msgcode['changeAttribute']['ERR'] = 115;
+$msgcode['deleteAttribute']['OK'] = 47;
+$msgcode['deleteAttribute']['ERR'] = 117;
+$msgcode['supplementAttrMap']['OK'] = 48;
+$msgcode['supplementAttrMap']['ERR'] = 118;
+$msgcode['reduceAttrMap']['OK'] = 49;
+$msgcode['reduceAttrMap']['ERR'] = 119;
 
 $page['dict']['title'] = 'Dictionary';
 $page['dict']['parent'] = 'config';
@@ -589,18 +521,18 @@ $ophandler['dict']['edit']['add'] = 'supplementDictionary';
 $ophandler['dict']['chapters']['del'] = 'delChapter';
 $ophandler['dict']['chapters']['upd'] = 'updateChapter';
 $ophandler['dict']['chapters']['add'] = 'addChapter';
-$msgcode['dict']['edit']['del']['OK'] = 50;
-$msgcode['dict']['edit']['del']['ERR'] = 111;
-$msgcode['dict']['edit']['upd']['OK'] = 51;
-$msgcode['dict']['edit']['upd']['ERR'] = 109;
-$msgcode['dict']['edit']['add']['OK'] = 52;
-$msgcode['dict']['edit']['add']['ERR'] = 110;
-$msgcode['dict']['chapters']['del']['OK'] = 53;
-$msgcode['dict']['chapters']['del']['ERR'] = 114;
-$msgcode['dict']['chapters']['upd']['OK'] = 54;
-$msgcode['dict']['chapters']['upd']['ERR'] = 113;
-$msgcode['dict']['chapters']['add']['OK'] = 55;
-$msgcode['dict']['chapters']['add']['ERR'] = 112;
+$msgcode['reduceDictionary']['OK'] = 50;
+$msgcode['reduceDictionary']['ERR'] = 111;
+$msgcode['updateDictionary']['OK'] = 51;
+$msgcode['updateDictionary']['ERR'] = 109;
+$msgcode['supplementDictionary']['OK'] = 52;
+$msgcode['supplementDictionary']['ERR'] = 110;
+$msgcode['delChapter']['OK'] = 53;
+$msgcode['delChapter']['ERR'] = 114;
+$msgcode['updateChapter']['OK'] = 54;
+$msgcode['updateChapter']['ERR'] = 113;
+$msgcode['addChapter']['OK'] = 55;
+$msgcode['addChapter']['ERR'] = 112;
 
 $page['ui']['title'] = 'User interface';
 $page['ui']['parent'] = 'config';
@@ -612,9 +544,9 @@ $tabhandler['ui']['edit'] = 'renderUIConfigEditForm';
 $tabhandler['ui']['reset'] = 'renderUIResetForm';
 $ophandler['ui']['edit']['upd'] = 'updateUI';
 $ophandler['ui']['reset']['go'] = 'resetUIConfig';
-$msgcode['ui']['edit']['upd']['OK'] = 56;
-$msgcode['ui']['edit']['upd']['ERR'] = 125;
-$msgcode['ui']['reset']['go']['OK'] = 57;
+$msgcode['updateUI']['OK'] = 56;
+$msgcode['updateUI']['ERR'] = 125;
+$msgcode['resetUIConfig']['OK'] = 57;
 
 $page['tagtree']['title'] = 'Tag tree';
 $page['tagtree']['parent'] = 'config';
@@ -625,15 +557,15 @@ $tabhandler['tagtree']['edit'] = 'renderTagTreeEditor';
 $ophandler['tagtree']['edit']['destroyTag'] = 'destroyTag';
 $ophandler['tagtree']['edit']['createTag'] = 'createTag';
 $ophandler['tagtree']['edit']['updateTag'] = 'updateTag';
-$msgcode['tagtree']['edit']['destroyTag']['OK'] = 58;
-$msgcode['tagtree']['edit']['destroyTag']['ERR'] = 144;
-$msgcode['tagtree']['edit']['createTag']['OK'] = 59;
-$msgcode['tagtree']['edit']['createTag']['ERR1'] = 145;
-$msgcode['tagtree']['edit']['createTag']['ERR2'] = 146;
-$msgcode['tagtree']['edit']['createTag']['ERR3'] = 147;
-$msgcode['tagtree']['edit']['updateTag']['OK'] = 60;
-$msgcode['tagtree']['edit']['updateTag']['ERR1'] = 145;
-$msgcode['tagtree']['edit']['updateTag']['ERR2'] = 148;
+$msgcode['destroyTag']['OK'] = 58;
+$msgcode['destroyTag']['ERR'] = 144;
+$msgcode['createTag']['OK'] = 59;
+$msgcode['createTag']['ERR1'] = 145;
+$msgcode['createTag']['ERR2'] = 146;
+$msgcode['createTag']['ERR3'] = 147;
+$msgcode['updateTag']['OK'] = 60;
+$msgcode['updateTag']['ERR1'] = 145;
+$msgcode['updateTag']['ERR2'] = 148;
 
 $page['myaccount']['title'] = 'My account';
 $page['myaccount']['parent'] = 'config';
@@ -645,11 +577,11 @@ $tabhandler['myaccount']['default'] = 'renderMyAccount';
 $tabhandler['myaccount']['mypassword'] = 'renderMyPasswordEditor';
 $tabhandler['myaccount']['myrealname'] = 'dragon';
 $ophandler['myaccount']['mypassword']['changeMyPassword'] = 'changeMyPassword';
-$msgcode['myaccount']['mypassword']['changeMyPassword']['OK'] = 61;
-$msgcode['myaccount']['mypassword']['changeMyPassword']['ERR1'] = 150;
-$msgcode['myaccount']['mypassword']['changeMyPassword']['ERR2'] = 151;
-$msgcode['myaccount']['mypassword']['changeMyPassword']['ERR3'] = 152;
-$msgcode['myaccount']['mypassword']['changeMyPassword']['ERR4'] = 153;
+$msgcode['changeMyPassword']['OK'] = 61;
+$msgcode['changeMyPassword']['ERR1'] = 150;
+$msgcode['changeMyPassword']['ERR2'] = 151;
+$msgcode['changeMyPassword']['ERR3'] = 152;
+$msgcode['changeMyPassword']['ERR4'] = 153;
 
 $page['reports']['title'] = 'Reports';
 $page['reports']['parent'] = 'index';
@@ -670,8 +602,8 @@ $tab['files']['addmore'] = 'Upload';
 $tabhandler['files']['default'] = 'renderFileSpace';
 $tabhandler['files']['addmore'] = 'renderFileUploadForm';
 $ophandler['files']['addmore']['addFile'] = 'addFileWithoutLink';
-$msgcode['files']['addmore']['addFile']['OK'] = 69;
-$msgcode['files']['addmore']['addFile']['ERR'] = 100;
+$msgcode['addFileWithoutLink']['OK'] = 69;
+$msgcode['addFileWithoutLink']['ERR'] = 100;
 
 $page['filesbylink']['title_handler'] = 'dynamic_title_file';
 $page['filesbylink']['handler'] = 'renderFilesByLink'; //renderObjectGroup
@@ -692,8 +624,6 @@ $trigger['file']['tags'] = 'trigger_tags';
 $tabhandler['file']['tags'] = 'renderFileTags';
 $tabhandler['file']['default'] = 'renderFile';
 $ophandler['file']['tags']['saveTags'] = 'saveEntityTags';
-$msgcode['file']['tags']['saveTags']['OK'] = 22;
-$msgcode['file']['tags']['saveTags']['ERR'] = 143;
 
 // This function returns array if page numbers leading to the target page
 // plus page number of target page itself. The first element is the target
index defbf13505d1c52d84086e46f33c40be11acbac9..79ff379c4af66bcc30ae9eb4c0a6e29e69f938e8 100644 (file)
@@ -105,9 +105,9 @@ function addPortForwarding ()
        );
 
        if ($error == '')
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
        else
-               return buildRedirectURL ('ERR', array ($error));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($error));
 }
 
 function delPortForwarding ()
@@ -129,9 +129,9 @@ function delPortForwarding ()
                $_REQUEST['proto']
        );
        if ($error == '')
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
        else
-               return buildRedirectURL ('ERR', array ($error));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($error));
 }
 
 function updPortForwarding ()
@@ -155,9 +155,9 @@ function updPortForwarding ()
                $_REQUEST['description']
        );
        if ($error == '')
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
        else
-               return buildRedirectURL ('ERR', array ($error));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($error));
 }
 
 function addPortForObject ()
@@ -165,12 +165,12 @@ function addPortForObject ()
        assertUIntArg ('object_id', __FUNCTION__);
        assertStringArg ('port_name', __FUNCTION__, TRUE);
        if (empty ($_REQUEST['port_name']))
-               return buildRedirectURL ('ERR1');
+               return buildRedirectURL (__FUNCTION__, 'ERR1');
        $error = commitAddPort ($_REQUEST['object_id'], $_REQUEST['port_name'], $_REQUEST['port_type_id'], $_REQUEST['port_label'], $_REQUEST['port_l2address']);
        if ($error != '')
-               return buildRedirectURL ('ERR2', array ($error));
+               return buildRedirectURL (__FUNCTION__, 'ERR2', array ($error));
        else
-               return buildRedirectURL ('OK', array ($_REQUEST['port_name']));
+               return buildRedirectURL (__FUNCTION__, 'OK', array ($_REQUEST['port_name']));
 }
 
 function editPortForObject ()
@@ -180,7 +180,7 @@ function editPortForObject ()
        // tolerate empty value now to produce custom informative message later
        assertStringArg ('name', __FUNCTION__, TRUE);
        if (empty ($_REQUEST['name']))
-               return buildRedirectURL ('ERR1');
+               return buildRedirectURL (__FUNCTION__, 'ERR1');
 
        if (isset ($_REQUEST['reservation_comment']) and !empty ($_REQUEST['reservation_comment']))
                $port_rc = '"' . $_REQUEST['reservation_comment'] . '"';
@@ -188,9 +188,9 @@ function editPortForObject ()
                $port_rc = 'NULL';
        $error = commitUpdatePort ($_REQUEST['port_id'], $_REQUEST['name'], $_REQUEST['port_type_id'], $_REQUEST['label'], $_REQUEST['l2address'], $port_rc);
        if ($error != '')
-               return buildRedirectURL ('ERR2', array ($error));
+               return buildRedirectURL (__FUNCTION__, 'ERR2', array ($error));
        else
-               return buildRedirectURL ('OK', array ($_REQUEST['name']));
+               return buildRedirectURL (__FUNCTION__, 'OK', array ($_REQUEST['name']));
 }
 
 function delPortFromObject ()
@@ -199,9 +199,9 @@ function delPortFromObject ()
        $error = delObjectPort ($_REQUEST['port_id']);
 
        if ($error != '')
-               return buildRedirectURL ('ERR', array ($error));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($error));
        else
-               return buildRedirectURL ('OK', array ($_REQUEST['port_name']));
+               return buildRedirectURL (__FUNCTION__, 'OK', array ($_REQUEST['port_name']));
 }
 
 function linkPortForObject ()
@@ -214,9 +214,9 @@ function linkPortForObject ()
 
        $error = linkPorts ($_REQUEST['port_id'], $_REQUEST['remote_port_id']);
        if ($error != '')
-               return buildRedirectURL ('ERR', array ($error));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($error));
        else
-               return buildRedirectURL ('OK', array ($_REQUEST['port_name'], $_REQUEST['remote_port_name'], $_REQUEST['remote_object_name']));
+               return buildRedirectURL (__FUNCTION__, 'OK', array ($_REQUEST['port_name'], $_REQUEST['remote_port_name'], $_REQUEST['remote_object_name']));
 }
 
 function unlinkPortForObject ()
@@ -228,9 +228,9 @@ function unlinkPortForObject ()
 
        $error = unlinkPort ($_REQUEST['port_id']);
        if ($error != '')
-               return buildRedirectURL ('ERR', array ($error));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($error));
        else
-               return buildRedirectURL ('OK', array ($_REQUEST['port_name'], $_REQUEST['remote_port_name'], $_REQUEST['remote_object_name']));
+               return buildRedirectURL (__FUNCTION__, 'OK', array ($_REQUEST['port_name'], $_REQUEST['remote_port_name'], $_REQUEST['remote_object_name']));
 }
 
 function addMultiPorts ()
@@ -315,7 +315,7 @@ http://www.cisco.com/en/US/products/hw/routers/ps274/products_tech_note09186a008
                                );
                                break;
                        default:
-                               return buildRedirectURL ('ERR');
+                               return buildRedirectURL (__FUNCTION__, 'ERR');
                                break;
                }
        }
@@ -341,7 +341,7 @@ http://www.cisco.com/en/US/products/hw/routers/ps274/products_tech_note09186a008
                                $error_count++;
                }
        }
-       return buildRedirectURL ('OK', array ($added_count, $updated_count, $error_count));
+       return buildRedirectURL (__FUNCTION__, 'OK', array ($added_count, $updated_count, $error_count));
 }
 
 function updIPv4Allocation ()
@@ -353,9 +353,9 @@ function updIPv4Allocation ()
 
        $error = updateBond ($_REQUEST['ip'], $_REQUEST['object_id'], $_REQUEST['bond_name'], $_REQUEST['bond_type']);
        if ($error != '')
-               return buildRedirectURL ('ERR', array ($error));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($error));
        else
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
 }
 
 function delIPv4Allocation ()
@@ -365,9 +365,9 @@ function delIPv4Allocation ()
 
        $error = unbindIpFromObject ($_REQUEST['ip'], $_REQUEST['object_id']);
        if ($error != '')
-               return buildRedirectURL ('ERR', array ($error));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($error));
        else
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
 }
 
 function addIPv4Allocation ()
@@ -380,11 +380,11 @@ function addIPv4Allocation ()
        // Strip masklen.
        $ip = ereg_replace ('/[[:digit:]]+$', '', $_REQUEST['ip']);
        if  (getConfigVar ('IPV4_JAYWALK') != 'yes' and NULL === getIPv4AddressNetworkId ($ip))
-               return buildRedirectURL ('ERR1', array ($ip));
+               return buildRedirectURL (__FUNCTION__, 'ERR1', array ($ip));
        
        $error = bindIpToObject ($ip, $_REQUEST['object_id'], $_REQUEST['bond_name'], $_REQUEST['bond_type']);
        if ($error != '')
-               return buildRedirectURL ('ERR2', array ($error));
+               return buildRedirectURL (__FUNCTION__, 'ERR2', array ($error));
        $address = getIPv4Address ($ip);
        if ($address['reserved'] == 'yes' or !empty ($address['name']))
        {
@@ -395,7 +395,7 @@ function addIPv4Allocation ()
                        $address['name'] = '';
                updateAddress ($ip, $address['name'], $address['reserved']);
        }
-       return buildRedirectURL ('OK');
+       return buildRedirectURL (__FUNCTION__, 'OK');
 }
 
 function addIPv4Prefix ()
@@ -407,9 +407,9 @@ function addIPv4Prefix ()
        $taglist = isset ($_REQUEST['taglist']) ? $_REQUEST['taglist'] : array();
        $error = createIPv4Prefix ($_REQUEST['range'], $_REQUEST['name'], $is_bcast == 'on', $taglist);
        if ($error != '')
-               return buildRedirectURL ('ERR', array ($error));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($error));
        else
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
 }
 
 function delIPv4Prefix ()
@@ -417,9 +417,9 @@ function delIPv4Prefix ()
        assertUIntArg ('id', __FUNCTION__);
        $error = destroyIPv4Prefix ($_REQUEST['id']);
        if ($error != '')
-               return buildRedirectURL ('ERR', array ($error));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($error));
        else
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
 }
 
 function updIPv4Prefix ()
@@ -429,9 +429,9 @@ function updIPv4Prefix ()
 
        $error = updateRange ($_REQUEST['id'], $_REQUEST['name']);
        if ($error != '')
-               return buildRedirectURL ('ERR', array ($error));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($error));
        else
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
 }
 
 function editAddress ()
@@ -445,9 +445,9 @@ function editAddress ()
                $reserved = 'off';
        $error = updateAddress ($_REQUEST['ip'], $_REQUEST['name'], $reserved == 'on' ? 'yes' : 'no');
        if ($error != '')
-               return buildRedirectURL ('ERR', array ($error));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($error));
        else
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
 }
 
 function createUser ()
@@ -459,9 +459,9 @@ function createUser ()
        $password = hash (PASSWORD_HASH, $_REQUEST['password']);
        $result = commitCreateUserAccount ($username, $_REQUEST['realname'], $password);
        if ($result == TRUE)
-               return buildRedirectURL ('OK', array ($username));
+               return buildRedirectURL (__FUNCTION__, 'OK', array ($username));
        else
-               return buildRedirectURL ('ERR', array ($username));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($username));
 }
 
 function updateUser ()
@@ -474,35 +474,35 @@ function updateUser ()
        $new_password = $_REQUEST['password'];
        $old_hash = getHashByID ($_REQUEST['user_id']);
        if ($old_hash == NULL)
-               return buildRedirectURL ('ERR1');
+               return buildRedirectURL (__FUNCTION__, 'ERR1');
        // Update user password only if provided password is not the same as current password hash.
        if ($new_password != $old_hash)
                $new_password = hash (PASSWORD_HASH, $new_password);
        $result = commitUpdateUserAccount ($_REQUEST['user_id'], $username, $_REQUEST['realname'], $new_password);
        if ($result == TRUE)
-               return buildRedirectURL ('OK', array ($username));
+               return buildRedirectURL (__FUNCTION__, 'OK', array ($username));
        else
-               return buildRedirectURL ('ERR2', array ($username));
+               return buildRedirectURL (__FUNCTION__, 'ERR2', array ($username));
 }
 
 function enableUser ()
 {
        assertUIntArg ('user_id', __FUNCTION__);
        if (commitEnableUserAccount ($_REQUEST['user_id'], 'yes') == TRUE)
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
        else
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
 }
 
 function disableUser ()
 {
        assertUIntArg ('user_id', __FUNCTION__);
        if ($_REQUEST['user_id'] == 1)
-               return buildRedirectURL ('ERR1');
+               return buildRedirectURL (__FUNCTION__, 'ERR1');
        if (commitEnableUserAccount ($_REQUEST['user_id'], 'no'))
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
        else
-               return buildRedirectURL ('ERR2');
+               return buildRedirectURL (__FUNCTION__, 'ERR2');
 }
 
 // This function find differences in users's submit and PortCompat table
@@ -546,9 +546,9 @@ function savePortMap ()
                                                break;
                                }
        if ($error_count == 0)
-               return buildRedirectURL ('OK', array ($error_count, $success_count));
+               return buildRedirectURL (__FUNCTION__, 'OK', array ($error_count, $success_count));
        else
-               return buildRedirectURL ('ERR', array ($error_count, $success_count));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($error_count, $success_count));
 }
 
 function updateDictionary ()
@@ -557,9 +557,9 @@ function updateDictionary ()
        assertUIntArg ('dict_key', __FUNCTION__);
        assertStringArg ('dict_value', __FUNCTION__);
        if (commitUpdateDictionary ($_REQUEST['chapter_no'], $_REQUEST['dict_key'], $_REQUEST['dict_value']) === TRUE)
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
        else
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
 }
 
 function supplementDictionary ()
@@ -567,9 +567,9 @@ function supplementDictionary ()
        assertUIntArg ('chapter_no', __FUNCTION__);
        assertStringArg ('dict_value', __FUNCTION__);
        if (commitSupplementDictionary ($_REQUEST['chapter_no'], $_REQUEST['dict_value']) === TRUE)
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
        else
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
 }
 
 function reduceDictionary ()
@@ -577,18 +577,18 @@ function reduceDictionary ()
        assertUIntArg ('chapter_no', __FUNCTION__);
        assertUIntArg ('dict_key', __FUNCTION__);
        if (commitReduceDictionary ($_REQUEST['chapter_no'], $_REQUEST['dict_key']) === TRUE)
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
        else
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
 }
 
 function addChapter ()
 {
        assertStringArg ('chapter_name', __FUNCTION__);
        if (commitAddChapter ($_REQUEST['chapter_name']) === TRUE)
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
        else
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
 }
 
 function updateChapter ()
@@ -596,18 +596,18 @@ function updateChapter ()
        assertUIntArg ('chapter_no', __FUNCTION__);
        assertStringArg ('chapter_name', __FUNCTION__);
        if (commitUpdateChapter ($_REQUEST['chapter_no'], $_REQUEST['chapter_name']) === TRUE)
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
        else
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
 }
 
 function delChapter ()
 {
        assertUIntArg ('chapter_no', __FUNCTION__);
        if (commitDeleteChapter ($_REQUEST['chapter_no']))
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
        else
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
 }
 
 function changeAttribute ()
@@ -615,9 +615,9 @@ function changeAttribute ()
        assertUIntArg ('attr_id', __FUNCTION__);
        assertStringArg ('attr_name', __FUNCTION__);
        if (commitUpdateAttribute ($_REQUEST['attr_id'], $_REQUEST['attr_name']))
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
        else
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
 }
 
 function createAttribute ()
@@ -625,18 +625,18 @@ function createAttribute ()
        assertStringArg ('attr_name', __FUNCTION__);
        assertStringArg ('attr_type', __FUNCTION__);
        if (commitAddAttribute ($_REQUEST['attr_name'], $_REQUEST['attr_type']))
-               return buildRedirectURL ('OK', array ($_REQUEST['attr_name']));
+               return buildRedirectURL (__FUNCTION__, 'OK', array ($_REQUEST['attr_name']));
        else
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
 }
 
 function deleteAttribute ()
 {
        assertUIntArg ('attr_id', __FUNCTION__);
        if (commitDeleteAttribute ($_REQUEST['attr_id']))
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
        else
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
 }
 
 function supplementAttrMap ()
@@ -645,9 +645,9 @@ function supplementAttrMap ()
        assertUIntArg ('objtype_id', __FUNCTION__);
        assertUIntArg ('chapter_no', __FUNCTION__);
        if (commitSupplementAttrMap ($_REQUEST['attr_id'], $_REQUEST['objtype_id'], $_REQUEST['chapter_no']) === TRUE)
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
        else
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
 }
 
 function reduceAttrMap ()
@@ -655,9 +655,9 @@ function reduceAttrMap ()
        assertUIntArg ('attr_id', __FUNCTION__);
        assertUIntArg ('objtype_id', __FUNCTION__);
        if (commitReduceAttrMap ($_REQUEST['attr_id'], $_REQUEST['objtype_id']) === TRUE)
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
        else
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
 }
 
 function clearSticker ()
@@ -665,9 +665,9 @@ function clearSticker ()
        assertUIntArg ('attr_id', __FUNCTION__);
        assertUIntArg ('object_id', __FUNCTION__);
        if (commitResetAttrValue ($_REQUEST['object_id'], $_REQUEST['attr_id']) === TRUE)
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
        else
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
 }
 
 function updateObject ()
@@ -694,7 +694,7 @@ function updateObject ()
                $_REQUEST['object_asset_no'],
                $_REQUEST['object_comment']
        ) !== TRUE)
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
 
        // Update optional attributes
        $oldvalues = getAttrValues ($_REQUEST['object_id']);
@@ -736,13 +736,13 @@ function updateObject ()
                $result[] = commitUpdateAttrValue ($_REQUEST['object_id'], $attr_id, $value);
        }
        if (in_array (FALSE, $result))
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
 
        // Invalidate thumb cache of all racks objects could occupy.
        foreach (getResidentRacksData ($_REQUEST['object_id'], FALSE) as $rack_id)
                resetThumbCache ($rack_id);
 
-       return buildRedirectURL ('OK');
+       return buildRedirectURL (__FUNCTION__, 'OK');
 }
 
 function deleteObject ()
@@ -751,18 +751,18 @@ function deleteObject ()
        $error = commitDeleteObject ($_REQUEST['object_id']);
 
        if ($error != '')
-               return buildRedirectURL ('ERR', array ($error));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($error));
 
-       return buildRedirectURL ('OK', array ($_REQUEST['name']));
+       return buildRedirectURL (__FUNCTION__, 'OK', array ($_REQUEST['name']));
 }
 
 function useupPort ()
 {
        assertUIntArg ('port_id', __FUNCTION__);
        if (commitUseupPort ($_REQUEST['port_id']) === TRUE)
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
        else
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
 }
 
 function updateUI ()
@@ -788,9 +788,9 @@ function updateUI ()
        }
 
        if ($error != '')
-               return buildRedirectURL ('ERR', array ($error));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($error));
 
-       return buildRedirectURL ('OK');
+       return buildRedirectURL (__FUNCTION__, 'OK');
 }
 
 function resetUIConfig()
@@ -825,7 +825,7 @@ function resetUIConfig()
        setConfigVar ('IPV4_JAYWALK', 'no');
        setConfigVar ('ADDNEW_AT_TOP', 'yes');
        setConfigVar ('IPV4_TREE_SHOW_USAGE', 'yes');
-       return buildRedirectURL ('OK');
+       return buildRedirectURL (__FUNCTION__, 'OK');
 }
 
 // Add single record.
@@ -842,9 +842,9 @@ function addRealServer ()
                getConfigVar ('DEFAULT_IPV4_RS_INSERVICE'),
                $_REQUEST['rsconfig']
        ))
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
        else
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
 }
 
 // Parse textarea submitted and try adding a real server for each line.
@@ -897,14 +897,14 @@ function addRealServers ()
                                        $nbad++;
                                break;
                        default:
-                               return buildRedirectURL ('ERR1');
+                               return buildRedirectURL (__FUNCTION__, 'ERR1');
                                break;
                }
        }
        if ($nbad == 0 and $ngood > 0)
-               return buildRedirectURL ('OK', array ($ngood));
+               return buildRedirectURL (__FUNCTION__, 'OK', array ($ngood));
        else
-               return buildRedirectURL ('ERR2', array ($ngood, $nbad));
+               return buildRedirectURL (__FUNCTION__, 'ERR2', array ($ngood, $nbad));
 }
 
 function addVService ()
@@ -913,7 +913,7 @@ function addVService ()
        assertUIntArg ('vport', __FUNCTION__);
        assertStringArg ('proto', __FUNCTION__);
        if ($_REQUEST['proto'] != 'TCP' and $_REQUEST['proto'] != 'UDP')
-               return buildRedirectURL ('ERR1');
+               return buildRedirectURL (__FUNCTION__, 'ERR1');
        assertStringArg ('name', __FUNCTION__, TRUE);
        assertStringArg ('vsconfig', __FUNCTION__, TRUE);
        assertStringArg ('rsconfig', __FUNCTION__, TRUE);
@@ -928,18 +928,18 @@ function addVService ()
                isset ($_REQUEST['taglist']) ? $_REQUEST['taglist'] : array()
        );
        if ($error != '')
-               return buildRedirectURL ('ERR2', array ($error));
+               return buildRedirectURL (__FUNCTION__, 'ERR2', array ($error));
        else
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
 }
 
 function deleteRealServer ()
 {
        assertUIntArg ('id', __FUNCTION__);
        if (!commitDeleteRS ($_REQUEST['id']))
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
        else
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
 }
 
 function deleteLoadBalancer ()
@@ -952,18 +952,18 @@ function deleteLoadBalancer ()
                $_REQUEST['pool_id'],
                $_REQUEST['vs_id']
        ))
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
        else
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
 }
 
 function deleteVService ()
 {
        assertUIntArg ('vs_id', __FUNCTION__);
        if (!commitDeleteVS ($_REQUEST['vs_id']))
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
        else
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
 }
 
 function updateRealServer ()
@@ -978,9 +978,9 @@ function updateRealServer ()
                $_REQUEST['rsport'],
                $_REQUEST['rsconfig']
        ))
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
        else
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
 }
 
 function updateLoadBalancer ()
@@ -997,9 +997,9 @@ function updateLoadBalancer ()
                $_REQUEST['vsconfig'],
                $_REQUEST['rsconfig']
        ))
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
        else
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
 }
 
 function updateVService ()
@@ -1020,9 +1020,9 @@ function updateVService ()
                $_REQUEST['vsconfig'],
                $_REQUEST['rsconfig']
        ))
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
        else
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
 }
 
 function addLoadBalancer ()
@@ -1039,9 +1039,9 @@ function addLoadBalancer ()
                $_REQUEST['vsconfig'],
                $_REQUEST['rsconfig']
        ))
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
        else
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
 }
 
 function addRSPool ()
@@ -1057,18 +1057,18 @@ function addRSPool ()
                isset ($_REQUEST['taglist']) ? $_REQUEST['taglist'] : array()
        );
        if ($error != '')
-               return buildRedirectURL ('ERR', array ($error));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($error));
        else
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
 }
 
 function deleteRSPool ()
 {
        assertUIntArg ('pool_id', __FUNCTION__);
        if (!commitDeleteRSPool ($_REQUEST['pool_id']))
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
        else
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
 }
 
 function updateRSPool ()
@@ -1078,9 +1078,9 @@ function updateRSPool ()
        assertStringArg ('vsconfig', __FUNCTION__, TRUE);
        assertStringArg ('rsconfig', __FUNCTION__, TRUE);
        if (!commitUpdateRSPool ($_REQUEST['pool_id'], $_REQUEST['name'], $_REQUEST['vsconfig'], $_REQUEST['rsconfig']))
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
        else
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
 }
 
 function updateRSInService ()
@@ -1105,9 +1105,9 @@ function updateRSInService ()
                }
        }
        if (!$nbad)
-               return buildRedirectURL ('OK', array ($ngood));
+               return buildRedirectURL (__FUNCTION__, 'OK', array ($ngood));
        else
-               return buildRedirectURL ('ERR', array ($nbad, $ngood));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($nbad, $ngood));
 }
 
 // FIXME: check, that each submitted address belongs to the prefix we
@@ -1134,9 +1134,9 @@ function importPTRData ()
                        $nbad++;
        }
        if (!$nbad)
-               return buildRedirectURL ('OK', array ($ngood));
+               return buildRedirectURL (__FUNCTION__, 'OK', array ($ngood));
        else
-               return buildRedirectURL ('ERR', array ($nbad, $ngood));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($nbad, $ngood));
 }
 
 function generateAutoPorts ()
@@ -1146,9 +1146,9 @@ function generateAutoPorts ()
        $info = getObjectInfo ($_REQUEST['object_id']);
        // Navigate away in case of success, stay at the place otherwise.
        if (executeAutoPorts ($_REQUEST['object_id'], $info['objtype_id']))
-               return buildRedirectURL ('OK', array(), $pageno, 'ports');
+               return buildRedirectURL (__FUNCTION__, 'OK', array(), $pageno, 'ports');
        else
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
 }
 
 // Filter out implicit tags before storing the new tag set.
@@ -1186,18 +1186,18 @@ function saveEntityTags ()
                else
                        $n_errors++;
        if ($n_errors)
-               return buildRedirectURL ('ERR', array ($n_succeeds, $n_errors));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($n_succeeds, $n_errors));
        else
-               return buildRedirectURL ('OK', array ($n_succeeds));
+               return buildRedirectURL (__FUNCTION__, 'OK', array ($n_succeeds));
 }
 
 function destroyTag ()
 {
        assertUIntArg ('tag_id', __FUNCTION__);
        if (($ret = commitDestroyTag ($_REQUEST['tag_id'])) == '')
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
        else
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
 }
 
 function createTag ()
@@ -1206,15 +1206,15 @@ function createTag ()
        assertUIntArg ('parent_id', __FUNCTION__, TRUE);
        $tagname = trim ($_REQUEST['tag_name']);
        if (!validTagName ($tagname))
-               return buildRedirectURL ('ERR1', array ($tagname));
+               return buildRedirectURL (__FUNCTION__, 'ERR1', array ($tagname));
        if (tagExistsInDatabase ($tagname))
-               return buildRedirectURL ('ERR2', array ($tagname));
+               return buildRedirectURL (__FUNCTION__, 'ERR2', array ($tagname));
        if (($parent_id = $_REQUEST['parent_id']) <= 0)
                $parent_id = 'NULL';
        if (($ret = commitCreateTag ($tagname, $parent_id)) == '')
-               return buildRedirectURL ('OK', array ($tagname));
+               return buildRedirectURL (__FUNCTION__, 'OK', array ($tagname));
        else
-               return buildRedirectURL ('ERR3', array ($tagname, $ret));
+               return buildRedirectURL (__FUNCTION__, 'ERR3', array ($tagname, $ret));
 }
 
 function updateTag ()
@@ -1224,13 +1224,13 @@ function updateTag ()
        assertStringArg ('tag_name', __FUNCTION__);
        $tagname = trim ($_REQUEST['tag_name']);
        if (!validTagName ($tagname))
-               return buildRedirectURL ('ERR1', array ($tagname));
+               return buildRedirectURL (__FUNCTION__, 'ERR1', array ($tagname));
        if (($parent_id = $_REQUEST['parent_id']) <= 0)
                $parent_id = 'NULL';
        if (($ret = commitUpdateTag ($_REQUEST['tag_id'], $tagname, $parent_id)) == '')
-               return buildRedirectURL ('OK', array ($tagname));
+               return buildRedirectURL (__FUNCTION__, 'OK', array ($tagname));
        else
-               return buildRedirectURL ('ERR2', array ($tagname, $ret));
+               return buildRedirectURL (__FUNCTION__, 'ERR2', array ($tagname, $ret));
 }
 
 function rollTags ()
@@ -1239,7 +1239,7 @@ function rollTags ()
        assertStringArg ('sum', __FUNCTION__, TRUE);
        assertUIntArg ('realsum', __FUNCTION__);
        if ($_REQUEST['sum'] != $_REQUEST['realsum'])
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
        // Even if the user requested an empty tag list, don't bail out, but process existing
        // tag chains with "zero" extra. This will make sure, that the stuff processed will
        // have its chains refined to "normal" form.
@@ -1256,25 +1256,25 @@ function rollTags ()
                        if (rebuildTagChainForEntity ('object', $object_id, $extrachain))
                                $n_ok++;
        }
-       return buildRedirectURL ('OK', array ($n_ok));
+       return buildRedirectURL (__FUNCTION__, 'OK', array ($n_ok));
 }
 
 function changeMyPassword ()
 {
        global $accounts, $remote_username;
        if (getConfigVar ('USER_AUTH_SRC') != 'database')
-               return buildRedirectURL ('ERR1');
+               return buildRedirectURL (__FUNCTION__, 'ERR1');
        assertStringArg ('oldpassword', __FUNCTION__);
        assertStringArg ('newpassword1', __FUNCTION__);
        assertStringArg ('newpassword2', __FUNCTION__);
        if ($accounts[$remote_username]['user_password_hash'] != hash (PASSWORD_HASH, $_REQUEST['oldpassword']))
-               return buildRedirectURL ('ERR2');
+               return buildRedirectURL (__FUNCTION__, 'ERR2');
        if ($_REQUEST['newpassword1'] != $_REQUEST['newpassword2'])
-               return buildRedirectURL ('ERR3');
+               return buildRedirectURL (__FUNCTION__, 'ERR3');
        if (commitUpdateUserAccount ($accounts[$remote_username]['user_id'], $accounts[$remote_username]['user_name'], $accounts[$remote_username]['user_realname'], hash (PASSWORD_HASH, $_REQUEST['newpassword1'])))
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
        else
-               return buildRedirectURL ('ERR4');
+               return buildRedirectURL (__FUNCTION__, 'ERR4');
 }
 
 function saveRackCode ()
@@ -1284,12 +1284,12 @@ function saveRackCode ()
        $newcode = str_replace ('\r', '', str_replace ('\n', "\n", $_REQUEST['rackcode']));
        $parseTree = getRackCode ($newcode);
        if ($parseTree['result'] != 'ACK')
-               return buildRedirectURL ('ERR1', array ($parseTree['load']));
+               return buildRedirectURL (__FUNCTION__, 'ERR1', array ($parseTree['load']));
        saveScript ('RackCodeCache', '');
        if (saveScript ('RackCode', $newcode))
-               return buildRedirectURL ('OK');
+               return buildRedirectURL (__FUNCTION__, 'OK');
        else
-               return buildRedirectURL ('ERR2');
+               return buildRedirectURL (__FUNCTION__, 'ERR2');
 }
 
 // This handler's context is pre-built, but not authorized. It is assumed, that the
@@ -1300,7 +1300,7 @@ function setPortVLAN ()
        assertUIntArg ('portcount', __FUNCTION__);
        $data = getSwitchVLANs ($_REQUEST['object_id']);
        if ($data === NULL)
-               return buildRedirectURL ('ERR1');
+               return buildRedirectURL (__FUNCTION__, 'ERR1');
        list ($vlanlist, $portlist) = $data;
        // Here we just build up 1 set command for the gateway with all of the ports
        // included. The gateway is expected to filter unnecessary changes silently
@@ -1362,9 +1362,9 @@ function addRow ()
        assertStringArg ('name', __FUNCTION__);
 
        if (commitSupplementDictionary (3, $_REQUEST['name']) === TRUE)
-               return buildRedirectURL ('OK', array ($_REQUEST['name']));
+               return buildRedirectURL (__FUNCTION__, 'OK', array ($_REQUEST['name']));
        else
-               return buildRedirectURL ('ERR', array ($_REQUEST['name']));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($_REQUEST['name']));
 }
 
 function updateRow ()
@@ -1373,9 +1373,9 @@ function updateRow ()
        assertStringArg ('name', __FUNCTION__);
 
        if (TRUE === commitUpdateDictionary (3, $_REQUEST['row_id'], $_REQUEST['name']))
-               return buildRedirectURL ('OK', array ($_REQUEST['name']));
+               return buildRedirectURL (__FUNCTION__, 'OK', array ($_REQUEST['name']));
        else
-               return buildRedirectURL ('ERR', array ($_REQUEST['name']));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($_REQUEST['name']));
 }
 
 function addRack ()
@@ -1389,9 +1389,9 @@ function addRack ()
                assertStringArg ('rack_comment', __FUNCTION__, TRUE);
 
                if (commitAddRack ($_REQUEST['rack_name'], $_REQUEST['rack_height1'], $_REQUEST['row_id'], $_REQUEST['rack_comment'], $taglist) === TRUE)
-                       return buildRedirectURL ('OK', array ($_REQUEST['rack_name']));
+                       return buildRedirectURL (__FUNCTION__, 'OK', array ($_REQUEST['rack_name']));
                else
-                       return buildRedirectURL ('ERR1', array ($_REQUEST['rack_name']));
+                       return buildRedirectURL (__FUNCTION__, 'ERR1', array ($_REQUEST['rack_name']));
        }
        elseif (isset ($_REQUEST['got_mdata']))
        {
@@ -1412,13 +1412,13 @@ function addRack ()
                }
                foreach ($names2 as $cname)
                        if (commitAddRack ($cname, $_REQUEST['rack_height2'], $_REQUEST['row_id'], '', $taglist) === TRUE)
-                               $log['m'][] = array ('c' => getMessageCode ('OK'), 'a' => array ($cname));
+                               $log['m'][] = array ('c' => getMessageCode (__FUNCTION__, 'OK'), 'a' => array ($cname));
                        else
-                               $log['m'][] = array ('c' => getMessageCode ('ERR1'), 'a' => array ($cname));
+                               $log['m'][] = array ('c' => getMessageCode (__FUNCTION__, 'ERR1'), 'a' => array ($cname));
                return buildWideRedirectURL ($log);
        }
        else
-               return buildRedirectURL ('ERR2');
+               return buildRedirectURL (__FUNCTION__, 'ERR2');
 }
 
 function updateRack ()
@@ -1431,9 +1431,9 @@ function updateRack ()
 
        resetThumbCache ($_REQUEST['rack_id']);
        if (TRUE === commitUpdateRack ($_REQUEST['rack_id'], $_REQUEST['rack_name'], $_REQUEST['rack_height'], $_REQUEST['rack_row_id'], $_REQUEST['rack_comment']))
-               return buildRedirectURL ('OK', array ($_REQUEST['rack_name']));
+               return buildRedirectURL (__FUNCTION__, 'OK', array ($_REQUEST['rack_name']));
        else
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
 }
 
 function querySNMPData ()
@@ -1450,15 +1450,15 @@ function addFileWithoutLink ()
 
        // Make sure the file can be uploaded
        if (get_cfg_var('file_uploads') != 1)
-               return buildRedirectURL ('ERR', array ("file uploads not allowed, change 'file_uploads' parameter in php.ini"));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ("file uploads not allowed, change 'file_uploads' parameter in php.ini"));
 
        $fp = fopen($_FILES['file']['tmp_name'], 'rb');
        $error = commitAddFile ($_FILES['file']['name'], $_FILES['file']['type'], $_FILES['file']['size'], $fp, $_REQUEST['comment']);
 
        if ($error != '')
-               return buildRedirectURL ('ERR', array ($error));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($error));
 
-       return buildRedirectURL ('OK', array ($_FILES['file']['name']));
+       return buildRedirectURL (__FUNCTION__, 'OK', array ($_FILES['file']['name']));
 }
 
 function addFileToEntity ()
@@ -1467,23 +1467,23 @@ function addFileToEntity ()
        assertUIntArg ('entity_id', __FUNCTION__);
        assertStringArg ('comment', __FUNCTION__, TRUE);
        if (empty ($_REQUEST['entity_type']) || empty ($_REQUEST['entity_id']))
-               return buildRedirectURL ('ERR');
+               return buildRedirectURL (__FUNCTION__, 'ERR');
 
        // Make sure the file can be uploaded
        if (get_cfg_var('file_uploads') != 1)
-               return buildRedirectURL ('ERR', array ("file uploads not allowed, change 'file_uploads' parameter in php.ini"));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ("file uploads not allowed, change 'file_uploads' parameter in php.ini"));
 
        $fp = fopen($_FILES['file']['tmp_name'], 'rb');
        $error = commitAddFile ($_FILES['file']['name'], $_FILES['file']['type'], $_FILES['file']['size'], $fp, $_REQUEST['comment']);
        if ($error != '')
-               return buildRedirectURL ('ERR', array ($error));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($error));
 
        $file_id = lastInsertID();
        $error = commitLinkFile ($file_id, $_REQUEST['entity_type'], $_REQUEST['entity_id']);   
        if ($error != '')
-               return buildRedirectURL ('ERR', array ($error));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($error));
 
-       return buildRedirectURL ('OK', array ($_FILES['file']['name']));
+       return buildRedirectURL (__FUNCTION__, 'OK', array ($_FILES['file']['name']));
 }
 
 function linkFileToEntity ()
@@ -1505,12 +1505,12 @@ function linkFileToEntity ()
 
        $fi = getFileInfo ($_REQUEST['file_id']);
        if ($fi === NULL)
-               return buildRedirectURL ('ERR1'); // file not found
+               return buildRedirectURL (__FUNCTION__, 'ERR1'); // file not found
        $error = commitLinkFile ($_REQUEST['file_id'], $entity_type, $_REQUEST[$bypass_name]);
        if ($error != '')
-               return buildRedirectURL ('ERR2', array ($error)); // linking failed
+               return buildRedirectURL (__FUNCTION__, 'ERR2', array ($error)); // linking failed
 
-       return buildRedirectURL ('OK', array ($fi['name']));
+       return buildRedirectURL (__FUNCTION__, 'OK', array ($fi['name']));
 }
 
 function updateFile ()
@@ -1520,9 +1520,9 @@ function updateFile ()
        assertStringArg ('comment', __FUNCTION__, TRUE);
        $error = commitUpdateFile ($_REQUEST['file_id'], $_REQUEST['comment']);
        if ($error != '')
-               return buildRedirectURL ('ERR', array ($error));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($error));
 
-       return buildRedirectURL ('OK', array ($_REQUEST['name']));
+       return buildRedirectURL (__FUNCTION__, 'OK', array ($_REQUEST['name']));
 }
 
 function unlinkFile ()
@@ -1531,9 +1531,9 @@ function unlinkFile ()
        $error = commitUnlinkFile ($_REQUEST['link_id']);
 
        if ($error != '')
-               return buildRedirectURL ('ERR', array ($error));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($error));
 
-       return buildRedirectURL ('OK', array ($_REQUEST['name']));
+       return buildRedirectURL (__FUNCTION__, 'OK', array ($_REQUEST['name']));
 }
 
 function deleteFile ()
@@ -1542,9 +1542,9 @@ function deleteFile ()
        $error = commitDeleteFile ($_REQUEST['file_id']);
 
        if ($error != '')
-               return buildRedirectURL ('ERR', array ($error));
+               return buildRedirectURL (__FUNCTION__, 'ERR', array ($error));
 
-       return buildRedirectURL ('OK', array ($_REQUEST['name']));
+       return buildRedirectURL (__FUNCTION__, 'OK', array ($_REQUEST['name']));
 }
 
 ?>