summaryrefslogtreecommitdiffstats
path: root/usr/local/www/wizards
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-07-24 17:43:11 -0300
committerRenato Botelho <garga@FreeBSD.org>2014-07-24 18:28:01 -0300
commit3ab6aff78dd0bd18c34a04dd8ac37ce121c8882b (patch)
tree776cc0df96204d3aad59cd020c943fee3406d738 /usr/local/www/wizards
parentdad05dac2324c9572d7617a9a320e0e62d4b359b (diff)
downloadpfsense-3ab6aff78dd0bd18c34a04dd8ac37ce121c8882b.zip
pfsense-3ab6aff78dd0bd18c34a04dd8ac37ce121c8882b.tar.gz
Try to guess number of WANs and LANs
Diffstat (limited to 'usr/local/www/wizards')
-rw-r--r--usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc26
-rwxr-xr-xusr/local/www/wizards/traffic_shaper_wizard_multi_all.xml1
2 files changed, 27 insertions, 0 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 aa801ef..a650e50 100644
--- a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
+++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
@@ -30,6 +30,32 @@
POSSIBILITY OF SUCH DAMAGE.
*/
+function step1_stepbeforeformdisplay() {
+ global $stepid, $savemsg, $pkg;
+
+ $fields =& $pkg['step'][0]['fields']['field'];
+
+ $lans = 0;
+ $wans = 0;
+
+ $iflisttmp = get_configured_interface_with_descr();
+ foreach ($iflisttmp as $if => $ifdesc) {
+ if (!is_altq_capable(get_real_interface($if)))
+ continue;
+ if (interface_has_gateway($if) || interface_has_gatewayv6($if))
+ $wans++;
+ else
+ $lans++;
+ }
+
+ foreach ($fields as &$field) {
+ if ($field['name'] == 'numberofconnections')
+ $field['value'] = $wans;
+ else if ($field['name'] == 'numberoflocalinterfaces')
+ $field['value'] = $lans;
+ }
+}
+
function step1_submitphpaction() {
global $stepid, $savemsg;
diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.xml b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.xml
index 8400980..1a18f61 100755
--- a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.xml
+++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.xml
@@ -65,6 +65,7 @@
<type>submit</type>
</field>
</fields>
+ <stepbeforeformdisplay>step1_stepbeforeformdisplay();</stepbeforeformdisplay>
<stepsubmitphpaction>step1_submitphpaction();</stepsubmitphpaction>
<includefile>/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc</includefile>
</step>
OpenPOWER on IntegriCloud