summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2008-06-21 17:38:13 +0000
committerErmal Luçi <eri@pfsense.org>2008-06-21 17:38:13 +0000
commit3e321df2be59d2bb4c2ffd51e410fe120517e316 (patch)
tree138e5336181e4a7e6d270301ea6208ad91e733bc /usr
parentfbb45bb034aad683b2bd207a497d0cfc0b1b5a1e (diff)
downloadpfsense-3e321df2be59d2bb4c2ffd51e410fe120517e316.zip
pfsense-3e321df2be59d2bb4c2ffd51e410fe120517e316.tar.gz
Continue interface improvements
Diffstat (limited to 'usr')
-rw-r--r--usr/local/www/includes/functions.inc.php11
-rwxr-xr-xusr/local/www/m0n0/firewall_shaper.php5
-rwxr-xr-xusr/local/www/m0n0/firewall_shaper_edit.php21
-rwxr-xr-xusr/local/www/services_dhcp_relay.php11
-rwxr-xr-xusr/local/www/services_proxyarp.php5
-rwxr-xr-xusr/local/www/services_proxyarp_edit.php8
-rwxr-xr-xusr/local/www/services_wol.php12
-rwxr-xr-xusr/local/www/services_wol_edit.php12
-rwxr-xr-xusr/local/www/status_graph.php6
-rwxr-xr-xusr/local/www/status_interfaces.php5
-rwxr-xr-xusr/local/www/status_services.php11
-rwxr-xr-xusr/local/www/system_gateways.php4
-rwxr-xr-xusr/local/www/system_gateways_edit.php5
-rw-r--r--usr/local/www/system_groupmanager.php6
-rwxr-xr-xusr/local/www/vpn_ipsec.php4
-rwxr-xr-xusr/local/www/vpn_ipsec_edit.php8
-rwxr-xr-xusr/local/www/vpn_openvpn_cli_edit.php8
-rwxr-xr-xusr/local/www/vpn_openvpn_srv_edit.php8
-rwxr-xr-xusr/local/www/vpn_pppoe.php10
-rw-r--r--usr/local/www/widgets/include/log.inc7
-rw-r--r--usr/local/www/widgets/widgets/interface_statistics.widget.php7
-rw-r--r--usr/local/www/widgets/widgets/services_status.widget.php11
-rw-r--r--usr/local/www/widgets/widgets/traffic_graphs.widget.php6
23 files changed, 66 insertions, 125 deletions
diff --git a/usr/local/www/includes/functions.inc.php b/usr/local/www/includes/functions.inc.php
index 38f4b14..5f3b1fa 100644
--- a/usr/local/www/includes/functions.inc.php
+++ b/usr/local/www/includes/functions.inc.php
@@ -154,10 +154,8 @@ function get_interfacestats(){
global $config;
//build interface list for widget use
- $i = 0; $ifdescrs = array('wan' => 'WAN', 'lan' => 'LAN');
- for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
- $ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
- }
+ $ifdescrs = get_configured_interface_list_with_descr();
+
$array_in_packets = array();
$array_out_packets = array();
$array_in_bytes = array();
@@ -201,10 +199,7 @@ function get_interfacestatus(){
global $config;
//build interface list for widget use
- $i = 0; $ifdescrs = array('wan' => 'WAN', 'lan' => 'LAN');
- for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
- $ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
- }
+ $ifdescrs = get_configured_interface_with_descr();
foreach ($ifdescrs as $ifdescr => $ifname){
$ifinfo = get_interface_info($ifdescr);
diff --git a/usr/local/www/m0n0/firewall_shaper.php b/usr/local/www/m0n0/firewall_shaper.php
index 3d93b0a..f4380dd 100755
--- a/usr/local/www/m0n0/firewall_shaper.php
+++ b/usr/local/www/m0n0/firewall_shaper.php
@@ -166,9 +166,8 @@ include("head.inc");
} else {
$textss = $textse = "";
}
- $iflabels = array('lan' => 'LAN', 'wan' => 'WAN', 'pptp' => 'PPTP');
- for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++)
- $iflabels['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
+ $iflabels = get_configured_interface_with_descr();
+
echo $textss . htmlspecialchars($iflabels[$shaperent['interface']]);
echo "<br>";
echo "<a href=\"?act=toggle&id={$i}\">";
diff --git a/usr/local/www/m0n0/firewall_shaper_edit.php b/usr/local/www/m0n0/firewall_shaper_edit.php
index 589a714..cccc7f6 100755
--- a/usr/local/www/m0n0/firewall_shaper_edit.php
+++ b/usr/local/www/m0n0/firewall_shaper_edit.php
@@ -491,10 +491,9 @@ include("head.inc");
<tr>
<td width="22%" valign="top" class="vncellreq">Interface</td>
<td width="78%" class="vtable"><select name="interface" class="formselect">
- <?php $interfaces = array('lan' => 'LAN', 'wan' => 'WAN', 'pptp' => 'PPTP');
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
- $interfaces['opt' . $i] = $config['interfaces']['opt' . $i]['descr'];
- }
+ <?php $interfaces = get_configured_interface_with_descr();
+ $interfaces['pptp'] = 'PPTP';
+
foreach ($interfaces as $iface => $ifacename): ?>
<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected"; ?>>
<?=htmlspecialchars($ifacename);?>
@@ -537,9 +536,10 @@ include("head.inc");
LAN subnet</option>
<option value="pptp" <?php if ($pconfig['src'] == "pptp") { echo "selected"; } ?>>
PPTP clients</option>
- <?php for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++): ?>
- <option value="opt<?=$i;?>" <?php if ($pconfig['src'] == "opt" . $i) { echo "selected"; } ?>>
- <?=htmlspecialchars($config['interfaces']['opt' . $i]['descr']);?>
+ <?php $iflist = get_configured_interface_with_descr(true);
+ foreach ($iflist as $opt => $ifdesc): ?>
+ <option value="<?=$opt;?>" <?php if ($pconfig['src'] == $opt) { echo "selected"; } ?>>
+ <?=htmlspecialchars($ifdesc);?>
subnet</option>
<?php endfor; ?>
</select></td>
@@ -619,9 +619,10 @@ include("head.inc");
LAN subnet</option>
<option value="pptp" <?php if ($pconfig['dst'] == "pptp") { echo "selected"; } ?>>
PPTP clients</option>
- <?php for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++): ?>
- <option value="opt<?=$i;?>" <?php if ($pconfig['dst'] == "opt" . $i) { echo "selected"; } ?>>
- <?=htmlspecialchars($config['interfaces']['opt' . $i]['descr']);?>
+ <?php $iflist = get_configured_interface_with_descr(true);
+ foreach ($iflist as $opt => $ifdesc): ?>
+ <option value="<?=$opt;?>" <?php if ($pconfig['dst'] == $opt) { echo "selected"; } ?>>
+ <?=htmlspecialchars($ifdesc);?>
subnet</option>
<?php endfor; ?>
</select> </td>
diff --git a/usr/local/www/services_dhcp_relay.php b/usr/local/www/services_dhcp_relay.php
index e3cc0c8..a64bbc2 100755
--- a/usr/local/www/services_dhcp_relay.php
+++ b/usr/local/www/services_dhcp_relay.php
@@ -63,13 +63,12 @@ $if = $_GET['if'];
if ($_POST['if'])
$if = $_POST['if'];
-$iflist = array("lan" => "LAN");
+$ifdescrs = get_configured_interface_list();
+foreach ($ifdescrs as $ifname) {
+ $oc = $config['interfaces'][$ifname];
-for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
- $oc = $config['interfaces']['opt' . $i];
-
- if (isset($oc['enable']) && $oc['if'] && (!$oc['bridge'])) {
- $iflist['opt' . $i] = $oc['descr'];
+ if ($oc['if'] && (!$oc['bridge'])) {
+ $iflist[$ifname] = $oc['descr'];
}
}
diff --git a/usr/local/www/services_proxyarp.php b/usr/local/www/services_proxyarp.php
index 037325f..601f086 100755
--- a/usr/local/www/services_proxyarp.php
+++ b/usr/local/www/services_proxyarp.php
@@ -88,9 +88,8 @@ include("head.inc");
<td class="listlr" ondblclick="document.location='services_proxyarp_edit.php?id=<?=$i;?>';">
<?php
if ($arpent['interface']) {
- $iflabels = array('lan' => 'LAN', 'wan' => 'WAN');
- for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++)
- $iflabels['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
+ $iflabels = get_configured_interface_with_descr();
+
echo htmlspecialchars($iflabels[$arpent['interface']]);
} else {
echo "WAN";
diff --git a/usr/local/www/services_proxyarp_edit.php b/usr/local/www/services_proxyarp_edit.php
index 36697dc..5a6e7f3 100755
--- a/usr/local/www/services_proxyarp_edit.php
+++ b/usr/local/www/services_proxyarp_edit.php
@@ -173,13 +173,7 @@ function typesel_change() {
<td width="78%" class="vtable">
<select name="interface" class="formselect">
<?php
- if($config['interfaces']['lan'])
- $interfaces = array('wan' => 'WAN', 'lan' => 'LAN');
- else
- $interfaces = array('wan' => 'WAN');
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
- $interfaces['opt' . $i] = $config['interfaces']['opt' . $i]['descr'];
- }
+ $interfaces = get_configured_interface_with_descr();
foreach ($interfaces as $iface => $ifacename): ?>
<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected"; ?>>
<?=htmlspecialchars($ifacename);?>
diff --git a/usr/local/www/services_wol.php b/usr/local/www/services_wol.php
index 54a3cef..21b5d20 100755
--- a/usr/local/www/services_wol.php
+++ b/usr/local/www/services_wol.php
@@ -106,17 +106,9 @@ include("head.inc");
<td width="78%" class="vtable">
<select name="interface" class="formselect">
<?php
- if($config['interfaces']['lan'])
- $interfaces = array('wan' => 'WAN', 'lan' => 'LAN');
- else
- $interfaces = array('wan' => 'WAN');
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
- if (isset($config['interfaces']['opt' . $i]['enable']) &&
- !$config['interfaces']['opt' . $i]['bridge'])
- $interfaces['opt' . $i] = $config['interfaces']['opt' . $i]['descr'];
- }
+ $interfaces = get_configured_interface_with_descr();
foreach ($interfaces as $iface => $ifacename): ?>
- <option value="<?=$iface;?>" <?php if ($iface == $if) echo "selected"; ?>>
+ <option value="<?=$iface;?>" <?php if (!$config['interfaces'][$iface]['bridge'] && $iface == $if) echo "selected"; ?>>
<?=htmlspecialchars($ifacename);?>
</option>
<?php endforeach; ?>
diff --git a/usr/local/www/services_wol_edit.php b/usr/local/www/services_wol_edit.php
index c4b1646..459845a 100755
--- a/usr/local/www/services_wol_edit.php
+++ b/usr/local/www/services_wol_edit.php
@@ -104,17 +104,9 @@ include("head.inc");
<td width="78%" class="vtable">
<select name="interface" class="formfld">
<?php
- if($config['interfaces']['lan'])
- $interfaces = array('lan' => 'LAN');
- else
- $interfaces = array('WAN' => 'WAN');
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
- if (isset($config['interfaces']['opt' . $i]['enable']) &&
- !$config['interfaces']['opt' . $i]['bridge'])
- $interfaces['opt' . $i] = $config['interfaces']['opt' . $i]['descr'];
- }
+ $interfaces = get_configured_interface_with_descr();
foreach ($interfaces as $iface => $ifacename): ?>
- <option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected"; ?>>
+ <option value="<?=$iface;?>" <?php if (!$config['interfaces'][$iface]['bridge'] && $iface == $pconfig['interface']) echo "selected"; ?>>
<?=htmlspecialchars($ifacename);?>
</option>
<?php endforeach; ?>
diff --git a/usr/local/www/status_graph.php b/usr/local/www/status_graph.php
index 2f3bf7f..9d3cf32 100755
--- a/usr/local/www/status_graph.php
+++ b/usr/local/www/status_graph.php
@@ -63,12 +63,8 @@ include("head.inc");
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
<?php
-$ifdescrs = array('wan' => 'WAN', 'lan' => 'LAN');
+$ifdescrs = get_configured_interface_with_descr();
-for($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
- if(isset($config['interfaces']['opt' . $j]['enable']))
- $ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
-}
if((isset($config['ipsec']['enable'])) || (isset($config['ipsec']['mobileclients']['enable']))) {
$ifdescrs['ipsec'] = "IPsec";
}
diff --git a/usr/local/www/status_interfaces.php b/usr/local/www/status_interfaces.php
index bfea26f..c813347 100755
--- a/usr/local/www/status_interfaces.php
+++ b/usr/local/www/status_interfaces.php
@@ -67,10 +67,7 @@ include("head.inc");
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <?php $i = 0; $ifdescrs = array('wan' => 'WAN', 'lan' => 'LAN');
- for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
- $ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
- }
+ <?php $ifdescrs = get_configured_interface_with_descr(false, true);
foreach ($ifdescrs as $ifdescr => $ifname):
$ifinfo = get_interface_info($ifdescr);
?>
diff --git a/usr/local/www/status_services.php b/usr/local/www/status_services.php
index 8616c19..8a184f3 100755
--- a/usr/local/www/status_services.php
+++ b/usr/local/www/status_services.php
@@ -223,11 +223,12 @@ if(isset($config['captiveportal']['enable'])) {
unset($pconfig);
}
-$iflist = array("lan" => "LAN");
-for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
- $oc = $config['interfaces']['opt' . $i];
- if (isset($oc['enable']) && $oc['if'] && (!$oc['bridge']))
- $iflist['opt' . $i] = "opt{$i}";
+$iflist = array();
+$ifdescrs = get_configured_interface_list();
+foreach ($ifdescrs as $if) {
+ $oc = $config['interfaces'][$if];
+ if ($oc['if'] && (!$oc['bridge']))
+ $iflist[$if] = $if;
}
$show_dhcprelay = false;
foreach($iflist as $if) {
diff --git a/usr/local/www/system_gateways.php b/usr/local/www/system_gateways.php
index 97599b7..b3ac304 100755
--- a/usr/local/www/system_gateways.php
+++ b/usr/local/www/system_gateways.php
@@ -127,9 +127,7 @@ effect.");?><br>
</td>
<td class="listr" ondblclick="document.location='system_gateways_edit.php?id=<?=$i;?>';">
<?php
- $iflabels = array('wan' => 'WAN', 'lan' => 'LAN');
- for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++)
- $iflabels['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
+ $iflabels = get_configured_interface_with_descr();
echo htmlspecialchars($iflabels[$gateway['interface']]); ?>
</td>
<td class="listr" ondblclick="document.location='system_gateways_edit.php?id=<?=$i;?>';">
diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php
index 9c1122f..4156066 100755
--- a/usr/local/www/system_gateways_edit.php
+++ b/usr/local/www/system_gateways_edit.php
@@ -163,10 +163,7 @@ include("head.inc");
<td width="22%" valign="top" class="vncellreq">Interface</td>
<td width="78%" class="vtable">
<select name="interface" class="formselect">
- <?php $interfaces = array('wan' => 'WAN', 'lan' => 'LAN');
- for ($i = 1; isset($config['interfaces']['opt' . $i]['enable']); $i++) {
- $interfaces['opt' . $i] = $config['interfaces']['opt' . $i]['descr'];
- }
+ <?php $interfaces = get_configured_interface_with_descr(false, true);
foreach ($interfaces as $iface => $ifacename): ?>
<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected"; ?>>
<?=htmlspecialchars($ifacename);?>
diff --git a/usr/local/www/system_groupmanager.php b/usr/local/www/system_groupmanager.php
index 21658c9..59bc1ec 100644
--- a/usr/local/www/system_groupmanager.php
+++ b/usr/local/www/system_groupmanager.php
@@ -143,9 +143,7 @@ function getAdminPageList() {
}
/* firewall rule view and edit entries for lan, wan, optX */
- $iflist = array("lan" => "lan", "wan" => "wan");
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++)
- $iflist['opt' . $i] = "opt{$i}";
+ $iflist = get_configured_interface_list(false, true);
// Firewall Rules
foreach ($iflist as $ifent => $ifname) {
@@ -445,4 +443,4 @@ if($_GET['act']=="new" || $_GET['act']=="edit"){
</table>
-<?php include("fend.inc"); ?> \ No newline at end of file
+<?php include("fend.inc"); ?>
diff --git a/usr/local/www/vpn_ipsec.php b/usr/local/www/vpn_ipsec.php
index 36986b1..4946d73 100755
--- a/usr/local/www/vpn_ipsec.php
+++ b/usr/local/www/vpn_ipsec.php
@@ -163,14 +163,12 @@ include("head.inc");
<?=$spane;?></td>
<td class="listr" ondblclick="document.location='vpn_ipsec_edit.php?id=<?=$i;?>'"><?=$spans;?>
<?php if ($ipsecent['interface']) {
- $iflabels = array('lan' => 'LAN', 'wan' => 'WAN');
+ $iflabels = get_configured_interface_with_descr();
$carpips = find_number_of_needed_carp_interfaces();
for($j=0; $j<$carpips; $j++) {
$carpip = find_interface_ip("carp" . $j);
$iflabels['carp' . $j] = "CARP{$j} ({$carpip})";
}
- for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++)
- $iflabels['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
$if = htmlspecialchars($iflabels[$ipsecent['interface']]);
} else
$if = "WAN";
diff --git a/usr/local/www/vpn_ipsec_edit.php b/usr/local/www/vpn_ipsec_edit.php
index 0a338f4..74de623 100755
--- a/usr/local/www/vpn_ipsec_edit.php
+++ b/usr/local/www/vpn_ipsec_edit.php
@@ -366,13 +366,7 @@ function methodsel_change() {
<td width="22%" valign="top" class="vncellreq">Interface</td>
<td width="78%" class="vtable"><select name="interface" class="formselect">
<?php
- if($config['interfaces']['lan'])
- $interfaces = array('wan' => 'WAN', 'lan' => 'LAN');
- else
- $interfaces = array('wan' => 'WAN');
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
- $interfaces['opt' . $i] = $config['interfaces']['opt' . $i]['descr'];
- }
+ $interfaces = get_configured_interface_with_descr();
$carpips = find_number_of_needed_carp_interfaces();
for($i=0; $i<$carpips; $i++) {
$carpip = find_interface_ip("carp" . $i);
diff --git a/usr/local/www/vpn_openvpn_cli_edit.php b/usr/local/www/vpn_openvpn_cli_edit.php
index be8fd9f..f1d3dc0 100755
--- a/usr/local/www/vpn_openvpn_cli_edit.php
+++ b/usr/local/www/vpn_openvpn_cli_edit.php
@@ -599,10 +599,10 @@ function get_radio_value(obj) {
<td width="78%" class="vtable">
<select name="bridge" class="formfld" id="bridge" onchange="methodsel_change(false)">
<option <?php if (!$pconfig['bridge']) echo "selected";?> value="">none</option>
- <?php $opts = array('lan' => "LAN", 'wan' => "WAN");
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
- if ($i != $index && !($config['interfaces']['opt' . $i]['ovpn']))
- $opts['opt' . $i] = "Optional " . $i . " (" . $config['interfaces']['opt' . $i]['descr'] . ")";
+ <?php $iflist = get_configured_interface_with_descr();
+ foreach ($iflist as $if => $ifdesc) {
+ if (!($config['interfaces'][$if]['ovpn']))
+ $opts[$if] = "Optional " . $if . " (" . $ifdesc . ")";
}
foreach ($opts as $opt => $optname): ?>
<option <?php if ($opt == $pconfig['bridge']) echo "selected";?> value="<?=htmlspecialchars($opt);?>">
diff --git a/usr/local/www/vpn_openvpn_srv_edit.php b/usr/local/www/vpn_openvpn_srv_edit.php
index 3fa8715..1b1f249 100755
--- a/usr/local/www/vpn_openvpn_srv_edit.php
+++ b/usr/local/www/vpn_openvpn_srv_edit.php
@@ -942,10 +942,10 @@ function get_radio_value(obj) {
<td width="78%" class="vtable">
<select name="bridge" class="formfld" id="bridge" onChange="methodsel_change(false)">
<option <?php if (!$pconfig['bridge']) echo "selected";?> value="">none</option>
- <?php $opts = array('lan' => "LAN", 'wan' => "WAN");
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
- if ($i != $index && !($config['interfaces']['opt' . $i]['ovpn']))
- $opts['opt' . $i] = "Optional " . $i . " (" . $config['interfaces']['opt' . $i]['descr'] . ")";
+ <?php $iflist = get_configured_interface_with_descr();
+ foreach ($iflist as $if => $ifdesc) {
+ if (!($config['interfaces'][$if]['ovpn']))
+ $opts[$if] = "Optional " . $if . " (" . $ifdesc . ")";
}
foreach ($opts as $opt => $optname): ?>
<option <?php if ($opt == $pconfig['bridge']) echo "selected";?> value="<?=htmlspecialchars($opt);?>">
diff --git a/usr/local/www/vpn_pppoe.php b/usr/local/www/vpn_pppoe.php
index 97d099c..7855ac1 100755
--- a/usr/local/www/vpn_pppoe.php
+++ b/usr/local/www/vpn_pppoe.php
@@ -298,14 +298,8 @@ function enable_change(enable_over) {
<select name="interface" class="formselect" id="interface">
<?php
- if($config['interfaces']['lan'])
- $interfaces = array('wan' => 'WAN', 'lan' => 'LAN');
- else
- $interfaces = array('wan' => 'WAN');
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
- if (isset($config['interfaces']['opt' . $i]['enable']))
- $interfaces['opt' . $i] = $config['interfaces']['opt' . $i]['descr'];
- }
+ $interfaces = get_configured_interface_with_descr();
+
foreach ($interfaces as $iface => $ifacename):
?>
<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected"; ?>>
diff --git a/usr/local/www/widgets/include/log.inc b/usr/local/www/widgets/include/log.inc
index e9575a4..74d7c17 100644
--- a/usr/local/www/widgets/include/log.inc
+++ b/usr/local/www/widgets/include/log.inc
@@ -21,8 +21,9 @@ function conv_clog_filter($logfile, $tail = 8) {
$iftable = array();
$iftable[$config['interfaces']['lan']['if']] = "LAN";
$iftable[get_real_wan_interface()] = "WAN";
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++)
- $iftable[$config['interfaces']['opt' . $i]['if']] = $config['interfaces']['opt' . $i]['descr'];
+ $iflist = get_configured_interface_with_descr(true);
+ foreach ($iflist as $ifl => $ifdesc)
+ $iftable[$config['interfaces'][$if]['if']] = $ifdesc;
$sor = isset($config['syslog']['reverse']) ? "-r" : "";
@@ -174,4 +175,4 @@ function handle_ajax() {
exit;
}
}
-?> \ No newline at end of file
+?>
diff --git a/usr/local/www/widgets/widgets/interface_statistics.widget.php b/usr/local/www/widgets/widgets/interface_statistics.widget.php
index ad3f201..3fcf8a6 100644
--- a/usr/local/www/widgets/widgets/interface_statistics.widget.php
+++ b/usr/local/www/widgets/widgets/interface_statistics.widget.php
@@ -36,10 +36,7 @@ require_once("pfsense-utils.inc");
require_once("functions.inc");
require_once("/usr/local/www/widgets/include/interface_statistics.inc");
- $i = 0; $ifdescrs = array('wan' => 'WAN', 'lan' => 'LAN');
- for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
- $ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
- }
+ $ifdescrs = get_configured_interface_with_descr();
$array_in_packets = array();
$array_out_packets = array();
@@ -213,4 +210,4 @@ require_once("/usr/local/www/widgets/include/interface_statistics.inc");
</tr>
</table>
</div>
- </div> \ No newline at end of file
+ </div>
diff --git a/usr/local/www/widgets/widgets/services_status.widget.php b/usr/local/www/widgets/widgets/services_status.widget.php
index 8e687ca..5fe9d12 100644
--- a/usr/local/www/widgets/widgets/services_status.widget.php
+++ b/usr/local/www/widgets/widgets/services_status.widget.php
@@ -70,10 +70,11 @@ if(isset($config['captiveportal']['enable'])) {
}
$iflist = array("lan" => "LAN");
-for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
- $oc = $config['interfaces']['opt' . $i];
- if (isset($oc['enable']) && $oc['if'] && (!$oc['bridge']))
- $iflist['opt' . $i] = "opt{$i}";
+$ifdescrs = get_configured_interface_list(true);
+foreach ($ifdescrs as $if) {
+ $oc = $config['interfaces'][$if];
+ if ($oc['if'] && (!$oc['bridge']))
+ $iflist[$if] = $if;
}
$show_dhcprelay = false;
foreach($iflist as $if) {
@@ -165,4 +166,4 @@ if($services) {
echo "<tr><td colspan=\"4\"><center>No services found.</td></tr>\n";
}
?>
-</table> \ No newline at end of file
+</table>
diff --git a/usr/local/www/widgets/widgets/traffic_graphs.widget.php b/usr/local/www/widgets/widgets/traffic_graphs.widget.php
index dbeb3fd..3ff28da 100644
--- a/usr/local/www/widgets/widgets/traffic_graphs.widget.php
+++ b/usr/local/www/widgets/widgets/traffic_graphs.widget.php
@@ -34,10 +34,8 @@ require_once("guiconfig.inc");
require_once("pfsense-utils.inc");
require_once("functions.inc");
- $i = 0; $ifdescrs = array('wan' => 'WAN', 'lan' => 'LAN');
- for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
- $ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
- }?>
+ $ifdescrs = get_configured_interface_with_descr();
+?>
<input type="hidden" id="traffic_graphs-config" name="traffic_graphs-config" value="">
<?php
//set variables for traffic graph
OpenPOWER on IntegriCloud