From c65e1e0da7df7b367ff97e89dad16f602571cecb Mon Sep 17 00:00:00 2001 From: Ermal Date: Mon, 13 Sep 2010 16:02:23 +0000 Subject: Ticket #876. Actually use the friendly name for the key of the array returned by return_gateways_array() so the dynamic gateway and status pages work correctly. --- etc/inc/gwlb.inc | 14 +++++++------- usr/local/www/system_gateways.php | 16 ++-------------- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 959b200..ea303e0 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -330,14 +330,14 @@ function return_gateways_array($disabled = false) { } /* retrieve a proper monitor IP? */ - $interface = $config['interfaces'][$ifname]; - if(is_ipaddr($interface['monitorip'])) { - $gateway['monitor'] = $interface['monitorip']; - } else { + $ifcfg =& $config['interfaces'][$ifname]; + if (is_ipaddr($ifcfg['monitorip'])) + $gateway['monitor'] = $ifcfg['monitorip']; + else $gateway['monitor'] = $gateway['gateway']; - } - $gateway['descr'] = "Interface $ifname Dynamic Gateway"; - $gateways_arr[$ifname] = $gateway; + + $gateway['descr'] = "Interface {$friendly} Dynamic Gateway"; + $gateways_arr[$friendly] = $gateway; } return($gateways_arr); diff --git a/usr/local/www/system_gateways.php b/usr/local/www/system_gateways.php index d789d76..0e3bc43 100755 --- a/usr/local/www/system_gateways.php +++ b/usr/local/www/system_gateways.php @@ -176,29 +176,17 @@ include("head.inc"); -- cgit v1.1