mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 00:07:26 +00:00
src: remove unused $only_opt
This commit is contained in:
parent
8c00114edc
commit
a35b40a4a7
@ -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;
|
||||
}
|
||||
|
||||
@ -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'];
|
||||
}
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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):
|
||||
|
||||
@ -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\"" :""; ?>>
|
||||
|
||||
@ -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':
|
||||
|
||||
@ -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;?>
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user