diff options
author | Ermal <eri@pfsense.org> | 2011-02-12 21:07:36 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2011-02-12 21:07:36 +0000 |
commit | bd259571878b65b324c52b5e1b414b0ec219d48a (patch) | |
tree | bde50bab234ec533659a9a9976b1b78cbf55b6b7 /usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc | |
parent | bd2b98c9b0800522919a69bfff519c0934f2bb8e (diff) | |
download | pfsense-bd259571878b65b324c52b5e1b414b0ec219d48a.zip pfsense-bd259571878b65b324c52b5e1b414b0ec219d48a.tar.gz |
Correctly verify the input on bandwith at voip step for traffic shaper wizards. Reported-by: http://forum.pfsense.org/index.php/topic,32833.0.html
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 | 34 |
1 files changed, 25 insertions, 9 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 f33283a..40f036d 100755 --- a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc +++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc @@ -495,10 +495,17 @@ function step3_stepsubmitphpaction() { $steps = intval($config['ezshaper']['step1']['numberofconnections']); for ($i = 0; $i < $steps; $i++) { if (!is_numeric($_POST["conn{$i}upload"])) { - $savemsg = gettext("Upload bandwidth of connection {$i} is not valid."); + $savemsg = gettext("Upload bandwidth of connection {$i} is not valid."); + $stepid--; + return; + } + if ($_POST["conn{$i}uploadspeed"] == "%") { + if (intval($_POST["conn{$i}upload"]) > 80) { + $savemsg=gettext("You cannot set the VoIP upload bandwidth on connection {$i} higher than 80% of the connection."); $stepid--; return; } + } else { $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"]); @@ -507,6 +514,7 @@ function step3_stepsubmitphpaction() { $savemsg=gettext("You cannot set the VoIP upload bandwidth on connection {$i} higher than 80% of the connection."); $stepid--; return; + } } } @@ -517,14 +525,22 @@ function step3_stepsubmitphpaction() { $stepid--; return; } - $factor = wizard_get_bandwidthtype_scale($config['ezshaper']['step2']["conn{$i}downloadspeed"]); - $ifbw = $factor * floatval($config['ezshaper']['step2']["conn{$i}download"]); - $factor = wizard_get_bandwidthtype_scale($_POST["local{$i}downloadspeed"]); - $input_bw = $factor * floatval($_POST["local{$i}download"]); - if ((0.8 * $ifbw) < $input_bw) { - $savemsg=gettext("You cannot set the VoIP download bandwidth on connection {$i} higher than 80% of the connection."); - $stepid--; - return; + if ($_POST["local{$i}downloadspeed"] == "%") { + if (intval($_POST["local{$i}download"]) > 80) { + $savemsg=gettext("You cannot set the VoIP upload bandwidth on connection {$i} higher than 80% of the connection."); + $stepid--; + return; + } + } else { + $factor = wizard_get_bandwidthtype_scale($config['ezshaper']['step2']["conn{$i}downloadspeed"]); + $ifbw = $factor * floatval($config['ezshaper']['step2']["conn{$i}download"]); + $factor = wizard_get_bandwidthtype_scale($_POST["local{$i}downloadspeed"]); + $input_bw = $factor * floatval($_POST["local{$i}download"]); + if ((0.8 * $ifbw) < $input_bw) { + $savemsg=gettext("You cannot set the VoIP download bandwidth on connection {$i} higher than 80% of the connection."); + $stepid--; + return; + } } } |