diff options
Diffstat (limited to 'usr/local/www')
-rw-r--r-- | usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc | 26 | ||||
-rwxr-xr-x | usr/local/www/wizards/traffic_shaper_wizard_multi_all.xml | 1 |
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> |