From 1fbc9fd6a9b5934e5c87e2deaefdbd3e308eb110 Mon Sep 17 00:00:00 2001 From: Denis Ovsienko Date: Tue, 1 Jul 2008 18:07:56 +0000 Subject: [PATCH] r2021 + fix IPv4 address bypass arg handling + add "release" button to properties tab --- inc/interface.php | 23 +++++++++++++++-------- inc/navigation.php | 2 ++ index.php | 3 +++ 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/inc/interface.php b/inc/interface.php index b247c685..6a1914c1 100644 --- a/inc/interface.php +++ b/inc/interface.php @@ -2176,10 +2176,9 @@ function renderIPRangeProperties ($id) } -function renderIPAddress () +function renderIPAddress ($ip) { global $root; - $ip = $_REQUEST['ip']; $address = getIPAddress ($ip); echo ""; echo "\n"; @@ -2300,13 +2299,13 @@ function renderIPAddress () echo "

${ip}

\n"; } -function renderIPAddressProperties () +function renderIPAddressProperties ($ip) { - global $pageno, $tabno; - $ip = $_REQUEST['ip']; + global $pageno, $tabno, $root; showMessageOrError(); $address = getIPAddress($ip); echo "

$ip

\n"; + startPortlet ('update'); echo "\n"; echo ""; echo "\n"; @@ -2316,13 +2315,21 @@ function renderIPAddressProperties () echo ""; echo ""; echo "
Reserved:
\n"; - + finishPortlet(); + if (empty ($address['name']) and $address['reserved'] == 'no') + return; + startPortlet ('release'); + echo "
"; + echo ""; + echo ""; + echo ""; + echo "
"; + finishPortlet(); } -function renderIPAddressAssignment () +function renderIPAddressAssignment ($ip) { global $pageno, $tabno, $root; - $ip = $_REQUEST['ip']; $address = getIPAddress($ip); showMessageOrError(); diff --git a/inc/navigation.php b/inc/navigation.php index f73acd65..b20f6987 100644 --- a/inc/navigation.php +++ b/inc/navigation.php @@ -163,6 +163,7 @@ $ophandler['iprange']['tags']['saveTags'] = 'saveIPv4PrefixTags'; $page['ipaddress']['title_handler'] = 'dynamic_title_ipaddress'; $page['ipaddress']['parent'] = 'iprange'; $page['ipaddress']['bypass'] = 'ip'; +$page['ipaddress']['bypass_type'] = 'inet4'; $page['ipaddress']['autotagloader'] = 'loadIPv4AddressAutoTags'; $tab['ipaddress']['default'] = 'Browse'; $tab['ipaddress']['properties'] = 'Properties'; @@ -171,6 +172,7 @@ $tab['ipaddress']['editrslist'] = '[SLB real servers]'; $tabhandler['ipaddress']['default'] = 'renderIPAddress'; $tabhandler['ipaddress']['properties'] = 'renderIPAddressProperties'; $tabhandler['ipaddress']['assignment'] = 'renderIPAddressAssignment'; +$tabhandler['ipaddress']['editrslist'] = 'dragon'; $ophandler['ipaddress']['properties']['editAddress'] = 'editAddress'; $ophandler['ipaddress']['assignment']['delIPv4Allocation'] = 'delIPv4Allocation'; $ophandler['ipaddress']['assignment']['updIPv4Allocation'] = 'updIPv4Allocation'; diff --git a/index.php b/index.php index 5f79edd5..424c0ad6 100644 --- a/index.php +++ b/index.php @@ -88,6 +88,9 @@ if (isset ($tabhandler[$pageno][$tabno])) case 'uint0': assertUIntArg ($page[$pageno]['bypass'], 'index', TRUE); break; + case 'inet4': + assertIPv4Arg ($page[$pageno]['bypass'], 'index'); + break; default: showError ("Dispatching error for bypass parameter"); break; -- 2.17.1