mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Continue interface improvements
This commit is contained in:
parent
1ad25a3ffb
commit
cbe3ea9640
@ -193,11 +193,9 @@ foreach ($leases as $value) {
|
||||
exec("/usr/sbin/arp -an",$rawdata);
|
||||
|
||||
$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'];
|
||||
}
|
||||
|
||||
/* if list */
|
||||
$ifdescrs = get_configured_interface_with_descr();
|
||||
|
||||
foreach ($ifdescrs as $key =>$interface) {
|
||||
$hwif[$config['interfaces'][$key]['if']] = $interface;
|
||||
|
||||
@ -171,6 +171,8 @@ if ($_POST) {
|
||||
if($config['system']['gateway'] <> "")
|
||||
$config['interfaces']['wan']['gateway'] = $config['system']['gateway'];
|
||||
unset($config['shaper']);
|
||||
/* optional if list */
|
||||
$ifdescrs = get_configured_interface_list(true);
|
||||
/* build an interface collection */
|
||||
for ($j = 1; isset ($config['interfaces']['opt' . $j]); $j++)
|
||||
$ifdescrs['opt' . $j] = "opt" . $j;
|
||||
|
||||
@ -67,8 +67,10 @@ function conv_clog($logfile, $tail = 50) {
|
||||
$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'];
|
||||
/* optional if list */
|
||||
$iflist = get_configured_interface_with_descr(true);
|
||||
foreach ($iflist as $if => $ifdesc)
|
||||
$iftable[$config['interfaces'][$if]['if']] = $ifdesc;
|
||||
|
||||
$sor = isset($config['syslog']['reverse']) ? "-r" : "";
|
||||
|
||||
|
||||
@ -62,8 +62,10 @@ function conv_clog_filter($logfile, $tail = 50) {
|
||||
$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'];
|
||||
/* optional if list */
|
||||
$iflist = get_configured_interface_with_descr(true);
|
||||
foreach ($iflist as $if => $ifdesc)
|
||||
$iftable[$config['interfaces'][$if]['if']] = $ifdesc;
|
||||
|
||||
$sor = isset($config['syslog']['reverse']) ? "-r" : "";
|
||||
|
||||
@ -473,4 +475,4 @@ function handle_ajax() {
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@ -119,14 +119,9 @@ include("head.inc"); ?>
|
||||
<td width="17%" valign="top" class="vncellreq">Interface</td>
|
||||
<td width="83%" class="vtable">
|
||||
<select name="interface" class="formfld">
|
||||
<?php $interfaces = array('wan' => 'WAN', 'lan' => 'LAN');
|
||||
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'];
|
||||
}
|
||||
<?php $interfaces = get_configured_interface_with_descr();
|
||||
foreach ($interfaces as $iface => $ifacename): ?>
|
||||
<option value="<?=$iface;?>" <?php if ($selectedif == $iface) echo "selected"; ?>>
|
||||
<option value="<?=$iface;?>" <?php if (!$config['interfaces'][$iface]['bridge'] && $selectedif == $iface) echo "selected"; ?>>
|
||||
<?php echo $ifacename;?>
|
||||
</option>
|
||||
<?php endforeach;?>
|
||||
|
||||
@ -103,14 +103,9 @@ include("head.inc"); ?>
|
||||
<td width="22%" valign="top" class="vncellreq">Interface</td>
|
||||
<td width="78%" class="vtable">
|
||||
<select name="interface" class="formfld">
|
||||
<?php $interfaces = array('wan' => 'WAN', 'lan' => 'LAN');
|
||||
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'];
|
||||
}
|
||||
<?php $interfaces = get_configured_interface_with_descr();
|
||||
foreach ($interfaces as $iface => $ifacename): ?>
|
||||
<option value="<?=$iface;?>" <?php if ($iface == $interface) echo "selected"; ?>>
|
||||
<option value="<?=$iface;?>" <?php if (!$config['interfaces'][$iface]['bridge'] && $iface == $interface) echo "selected"; ?>>
|
||||
<?=htmlspecialchars($ifacename);?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
|
||||
@ -51,8 +51,10 @@ if (isset($id) && $a_aliases[$id]) {
|
||||
$pconfig['address'] = $a_aliases[$id]['address'];
|
||||
$pconfig['descr'] = html_entity_decode($a_aliases[$id]['descr']);
|
||||
|
||||
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++)
|
||||
if($config['interfaces']['opt' . $i]['descr'] == $pconfig['descr'])
|
||||
/* optional if list */
|
||||
$iflist = get_configured_interface_with_descr(true, true);
|
||||
foreach ($iflist as $if => $ifdesc)
|
||||
if($ifdesc == $pconfig['descr'])
|
||||
$input_errors[] = "Sorry, an interface is already named {$pconfig['descr']}.";
|
||||
|
||||
$addresses = explode(' ', $pconfig['address']);
|
||||
|
||||
@ -144,11 +144,9 @@ include("head.inc");
|
||||
<td width="78%" class="vtable">
|
||||
<select name="interface" class="formselect">
|
||||
<?php
|
||||
$interfaces = array('wan' => 'WAN');
|
||||
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
|
||||
$interfaces['opt' . $i] = $config['interfaces']['opt' . $i]['descr'];
|
||||
}
|
||||
foreach ($interfaces as $iface => $ifacename): ?>
|
||||
$interfaces = get_configured_interface_with_descr();
|
||||
foreach ($interfaces as $iface => $ifacename):
|
||||
if ($iface == "lan") continue; ?>
|
||||
<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected"; ?>>
|
||||
<?=htmlspecialchars($ifacename);?>
|
||||
</option>
|
||||
|
||||
@ -295,16 +295,10 @@ include("fbegin.inc"); ?>
|
||||
<select name="interface" class="formselect">
|
||||
<?php
|
||||
|
||||
$interfaces = array();
|
||||
|
||||
if(have_ruleint_access("lan"))
|
||||
$interfaces['lan'] = "LAN";
|
||||
if(have_ruleint_access("wan"))
|
||||
$interfaces['wan'] = "WAN";
|
||||
|
||||
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++)
|
||||
if(have_ruleint_access("opt{$i}"))
|
||||
$interfaces['opt' . $i] = $config['interfaces']['opt' . $i]['descr'];
|
||||
$iflist = get_configured_interface_with_descr(false, true);
|
||||
foreach ($iflist as $if => $ifdesc)
|
||||
if(have_ruleint_access($if))
|
||||
$interfaces[$if] = $ifdesc;
|
||||
|
||||
if ($config['pptpd']['mode'] == "server")
|
||||
if(have_ruleint_access("pptp"))
|
||||
|
||||
@ -79,25 +79,15 @@ if (isset($_POST['save']) && $_POST['save'] == "Save") {
|
||||
* user has enabled advanced outbound nat -- lets automatically create entries
|
||||
* for all of the interfaces to make life easier on the pip-o-chap
|
||||
*/
|
||||
$ifdescrs = array('lan');
|
||||
for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++)
|
||||
$ifdescrs[] = "opt" . $j;
|
||||
foreach($ifdescrs as $if) {
|
||||
if($if <> "lan" and $if <> "wan") {
|
||||
/* interface is an optional. is it enabled? */
|
||||
if(!isset($config['interfaces'][$if]['enabled'])) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$ifdescrs = get_configured_interface_with_descr();
|
||||
|
||||
foreach($ifdescrs as $if => $ifdesc) {
|
||||
$natent = array();
|
||||
$osn = gen_subnet($config['interfaces'][$if]['ipaddr'],
|
||||
$config['interfaces'][$if]['subnet']);
|
||||
$natent['source']['network'] = $osn . "/" . $config['interfaces'][$if]['subnet'];
|
||||
$natent['sourceport'] = "";
|
||||
$int_description = $config['interfaces'][$if]['descr'];
|
||||
if($if == "lan")
|
||||
$int_description = "LAN";
|
||||
$natent['descr'] = "Auto created rule for {$int_description}";
|
||||
$natent['descr'] = "Auto created rule for {$ifdesc}";
|
||||
$natent['target'] = "";
|
||||
$natent['interface'] = "wan";
|
||||
$natent['destination']['any'] = true;
|
||||
|
||||
@ -301,10 +301,7 @@ function sourcesel_change() {
|
||||
<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]); $i++) {
|
||||
$interfaces['opt' . $i] = $config['interfaces']['opt' . $i]['descr'];
|
||||
}
|
||||
$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);?>
|
||||
|
||||
@ -44,18 +44,11 @@ $if = $_GET['if'];
|
||||
if ($_POST['if'])
|
||||
$if = $_POST['if'];
|
||||
|
||||
$iflist = array();
|
||||
$ifdescs = get_configured_interface_with_descr();
|
||||
|
||||
if($config['interfaces']['lan'])
|
||||
if(have_ruleint_access("lan"))
|
||||
$iflist['lan'] = "LAN";
|
||||
|
||||
if(have_ruleint_access("wan"))
|
||||
$iflist['wan'] = "WAN";
|
||||
|
||||
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++)
|
||||
if(have_ruleint_access("opt{$i}"))
|
||||
$iflist['opt' . $i] = $config['interfaces']['opt' . $i]['descr'];
|
||||
foreach ($ifdescs as $if => $ifdesc)
|
||||
if(have_ruleint_access($if))
|
||||
$iflist[$if] = $ifdesc;
|
||||
|
||||
if ($config['pptpd']['mode'] == "server")
|
||||
if(have_ruleint_access("pptp"))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user