summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-12-29 16:52:17 +0000
committerErmal <eri@pfsense.org>2010-12-29 16:52:17 +0000
commitef6f09b345f77f3b4b9f23468ba0cd497eb145c4 (patch)
tree6fc0239a716b99e1c000c57ce188fa11348f9b72
parent7a5ccfa739875482aa486a7d8887b3ee3357f32c (diff)
downloadpfsense-ef6f09b345f77f3b4b9f23468ba0cd497eb145c4.zip
pfsense-ef6f09b345f77f3b4b9f23468ba0cd497eb145c4.tar.gz
Fix multi_all wizard to properly verify VoIP bandwidth specified.
-rwxr-xr-xusr/local/www/wizards/traffic_shaper_wizard_multi_all.inc24
1 files changed, 13 insertions, 11 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 931185a..42f6ddb 100755
--- a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
+++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
@@ -39,7 +39,7 @@ function step1_submitphpaction() {
$stepid--;
return;
}
- if (intval($_POST['numberofconnections']) < 1) {
+ if (intval($_POST['numberoflocalinterfaces']) < 1) {
$savemsg=gettext("The number of connections should be greater than 1.");
$stepid--;
return;
@@ -67,7 +67,7 @@ function step2_stepbeforeformdisplay() {
}
$numberoflocalinterfaces = intval($config['ezshaper']['step1']['numberoflocalinterfaces']);
- if ($numberoflocalinterfaces > $numberofinterfaces) {
+ if ($numberoflocalinterfaces > ($numberofinterfaces - $numberofconnections)) {
$savemsg=gettext("You have less interfaces than number of connections!");
$stepid--;
return;
@@ -527,19 +527,21 @@ function step3_stepsubmitphpaction() {
}
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.");
+ $savemsg=gettext("You cannot set the VoIP download 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;
+ for ($j = 0; $j < $steps; $j++) {
+ $factor = wizard_get_bandwidthtype_scale($config['ezshaper']['step2']["conn{$j}downloadspeed"]);
+ $ifbw = $factor * floatval($config['ezshaper']['step2']["conn{$j}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 {$j} higher than 80% of the connection.");
+ $stepid--;
+ return;
+ }
}
}
}
OpenPOWER on IntegriCloud