Revision 260a6901
Added by Renato Botelho almost 11 years ago
usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc | ||
---|---|---|
86 | 86 |
global $config, $pkg; |
87 | 87 |
global $stepid, $savemsg; |
88 | 88 |
|
89 |
$numberofinterfaces = 0; |
|
89 |
$wans = 0; |
|
90 |
$lans = 0; |
|
90 | 91 |
$iflist = array(); |
91 | 92 |
$iflisttmp = get_configured_interface_with_descr(); |
92 | 93 |
foreach ($iflisttmp as $if => $ifdesc) { |
93 | 94 |
if (!is_altq_capable(get_real_interface($if))) |
94 | 95 |
continue; |
95 |
$numberofinterfaces++; |
|
96 |
if (interface_has_gateway($if) || interface_has_gatewayv6($if)) |
|
97 |
$wans++; |
|
98 |
else |
|
99 |
$lans++; |
|
96 | 100 |
$iflist[$if] = $ifdesc; |
97 | 101 |
} |
98 | 102 |
$numberofconnections = intval($config['ezshaper']['step1']['numberofconnections']); |
99 |
if ($numberofconnections > $numberofinterfaces) {
|
|
103 |
if ($numberofconnections > $wans) {
|
|
100 | 104 |
$savemsg=gettext("You have less interfaces than number of connections!"); |
101 | 105 |
$stepid--; |
102 | 106 |
return; |
103 | 107 |
} |
104 | 108 |
|
105 | 109 |
$numberoflocalinterfaces = intval($config['ezshaper']['step1']['numberoflocalinterfaces']); |
106 |
if ($numberoflocalinterfaces > ($numberofinterfaces - $numberofconnections)) {
|
|
110 |
if ($numberoflocalinterfaces > $lans) {
|
|
107 | 111 |
$savemsg=gettext("You have less interfaces than number of connections!"); |
108 | 112 |
$stepid--; |
109 | 113 |
return; |
Also available in: Unified diff
Strict checks for number of WANs and LANs on wizard