mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Resolves #175. Return description even for disabled interfaces. Teach the return_gateways_array() to return status for disabled interfaces if the caller requests it.
This commit is contained in:
parent
392cd413c1
commit
c795339e57
@ -225,13 +225,17 @@ function return_gateways_status() {
|
||||
return($status);
|
||||
}
|
||||
|
||||
function return_gateways_array() {
|
||||
function return_gateways_array($disabled = false) {
|
||||
global $config;
|
||||
|
||||
$gateways_arr = array();
|
||||
|
||||
/* Loop through all interfaces with a gateway and add it to a array */
|
||||
$iflist = get_configured_interface_with_descr();
|
||||
if ($disabled == false)
|
||||
$iflist = get_configured_interface_with_descr();
|
||||
else
|
||||
$iflist = get_configured_interface_with_descr(false, true);
|
||||
|
||||
foreach($iflist as $ifname => $friendly ) {
|
||||
if(interface_has_gateway($ifname)) {
|
||||
$gateway = array();
|
||||
@ -482,4 +486,4 @@ function get_interface_gateway($interface) {
|
||||
return $gw;
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@ -2276,7 +2276,7 @@ function convert_real_interface_to_friendly_descr($interface) {
|
||||
$ifdesc = convert_real_interface_to_friendly_interface_name("{$interface}");
|
||||
|
||||
if ($ifdesc) {
|
||||
$iflist = get_configured_interface_with_descr();
|
||||
$iflist = get_configured_interface_with_descr(false, true);
|
||||
return $iflist[$ifdesc];
|
||||
}
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ require_once("functions.inc");
|
||||
require_once("filter.inc");
|
||||
require_once("shaper.inc");
|
||||
|
||||
$a_gateways = return_gateways_array();
|
||||
$a_gateways = return_gateways_array(true);
|
||||
$a_gateways_arr = array();
|
||||
foreach($a_gateways as $gw) {
|
||||
$a_gateways_arr[] = $gw;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user