summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2009-03-09 01:37:19 +0000
committerErmal Luçi <eri@pfsense.org>2009-03-09 01:37:19 +0000
commit47c8b0369007eea4f78ea6c158e2ccd4a8839aea (patch)
tree389868a082048161236ce18dedcb67e153dbefa7
parenta20265255e0390345c972e406ff6e3da5c457f2b (diff)
downloadpfsense-47c8b0369007eea4f78ea6c158e2ccd4a8839aea.zip
pfsense-47c8b0369007eea4f78ea6c158e2ccd4a8839aea.tar.gz
Restore interface ordering to mimic 1.2
Requested-by: Scott
-rw-r--r--etc/inc/util.inc34
1 files changed, 25 insertions, 9 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index 3819d9c..41cc9de 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -283,17 +283,22 @@ function get_configured_interface_list($only_opt = false, $withdisabled = false)
$iflist = array();
+ if (!$only_opt) {
+ if (isset($config['interfaces']['wan']))
+ $iflist['wan'] = "wan";
+ if (isset($config['interfaces']['lan']))
+ $iflist['lan'] = "lan";
+ }
+
/* if list */
foreach($config['interfaces'] as $if => $ifdetail) {
- if ($only_opt == true && ($if == "wan" || $if == "lan"))
+ if ($if == "wan" || $if == "lan")
continue;
- if ($if == "wan" || $if == "lan" || isset($ifdetail['enable']) ||
- $withdisabled == true)
+ if (isset($ifdetail['enable']) || $withdisabled == true)
$iflist[$if] = $if;
}
return $iflist;
-
}
/* return the configured interfaces list with their description. */
@@ -302,12 +307,24 @@ function get_configured_interface_with_descr($only_opt = false, $withdisabled =
$iflist = array();
+ if (!$only_opt) {
+ if (isset($config['interfaces']['wan'])) {
+ if (empty($config['interfaces']['wan']['descr']))
+ $iflist['wan'] = "WAN";
+ else
+ $iflist['wan'] = $config['interfaces']['wan']['descr'];
+ }
+ if (isset($config['interfaces']['lan'])) {
+ if (empty($config['interfaces']['lan']['descr']))
+ $iflist['lan'] = "LAN";
+ else
+ $iflist['lan'] = $config['interfaces']['lan']['descr'];
+ }
+ }
+
/* if list */
foreach($config['interfaces'] as $if => $ifdetail) {
- if ($only_opt == true && ($if == "wan" || $if == "lan"))
- continue;
- if ($if == "wan" || $if == "lan" || isset($ifdetail['enable']) ||
- $withdisabled == true) {
+ if (isset($ifdetail['enable']) || $withdisabled == true) {
if($ifdetail['descr'] == "")
$iflist[$if] = strtoupper($if);
else
@@ -316,7 +333,6 @@ function get_configured_interface_with_descr($only_opt = false, $withdisabled =
}
return $iflist;
-
}
OpenPOWER on IntegriCloud