From 62460d788333528a5b6e80e6c87301b25aeac257 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 27 Aug 2005 03:43:47 +0000 Subject: Correctly handle new interfaces selection when its an array. Ticket #412 --- packages/ntop/ntop.xml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'packages') diff --git a/packages/ntop/ntop.xml b/packages/ntop/ntop.xml index 267dc4b0..a398a4f8 100644 --- a/packages/ntop/ntop.xml +++ b/packages/ntop/ntop.xml @@ -51,8 +51,10 @@ Interface - iface + interface_array lan + true + 3 interfaces_selection @@ -64,16 +66,18 @@ global $input_errors; $ntop_config =& $_POST; $if_final = ""; + $ifaces_final = ""; if($ntop_config['password'] and $ntop_config['passwordagain']) { if($ntop_config['password'] == $ntop_config['passwordagain']) { - $ifaces = $ntop_config['iface']; - $lan = $config['interfaces']['lan']['if']; - $if_final .= convert_friendly_interface_to_real_interface_name($if); - if(!$if_final) { - $if_final = $lan; - } + foreach($_POST['interface_array'] as $iface) { + $if = convert_friendly_interface_to_real_interface_name($iface); + echo $if; + if($if) { + $ifaces_final .= $if . " "; + } + } exec("/usr/local/bin/ntop --set-admin-password=" . $_POST['password'] . " &", $ntopout); - $start = "/usr/local/bin/ntop -i " . $if_final . " -u root -d --ipv4 -M -x 8102 -X 8192 &"; + $start = "/usr/local/bin/ntop -i " . $ifaces_final . " -u root -d --ipv4 -M -x 8102 -X 8192 &"; write_rcfile(array( "file" => "ntop.sh", "start" => $start, -- cgit v1.2.3