summaryrefslogtreecommitdiffstats
path: root/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2011-01-24 16:54:25 +0000
committerErmal <eri@pfsense.org>2011-01-24 16:54:25 +0000
commit49946455240beb65061922e7e4920cec409111fc (patch)
treef5713f6a0979e6436c61437122bd7c1db1cd30b7 /usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc
parent8d9c3f7610953e4519ec578e61961c22d3fe4404 (diff)
downloadpfsense-49946455240beb65061922e7e4920cec409111fc.zip
pfsense-49946455240beb65061922e7e4920cec409111fc.tar.gz
Do proper input validation on traffic shaper wizards to not allow empty fiedls.
Diffstat (limited to 'usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc')
-rw-r--r--usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc33
1 files changed, 17 insertions, 16 deletions
diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc b/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc
index 731d327..a5de47e 100644
--- a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc
+++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc
@@ -284,6 +284,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 */
@@ -295,22 +298,20 @@ function step3_stepsubmitphpaction() {
$steps = intval($config['ezshaper']['step1']['numberofconnections']);
for ($i = 0; $i < $steps; $i++) {
- if ($_POST["connupload"]) {
- if (!is_numeric($_POST["connupload"])) {
- $savemsg = gettext("Upload bandwidth of connection {$i} 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) {
- $savemsg=gettext("You cannot set the VoIP upload bandwidth on connection {$i} higher than 80% of the connection.");
- $stepid--;
- return;
- }
+ if (!is_numeric($_POST["connupload"])) {
+ $savemsg = gettext("Upload bandwidth of connection {$i} 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) {
+ $savemsg=gettext("You cannot set the VoIP upload bandwidth on connection {$i} higher than 80% of the connection.");
+ $stepid--;
+ return;
+ }
}
}
@@ -357,7 +358,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--;
OpenPOWER on IntegriCloud