diff options
Diffstat (limited to 'usr/local/www/wizards/traffic_shaper_wizard.inc')
-rw-r--r-- | usr/local/www/wizards/traffic_shaper_wizard.inc | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/usr/local/www/wizards/traffic_shaper_wizard.inc b/usr/local/www/wizards/traffic_shaper_wizard.inc index 31da91a..b684fb6 100644 --- a/usr/local/www/wizards/traffic_shaper_wizard.inc +++ b/usr/local/www/wizards/traffic_shaper_wizard.inc @@ -223,7 +223,7 @@ function step2_stepsubmitphpaction() { /* Input Validation */ $steps = intval($config['ezshaper']['step1']['numberofconnections']); for ($i = 0; $i < $steps; $i++) { - for ($j = $i + 1; $j < $steps; $j++) { + for ($j = $i + 1; $j <= $steps; $j++) { $wannum = $i+1; if ($_POST["conn{$i}interface"] == $_POST["conn{$j}interface"]) { $savemsg=gettext("You cannot select the same interface for WAN# {$wannum} and WAN #{$j}."); @@ -436,6 +436,9 @@ function step3_stepsubmitphpaction() { global $config; global $stepid, $savemsg; + if (!$_POST['enable']) + return; + if($_POST['address']) { if(!is_ipaddroralias($_POST['address'])) { /* item is not an ip or alias. error out */ @@ -447,24 +450,22 @@ function step3_stepsubmitphpaction() { $steps = intval($config['ezshaper']['step1']['numberofconnections']); for ($i = 0; $i < $steps; $i++) { - if ($_POST["conn{$i}upload"]) { - if (!is_numeric($_POST["conn{$i}upload"])) { - $wannum = $i + 1; - $savemsg = gettext("Upload bandwidth of WAN #{$wannum} is not valid."); - $stepid--; - return; - } - $factor = wizard_get_bandwidthtype_scale($config['ezshaper']['step2']["conn{$i}uploadspeed"]); - $ifbw = $factor * floatval($config['ezshaper']['step2']["conn{$i}upload"]); - $factor = wizard_get_bandwidthtype_scale($_POST["conn{$i}uploadspeed"]); - $input_bw = $factor * floatval($_POST["conn{$i}upload"]); - if ((0.8 * $ifbw) < $input_bw) { - $friendly_interface = $i+1; - $savemsg=gettext("You cannot set the VoIP upload bandwidth on WAN #{$friendly_interface} higher than 80% of the connection."); - $stepid--; - return; - } + if (!is_numeric($_POST["conn{$i}upload"])) { + $wannum = $i + 1; + $savemsg = gettext("Upload bandwidth of WAN #{$wannum} is not valid."); + $stepid--; + return; } + $factor = wizard_get_bandwidthtype_scale($config['ezshaper']['step2']["conn{$i}uploadspeed"]); + $ifbw = $factor * floatval($config['ezshaper']['step2']["conn{$i}upload"]); + $factor = wizard_get_bandwidthtype_scale($_POST["conn{$i}uploadspeed"]); + $input_bw = $factor * floatval($_POST["conn{$i}upload"]); + if ((0.8 * $ifbw) < $input_bw) { + $friendly_interface = $i+1; + $savemsg=gettext("You cannot set the VoIP upload bandwidth on WAN #{$friendly_interface} higher than 80% of the connection."); + $stepid--; + return; + } } $config['ezshaper']['step3']['download'] = $_POST['download']; @@ -515,7 +516,7 @@ function step5_stepsubmitphpaction() { global $stepid, $savemsg; if ( $_POST['enable'] ) { - if (isset($_POST['bandwidth']) && $_POST['bandwidth'] <> "") { + if ($_POST['p2pcatchall']) { if(!is_numeric($_POST['bandwidth'])) { $savemsg="Posted value is not a valid bandwidth."; $stepid--; |