src: remove unused $only_opt

This commit is contained in:
Franco Fichtner 2018-09-11 21:52:34 +02:00
parent 8c00114edc
commit a35b40a4a7
13 changed files with 15 additions and 25 deletions

View File

@ -1785,7 +1785,7 @@ function interface_sync_wireless_clones(&$ifcfg, $sync_changes = false)
$baseif = interface_get_wireless_base($ifcfg['if']);
foreach (get_configured_interface_with_descr(false, true) as $if => $unused) {
foreach (get_configured_interface_with_descr(true) as $if => $unused) {
if ($baseif == interface_get_wireless_base($config['interfaces'][$if]['if']) && $ifcfg['if'] != $config['interfaces'][$if]['if']) {
if (isset($config['interfaces'][$if]['wireless']['standard']) || $sync_changes) {
foreach ($shared_settings as $setting) {
@ -3513,7 +3513,7 @@ function convert_friendly_interface_to_friendly_descr($interface)
}
}
} else {
foreach (get_configured_interface_with_descr(false, true) as $if => $ifname) {
foreach (get_configured_interface_with_descr(true) as $if => $ifname) {
if ($if == $interface || $ifname == $interface) {
return $ifname;
}

View File

@ -749,15 +749,11 @@ function get_configured_vips_list()
return $alias_list;
}
function get_configured_interface_with_descr($only_opt = false, $withdisabled = false)
function get_configured_interface_with_descr($withdisabled = false)
{
$iflist = array();
foreach (legacy_config_get_interfaces(array('virtual' => false)) as $if => $ifdetail) {
if ($only_opt && ($if == 'wan' || $if == 'lan')) {
continue;
}
if (isset($ifdetail['enable']) || $withdisabled == true) {
$iflist[$if] = $ifdetail['descr'];
}

View File

@ -43,7 +43,7 @@ $product = $g['product_name'];
echo "\n*** {$hostname}.{$domain}: {$product} {$version} ({$machine}/${flavour}) ***\n";
$iflist = get_configured_interface_with_descr(false, true);
$iflist = get_configured_interface_with_descr(true);
if (empty($iflist)) {
echo "\n\tNo network interfaces are assigned.\n";

View File

@ -135,7 +135,7 @@ function get_interface_config_description($iface)
$fp = fopen('php://stdin', 'r');
/* build an interface collection */
$ifdescrs = get_configured_interface_with_descr(false, true);
$ifdescrs = get_configured_interface_with_descr(true);
$count = count($ifdescrs);
/* grab interface that we will operate on, unless there is only one

View File

@ -267,7 +267,7 @@ $main_buttons = array(
</thead>
<tbody>
<?php
$interfaces = get_configured_interface_with_descr(false, true);
$interfaces = get_configured_interface_with_descr(true);
$interfaces['lo0'] = "Localhost";
$i = 0;
foreach ($a_vip as $vipent):

View File

@ -333,7 +333,7 @@ $( document ).ready(function() {
<td>
<select name="interface" class="selectpicker" data-width="auto">
<?php
$interfaces = get_configured_interface_with_descr(false, true);
$interfaces = get_configured_interface_with_descr(true);
$interfaces['lo0'] = "Localhost";
foreach ($interfaces as $iface => $ifacename): ?>
<option value="<?=$iface;?>" <?= $iface == $pconfig['interface'] ? "selected=\"selected\"" :""; ?>>

View File

@ -309,17 +309,11 @@ function get_wireless_channel_info($interface) {
return($wireless_channels);
}
$ifdescrs = get_configured_interface_with_descr(true);
// Get configured interface list
$ifdescrs = get_configured_interface_with_descr(false, true);
// reference to interface section
$a_interfaces = &config_read_array('interfaces');
$a_ppps = &config_read_array('ppps', 'ppp');
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (!empty($_GET['if']) && !empty($a_interfaces[$_GET['if']])) {
$if = $_GET['if'];
@ -2889,7 +2883,7 @@ include("head.inc");
<td style="width:78%">
<select name='track6-interface' class='selectpicker' data-style='btn-default' >
<?php
foreach (get_configured_interface_with_descr(false, true) as $iface => $ifacename):
foreach (get_configured_interface_with_descr(true) as $iface => $ifacename):
switch($config['interfaces'][$iface]['ipaddrv6']) {
case '6rd':
case '6to4':

View File

@ -119,7 +119,7 @@ $main_buttons = array(
</td>
<td>
<?php
$iflist = get_configured_interface_with_descr(false, true);
$iflist = get_configured_interface_with_descr(true);
foreach (explode(" ", $ifgroupentry['members']) as $id => $memb):?>
<?=$id > 0 ? "," : "";?>
<?=!empty($iflist[$memb]) ? $iflist[$memb] : $memb;?>

View File

@ -33,7 +33,7 @@ function lagg_inuse($lagg_intf)
{
global $config;
foreach (get_configured_interface_with_descr(false, true) as $if => $unused) {
foreach (get_configured_interface_with_descr(true) as $if => $unused) {
if ($config['interfaces'][$if]['if'] == $lagg_intf) {
return true;
}

View File

@ -42,7 +42,7 @@ function available_interfaces($selected_id=null)
global $config;
// configured interfaces
$configured_interfaces = array();
foreach (get_configured_interface_with_descr(false, true) as $intf => $unused) {
foreach (get_configured_interface_with_descr(true) as $intf => $unused) {
$configured_interfaces[] = get_real_interface($intf);
}
// lagg members from other lagg interfaces

View File

@ -33,7 +33,7 @@ function clone_inuse($cloneif)
{
global $config;
foreach (get_configured_interface_with_descr(false, true) as $if => $unused) {
foreach (get_configured_interface_with_descr(true) as $if => $unused) {
if ($config['interfaces'][$if]['if'] == $cloneif) {
return true;
}

View File

@ -70,7 +70,7 @@ include("head.inc");
$pfctl_counters = json_decode(configd_run("filter list counters json"), true);
$vmstat_interupts = json_decode(configd_run("system list interrupts json"), true);
$ifsinfo = get_interfaces_info();
foreach (get_configured_interface_with_descr(false, true) as $ifdescr => $ifname):
foreach (get_configured_interface_with_descr(true) as $ifdescr => $ifname):
$ifinfo = $ifsinfo[$ifdescr];
$ifpfcounters = $pfctl_counters[$ifinfo['if']];
legacy_html_escape_form_data($ifinfo);

View File

@ -583,7 +583,7 @@ $( document ).ready(function() {
<td>
<select name='interface' class="selectpicker" data-style="btn-default" data-live-search="true">
<?php
foreach (get_configured_interface_with_descr(false, true) as $iface => $ifacename):?>
foreach (get_configured_interface_with_descr(true) as $iface => $ifacename):?>
<option value="<?=$iface;?>" <?=$iface == $pconfig['friendlyiface'] ? "selected='selected'" : "";?>>
<?=$ifacename;?>
</option>