diff options
Diffstat (limited to 'usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc')
-rwxr-xr-x | usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc | 41 |
1 files changed, 14 insertions, 27 deletions
diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc index f129244..2703c3e 100755 --- a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc +++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc @@ -329,8 +329,6 @@ function step2_stepsubmitphpaction() { $config['ezshaper']['step2']["conn${i}interface"] = $_POST["conn{$i}interface"]; } - /* Not needed, called by wizard.php */ -// write_config(); } function step3_stepbeforeformdisplay() { @@ -530,10 +528,6 @@ function step3_stepsubmitphpaction() { $config['ezshaper']['step3']["conn{$i}upload"] = $_POST["conn{$i}upload"]; $config['ezshaper']['step3']["conn{$i}uploadspeed"] = $_POST["conn{$i}uploadspeed"]; } - - /* Not needed, called by wizard.php */ - //write_config(); - } function step4_stepsubmitphpaction() { @@ -550,7 +544,7 @@ function step4_stepsubmitphpaction() { header("Location: wizard.php?xml=traffic_shaper_wizard_multi_all.xml&stepid=3&message={$message}"); exit; } -/* + if (wizard_get_bwunit($_POST['bandwidth']) <> "%") { $message = gettext("Only percentage bandwidth specification is allowed."); header("Location: wizard.php?xml=traffic_shaper_wizard_multi_all.xml&stepid=3&message={$message}"); @@ -561,8 +555,7 @@ function step4_stepsubmitphpaction() { $message="Values should be between 2% and 15%!"; header("Location: wizard.php?xml=traffic_shaper_wizard_multi_all.xml&stepid=3&message={$message}"); exit; - } -*/ + } if($_POST['address'] <> "" && !is_ipaddr($_POST['address'])) { if(!is_alias($_POST['address'])) { @@ -576,27 +569,23 @@ function step4_stepsubmitphpaction() { } function step5_stepsubmitphpaction() { - if ( $_POST['enable'] ) { if (isset($_POST['bandwidth']) && $_POST['bandwidth'] <> "") { if(!is_numeric($_POST['bandwidth'])) { $message="Posted value is not a valid bandwidth."; header("Location: wizard.php?xml=traffic_shaper_wizard_multi_all.xml&stepid=4&message={$message}"); - } -/* if (wizard_get_bwunit($_POST['bandwidth']) <> "%") { $message = gettext("Only percentage bandwidth specification is allowed."); header("Location: wizard.php?xml=traffic_shaper_wizard_multi_all.xml&stepid=4&message={$message}"); exit; } - $bw = wizard_get_bw($_POST['bandwidth']); - if($bw > 15 && $bw < 2) { - $message="Values should be between 2% and 15%!"; - header("Location: wizard.php?xml=traffic_shaper_wizard_multi_all.xml&stepid=3&message={$message}"); - exit; - } -*/ + $bw = wizard_get_bw($_POST['bandwidth']); + if($bw > 15 && $bw < 2) { + $message="Values should be between 2% and 15%!"; + header("Location: wizard.php?xml=traffic_shaper_wizard_multi_all.xml&stepid=3&message={$message}"); + exit; + } } } } @@ -1058,17 +1047,16 @@ $othersplist = array(); } else { $otherpriority = false; } - //echo "<br/>" .$remainbw . " <br/>"; + $remainbw = round($remainbw / $upbw * 100, 2); - /*echo $remainbw; + if (intval($remainbw) > 0 && intval($remainbw) > 30) { $message=gettext("Custom Bandwidths are greater than 30%. Please lower them for the wizard to continue."); header("Location: wizard.php?xml=traffic_shaper_wizard_multi_all.xml&stepid=2&message={$message}"); exit; } else { - */ $remainbw = 100 - $remainbw; - //} + } if ($sched != "PRIQ") { if ($sched == "CBQ") @@ -1476,15 +1464,14 @@ $othersplist = array(); $otherpriority = false; } $remainbw = round($remainbw / $lanbw * 100, 2); - /*echo $remainbw; + if (intval($remainbw) > 0 && intval($remainbw) > 40) { $message=gettext("Custom Bandwidths are greater than 30%. Please lower them for the wizard to continue."); header("Location: wizard.php?xml=traffic_shaper_wizard_multi_all.xml&stepid=2&message={$message}"); exit; } else { - */ $remainbw = 100 - $remainbw; - //} + } if ($sched != "PRIQ") { if ($sched == "CBQ") @@ -1987,4 +1974,4 @@ function wizard_get_bandwidthtype_scale($type) { return intval($factor); } -?> +?>
\ No newline at end of file |