diff options
author | Ermal Luçi <eri@pfsense.org> | 2008-06-21 14:04:01 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2008-06-21 14:04:01 +0000 |
commit | 3ad5e089000f5db09ca219750d8218457ea78773 (patch) | |
tree | 420c9420c6801ec8dd593f7fb3f5c2c79c77486d | |
parent | b6db92176273cdd9b1dfbf6b44b42e55a35ee7af (diff) | |
download | pfsense-3ad5e089000f5db09ca219750d8218457ea78773.zip pfsense-3ad5e089000f5db09ca219750d8218457ea78773.tar.gz |
Add support to return even the disabled interfaces if requested.
-rw-r--r-- | etc/inc/util.inc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc index d9da9d8..d14bd63 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -273,7 +273,7 @@ function is_valid_shaperbw($val) { } /* return the configured interfaces list. */ -function get_configured_interface_list($only_opt = false) { +function get_configured_interface_list($only_opt = false, $withdisabled = false) { global $config; $iflist = array(); @@ -282,7 +282,8 @@ function get_configured_interface_list($only_opt = false) { foreach($config['interfaces'] as $if => $ifdetail) { if ($only_opt == true && ($if == "wan" || $if == "lan")) continue; - if ($if == "wan" || $if == "lan" || isset($ifdetail['enable'])) + if ($if == "wan" || $if == "lan" || isset($ifdetail['enable']) || + $withdisabled == true) $iflist[$if] = $if; } @@ -291,7 +292,7 @@ function get_configured_interface_list($only_opt = false) { } /* return the configured interfaces list with their description. */ -function get_configured_interface_with_descr($only_opt = false) { +function get_configured_interface_with_descr($only_opt = false, $withdisabled = false) { global $config; $iflist = array(); @@ -300,10 +301,12 @@ function get_configured_interface_with_descr($only_opt = false) { foreach($config['interfaces'] as $if => $ifdetail) { if ($only_opt == true && ($if == "wan" || $if == "lan")) continue; - if ($if == "wan" || $if == "lan" || isset($ifdetail['enable'])) { + if ($if == "wan" || $if == "lan" || isset($ifdetail['enable']) || + $withdisabled == true) { if($ifdetail['descr'] == "") - $ifdetail['descr'] = $if; - $iflist[$if] = $ifdetail['descr']; + $iflist[$if] = $if; + else + $iflist[$if] = $ifdetail['descr']; } } |