diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-11-07 18:34:11 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-11-07 18:34:11 +0000 |
commit | 255ad1dcc5efed4a7ed088622cb08ad9e09c3651 (patch) | |
tree | d69ea3cfeb4ab25a300d838952bc845c74fc0077 /usr/local | |
parent | 5c1fd1d911ae89ca47d2ab2370ba177a17688dfb (diff) | |
download | pfsense-255ad1dcc5efed4a7ed088622cb08ad9e09c3651.zip pfsense-255ad1dcc5efed4a7ed088622cb08ad9e09c3651.tar.gz |
MFC 7444 7445
Keep track of the number of items the user has requested to shape. If at the end of the wizard the count is still 0 then unset the shaper configuration and alert the user that they have not picked anything to shape
Ticket #642
Diffstat (limited to 'usr/local')
-rw-r--r-- | usr/local/www/wizards/traffic_shaper_wizard.xml | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/usr/local/www/wizards/traffic_shaper_wizard.xml b/usr/local/www/wizards/traffic_shaper_wizard.xml index a7af95e..b10abb3 100644 --- a/usr/local/www/wizards/traffic_shaper_wizard.xml +++ b/usr/local/www/wizards/traffic_shaper_wizard.xml @@ -54,14 +54,8 @@ /* wipe previous */ unset($config['shaper']['queue']); unset($config['shaper']['rule']); - /* XXX: billm - this is breaking things :) */ - /* - * unset($config['interfaces']['wan']['bandwidth']); - * unset($config['interfaces']['wan']['bandwidthtype']); - * unset($config['interfaces']['lan']['bandwidth']); - * unset($config['interfaces']['lan']['bandwidthtype']); - */ $config['shaper']['enable'] = FALSE; + $config['shaper']['itemsshaped'] = "0"; </stepsubmitphpaction> </step> <step> @@ -478,6 +472,7 @@ foreach ($voiplist as $voip) { foreach (array('source', 'destination') as $srcdest) { $rule = array(); + $config['shaper']['itemsshaped']++; if ($srcdest == 'source') { $destsrc = 'destination'; $rule['outqueue'] = 'qVOIPUp'; @@ -724,6 +719,7 @@ foreach ($p2plist as $p2pclient) { foreach (array('source', 'destination') as $srcdest) { $rule = array(); + $config['shaper']['itemsshaped']++; if ($srcdest == 'source') { $destsrc = 'destination'; $rule['outqueue'] = 'qP2PUp'; @@ -1102,6 +1098,7 @@ foreach ($gamesplist as $Gameclient) { foreach (array('source', 'destination') as $srcdest) { $rule = array(); + $config['shaper']['itemsshaped']++; if ($srcdest == 'source') { $destsrc = 'destination'; $rule['outqueue'] = 'qGamesUp'; @@ -1865,6 +1862,7 @@ foreach ($othersplist as $otherclient) { foreach (array('source', 'destination') as $srcdest) { $rule = array(); + $config['shaper']['itemsshaped']++; if ($srcdest == 'source') { $destsrc = 'destination'; $rule['outqueue'] = 'qOthersUp' . $otherclient[5]; /* posted value H or L */ @@ -1912,6 +1910,22 @@ <type>submit</type> </field> </fields> + <stepbeforeformdisplay> + if($config['shaper']['itemsshaped'] == "0") { + /* no shaper items have been selected + * wipe previous + */ + unset($config['shaper']['queue']); + unset($config['shaper']['rule']); + $config['shaper']['enable'] = FALSE; + $config['shaper']['itemsshaped'] = "0"; + $message = "No items have been selected to shape. Exiting traffic shaper wizard."; + write_config("No shaper items picked, unsetting shaper configuration"); + header("Location: /wizard.php?xml=traffic_shaper_wizard.xml&stepid=8&message={$message}"); + filter_configure(); + exit; + } + </stepbeforeformdisplay> <stepsubmitphpaction> $config['shaper']['enable'] = TRUE; filter_configure_sync(); |