diff options
author | Renato Botelho <garga@FreeBSD.org> | 2014-07-24 17:46:30 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-07-24 18:28:01 -0300 |
commit | 46cbc96e0943cad0c39b1ca26a5ec818352f7692 (patch) | |
tree | 02a15e98e09a10e86ba1ac019307685f0491e5d3 /usr/local/www/wizards | |
parent | 3ab6aff78dd0bd18c34a04dd8ac37ce121c8882b (diff) | |
download | pfsense-46cbc96e0943cad0c39b1ca26a5ec818352f7692.zip pfsense-46cbc96e0943cad0c39b1ca26a5ec818352f7692.tar.gz |
Try to guess number of WANs
Diffstat (limited to 'usr/local/www/wizards')
-rw-r--r-- | usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc | 20 | ||||
-rwxr-xr-x | usr/local/www/wizards/traffic_shaper_wizard_dedicated.xml | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc index 6e22f4f..edf046a 100644 --- a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc +++ b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc @@ -30,6 +30,26 @@ POSSIBILITY OF SUCH DAMAGE. */ +function step1_stepbeforeformdisplay() { + global $stepid, $savemsg, $pkg; + + $fields =& $pkg['step'][0]['fields']['field']; + + $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++; + } + + foreach ($fields as &$field) + if ($field['name'] == 'numberofconnections') + $field['value'] = $wans; +} + function step1_submitphpaction() { global $stepid, $savemsg; diff --git a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.xml b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.xml index 9298a8c..eccdc83 100755 --- a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.xml +++ b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.xml @@ -57,6 +57,7 @@ <type>submit</type> </field> </fields> + <stepbeforeformdisplay>step1_stepbeforeformdisplay();</stepbeforeformdisplay> <stepsubmitphpaction>step1_submitphpaction();</stepsubmitphpaction> <includefile>/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc</includefile> </step> |