r2045 + change object-portfwrd to object-nat4
authorDenis Ovsienko <infrastation@yandex.ru>
Mon, 7 Jul 2008 17:05:53 +0000 (17:05 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Mon, 7 Jul 2008 17:05:53 +0000 (17:05 +0000)
+ change object-network to object-ipv4
+ add missing 'root' reference to generated URLs where necessary

inc/functions.php
inc/interface.php
inc/navigation.php
upgrade.php

index ec8ac123b48fc04ceeeeb5e1741623c5e08b657b..24ebf72161a68b9af20fb66b6c1029bdcd336040 100644 (file)
@@ -1495,6 +1495,8 @@ function fixContext ()
        $tmap['objects']['newobj'] = 'addmore';
        $tmap['object']['switchvlans'] = 'livevlans';
        $tmap['object']['slb'] = 'editrspvs';
+       $tmap['object']['portfwrd'] = 'nat4';
+       $tmap['object']['network'] = 'ipv4';
        if (isset ($pmap[$pageno]))
                redirectUser ($pmap[$pageno], $tabno);
        if (isset ($tmap[$pageno][$tabno]))
index 422e02b98494236ceb1e57a9e668b0d226e6da9e..af1f2ac6225c88cc4c115adaeedcf205419dcfa0 100644 (file)
@@ -768,7 +768,7 @@ function renderRackObject ($object_id = 0)
        {
                startPortlet ('IPv4 addresses');
                echo "<table cellspacing=0 cellpadding='5' align='center' class='widetable'>\n";
-               echo "<tr><th>Interface name</th><th>IP Address</th><th>Description</th><th>Misc</th></tr>\n";
+               echo "<tr><th>OS interface</th><th>IP address</th><th>description</th><th>misc</th></tr>\n";
                $hl_ipv4_addr = '';
                if (isset ($_REQUEST['hl_ipv4_addr']))
                {
@@ -1114,7 +1114,7 @@ function renderPortsForObject ($object_id = 0)
        finishPortlet();
 }
 
-function renderNetworkForObject ($object_id=0)
+function renderIPv4ForObject ($object_id = 0)
 {
        global $root, $pageno, $tabno;
        if ($object_id <= 0)
@@ -1123,11 +1123,11 @@ function renderNetworkForObject ($object_id=0)
                return;
        }
        showMessageOrError();
-       startPortlet ('Network Addresses');
+       startPortlet ('Allocations');
        $addresses = getObjectAddresses ($object_id);
        usort($addresses, 'sortAddresses');
        echo "<table cellspacing=0 cellpadding='5' align='center' class='widetable'>\n";
-       echo "<tr><th>&nbsp;</th><th>Interface name</th><th>IP Address</th><th>Description</th><th>Type</th><th>Misc</th><th>&nbsp</th></tr>\n";
+       echo "<tr><th>&nbsp;</th><th>OS interface</th><th>IP address</th><th>description</th><th>type</th><th>misc</th><th>&nbsp</th></tr>\n";
        foreach ($addresses as $addr)
        {
                if (strlen($addr['address_name'])>40)
@@ -1149,13 +1149,13 @@ function renderNetworkForObject ($object_id=0)
                else 
                        $class='';
 
-               echo "<form action='process.php'>";
+               echo "<form action='${root}process.php'>";
                echo "<input type=hidden name=page value='${pageno}'>\n";
                echo "<input type=hidden name=tab value='${tabno}'>\n";
                echo "<input type=hidden name=op value=updIPv4Allocation>";
                echo "<input type=hidden name=object_id value='$object_id'>";
                echo "<input type=hidden name=ip value='${addr['ip']}'>";
-               echo "<tr class='$class'><td><a href='process.php?op=delIPv4Allocation&page=${pageno}&tab=${tabno}&ip=${addr['ip']}&object_id=$object_id'>";
+               echo "<tr class='$class'><td><a href='${root}process.php?op=delIPv4Allocation&page=${pageno}&tab=${tabno}&ip=${addr['ip']}&object_id=$object_id'>";
                printImageHREF ('delete', 'Delete this IPv4 address');
                echo "</a></td>";
                echo "<td class=tdleft><input type='text' name='bond_name' value='${addr['name']}' size=10></td>";
@@ -1872,7 +1872,7 @@ function renderAddNewRange ()
        startPortlet ("Add New");
        echo "<table class='widetable' border=0 cellpadding=10 align='center'>\n";
        echo "<tr><th>Address range</th><th>Name</th><th>connected network</th><th>assign tags</th><th>&nbsp;</th></tr>\n";
-       echo "<form name='add_new_range' action='process.php'>\n";
+       echo "<form name='add_new_range' action='${root}process.php'>\n";
        echo "<input type=hidden name=op value=addIPv4Prefix>\n";
        echo "<input type=hidden name=page value='${pageno}'>\n";
        echo "<input type=hidden name=tab value='${tabno}'>\n";
@@ -1899,7 +1899,7 @@ function renderAddNewRange ()
                echo "<tr><td>";
                if ($usedips == 0)
                {
-                       echo "<a href='process.php?op=delIPv4Prefix&page=${pageno}&tab=${tabno}&id=${iprange['id']}'>";
+                       echo "<a href='${root}process.php?op=delIPv4Prefix&page=${pageno}&tab=${tabno}&id=${iprange['id']}'>";
                        printImageHREF ('delete', 'Delete this IP range');
                        echo "</a>";
                }
@@ -2125,12 +2125,12 @@ function renderIPRange ($id)
 
 function renderIPRangeProperties ($id)
 {
-       global $pageno, $tabno;
+       global $root, $pageno, $tabno;
        showMessageOrError();
        $range = getIPRange($id);
        echo "<center><h1>${range['ip']}/${range['mask']}</h1></center>\n";
        echo "<table border=0 cellpadding=10 cellpadding=1 align='center'>\n";
-       echo "<form action='process.php'><input type=hidden name=op value=editRange>";
+       echo "<form action='${root}process.php'><input type=hidden name=op value=editRange>";
        echo "<input type=hidden name=page value='${pageno}'>\n";
        echo "<input type=hidden name=tab value='${tabno}'>\n";
        echo "<input type=hidden name=id value='${id}'>";
@@ -2270,7 +2270,7 @@ function renderIPAddressProperties ($ip)
        echo "<center><h1>$ip</h1></center>\n";
        startPortlet ('update');
        echo "<table border=0 cellpadding=10 cellpadding=1 align='center'>\n";
-       echo "<form action='process.php'><input type=hidden name=op value=editAddress>";
+       echo "<form action='${root}process.php'><input type=hidden name=op value=editAddress>";
        echo "<input type=hidden name=page value='${pageno}'>\n";
        echo "<input type=hidden name=tab value='${tabno}'>\n";
        echo "<input type=hidden name=ip value='${ip}'>";
@@ -2320,13 +2320,13 @@ function renderIPAddressAssignment ($ip)
                echo "<tr class='$class'><td colspan='5'><b>RESERVED</b></td></tr>";
        foreach ($address['bonds'] as $bond)
        {
-               echo "<tr class='$class'><form action='process.php'>";
+               echo "<tr class='$class'><form action='${root}process.php'>";
                echo "<input type=hidden name=op value='updIPv4Allocation'>";
                echo "<input type=hidden name=page value='${pageno}'>";
                echo "<input type=hidden name=tab value='${tabno}'>";
                echo "<input type=hidden name=ip value='$ip'>";
                echo "<input type=hidden name=object_id value='${bond['object_id']}'>";
-               echo "<td><a href='process.php?op=delIPv4Allocation&page=${pageno}&tab=${tabno}&ip=$ip&object_id=${bond['object_id']}'>";
+               echo "<td><a href='${root}process.php?op=delIPv4Allocation&page=${pageno}&tab=${tabno}&ip=$ip&object_id=${bond['object_id']}'>";
                printImageHREF ('delete', 'Unallocate address');
                echo "</a></td>";
                echo "<td><a href='${root}?page=object&object_id=${bond['object_id']}&hl_ipv4_addr=${ip}'>${bond['object_name']}</td>";
@@ -2354,7 +2354,7 @@ function renderIPAddressAssignment ($ip)
                printImageHREF ('save', 'Save changes', TRUE);
                echo "</td></form></tr>\n";
        }
-       echo "<form action='process.php'><input type='hidden' name='op' value='addIPv4Allocation'>";
+       echo "<form action='${root}process.php'><input type='hidden' name='op' value='addIPv4Allocation'>";
        echo "<input type=hidden name=page value='${pageno}'>\n";
        echo "<input type=hidden name=tab value='${tabno}'>\n";
        echo "<input type='hidden' name='ip' value='$ip'>";
@@ -2399,7 +2399,7 @@ function renderNATv4ForObject ($object_id = 0)
                        }
 
                echo "<tr class='$class'>";
-               echo "<td><a href='process.php?op=delPortForwarding&localip=${pf['localip']}&localport=${pf['localport']}&remoteip=${pf['remoteip']}&remoteport=${pf['remoteport']}&proto=${pf['proto']}&object_id=$object_id&page=${pageno}&tab=${tabno}'>";
+               echo "<td><a href='${root}process.php?op=delNATv4Rule&localip=${pf['localip']}&localport=${pf['localport']}&remoteip=${pf['remoteip']}&remoteport=${pf['remoteport']}&proto=${pf['proto']}&object_id=$object_id&page=${pageno}&tab=${tabno}'>";
                printImageHREF ('delete', 'Delete NAT rule');
                echo "</a></td>";
                echo "<td>${pf['proto']}/${name}: <a href='${root}?page=ipaddress&tab=default&ip=${pf['localip']}'>${pf['localip']}</a>:${pf['localport']}";
@@ -2416,7 +2416,7 @@ function renderNATv4ForObject ($object_id = 0)
                                echo "<a href='${root}?page=object&tab=default&object_id=${bond['object_id']}'>${bond['object_name']}(${bond['name']})</a> ";
                elseif (!empty ($pf['remote_addr_name']))
                        echo '(' . $pf['remote_addr_name'] . ')';
-               echo "</td><form action='process.php'><input type='hidden' name='op' value='updPortForwarding'><input type=hidden name=page value='${pageno}'>";
+               echo "</td><form action='${root}process.php'><input type=hidden name=op value=updNATv4Rule><input type=hidden name=page value='${pageno}'>";
                echo "<input type=hidden name=tab value='${tabno}'><input type='hidden' name='object_id' value='$object_id'>";
                echo "<input type='hidden' name='localip' value='${pf['localip']}'><input type='hidden' name='localport' value='${pf['localport']}'>";
                echo "<input type='hidden' name='remoteip' value='${pf['remoteip']}'><input type='hidden' name='remoteport' value='${pf['remoteport']}'>";
@@ -2425,7 +2425,7 @@ function renderNATv4ForObject ($object_id = 0)
                printImageHREF ('save', 'Save changes', TRUE);
                echo "</td></form></tr>";
        }
-       echo "<form action='process.php'><input type='hidden' name='op' value='forwardPorts'>";
+       echo "<form action='${root}process.php'><input type='hidden' name=op value=addNATv4Rule>";
        echo "<input type='hidden' name='object_id' value='$object_id'>";
        echo "<input type=hidden name=page value='${pageno}'>\n";
        echo "<input type=hidden name=tab value='${tabno}'>\n";
@@ -2456,7 +2456,7 @@ function renderNATv4ForObject ($object_id = 0)
 
        foreach ($forwards['in'] as $pf)
        {
-               echo "<tr><td><a href='process.php?op=delPortForwarding&localip=${pf['localip']}&localport=${pf['localport']}&remoteip=${pf['remoteip']}&remoteport=${pf['remoteport']}&proto=${pf['proto']}&object_id=${pf['object_id']}&page=${pageno}&tab=${tabno}'>";
+               echo "<tr><td><a href='${root}process.php?op=delNATv4Rule&localip=${pf['localip']}&localport=${pf['localport']}&remoteip=${pf['remoteip']}&remoteport=${pf['remoteport']}&proto=${pf['proto']}&object_id=${pf['object_id']}&page=${pageno}&tab=${tabno}'>";
                printImageHREF ('delete', 'Delete NAT rule');
                echo "</a></td>";
                echo "<td>${pf['proto']}/<a href='${root}?page=ipaddress&tab=default&ip=${pf['localip']}'>${pf['localip']}</a>:${pf['localport']}</td>";
index 4460afcbfb6690fa9bcd2c64446c046a37f559ee..05a9a6cf0da63b7cbdfa19f55887f6d8a9a75b8a 100644 (file)
@@ -79,8 +79,8 @@ $tab['object']['default'] = 'View';
 $tab['object']['edit'] = 'Properties';
 $tab['object']['rackspace'] = 'Rackspace';
 $tab['object']['ports'] = 'Ports';
-$tab['object']['network'] = 'IPv4';
-$tab['object']['portfwrd'] = 'NATv4';
+$tab['object']['ipv4'] = 'IPv4';
+$tab['object']['nat4'] = 'NATv4';
 $tab['object']['livevlans'] = 'Live VLANs';
 $tab['object']['snmpportfinder'] = 'SNMP port finder';
 $tab['object']['editrspvs'] = 'RS pools';
@@ -91,8 +91,8 @@ $tabhandler['object']['default'] = 'renderRackObject';
 $tabhandler['object']['edit'] = 'renderEditObjectForm';
 $tabhandler['object']['rackspace'] = 'renderRackSpaceForObject';
 $tabhandler['object']['ports'] = 'renderPortsForObject';
-$tabhandler['object']['network'] = 'renderNetworkForObject';
-$tabhandler['object']['portfwrd'] = 'renderNATv4ForObject';
+$tabhandler['object']['ipv4'] = 'renderIPv4ForObject';
+$tabhandler['object']['nat4'] = 'renderNATv4ForObject';
 $tabhandler['object']['livevlans'] = 'renderVLANMembership';
 $tabhandler['object']['snmpportfinder'] = 'renderSNMPPortFinder';
 $tabhandler['object']['lvsconfig'] = 'renderLVSConfig';
@@ -101,8 +101,8 @@ $tabhandler['object']['tags'] = 'renderObjectTags';
 $tabhandler['object']['editrspvs'] = 'renderObjectSLB';
 $tabextraclass['object']['snmpportfinder'] = 'attn';
 $tabextraclass['object']['autoports'] = 'attn';
-$trigger['object']['network'] = 'trigger_ipv4';
-$trigger['object']['portfwrd'] = 'trigger_natv4';
+$trigger['object']['ipv4'] = 'trigger_ipv4';
+$trigger['object']['nat4'] = 'trigger_natv4';
 $trigger['object']['livevlans'] = 'trigger_livevlans';
 $trigger['object']['snmpportfinder'] = 'trigger_snmpportfinder';
 $trigger['object']['editrspvs'] = 'trigger_natv4';
@@ -116,15 +116,15 @@ $ophandler['object']['ports']['linkPort'] = 'linkPortForObject';
 $ophandler['object']['ports']['unlinkPort'] = 'unlinkPortForObject';
 $ophandler['object']['ports']['addMultiPorts'] = 'addMultiPorts';
 $ophandler['object']['ports']['useup'] = 'useupPort';
-$ophandler['object']['network']['updIPv4Allocation'] = 'updIPv4Allocation';
-$ophandler['object']['network']['addIPv4Allocation'] = 'addIPv4Allocation';
-$ophandler['object']['network']['delIPv4Allocation'] = 'delIPv4Allocation';
+$ophandler['object']['ipv4']['updIPv4Allocation'] = 'updIPv4Allocation';
+$ophandler['object']['ipv4']['addIPv4Allocation'] = 'addIPv4Allocation';
+$ophandler['object']['ipv4']['delIPv4Allocation'] = 'delIPv4Allocation';
 $ophandler['object']['edit']['clearSticker'] = 'clearSticker';
 $ophandler['object']['edit']['updateStickers'] = 'updateStickers';
 $ophandler['object']['edit']['update'] = 'updateObject';
-$ophandler['object']['portfwrd']['forwardPorts'] = 'addPortForwarding';
-$ophandler['object']['portfwrd']['delPortForwarding'] = 'delPortForwarding';
-$ophandler['object']['portfwrd']['updPortForwarding'] = 'updPortForwarding';
+$ophandler['object']['nat4']['addNATv4Rule'] = 'addPortForwarding';
+$ophandler['object']['nat4']['delNATv4Rule'] = 'delPortForwarding';
+$ophandler['object']['nat4']['updNATv4Rule'] = 'updPortForwarding';
 $ophandler['object']['livevlans']['setPortVLAN'] = 'setPortVLAN';
 $ophandler['object']['autoports']['generate'] = 'generateAutoPorts';
 $ophandler['object']['tags']['saveTags'] = 'saveObjectTags';
index fb932db15a93b8bd3f5ee2d909cfb4c720a2ee6d..4ce5a3d0f5e638a4afdf8312d8e320765f3c8190 100644 (file)
@@ -1314,6 +1314,8 @@ CREATE TABLE `TagTree` (
                        $tmap['objects']['newobj'] = 'addmore';
                        $tmap['object']['switchvlans'] = 'livevlans';
                        $tmap['object']['slb'] = 'editrspvs';
+                       $tmap['object']['portfwrd'] = 'nat4';
+                       $tmap['object']['network'] = 'ipv4';
                        while ($row = $tr->fetch (PDO::FETCH_ASSOC))
                        {
                                // map, if appropriate