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
b739112506
commit
fbb45bb034
@ -50,15 +50,16 @@ if ($_POST) {
|
||||
|
||||
if ($_POST['bridge']) {
|
||||
/* double bridging? */
|
||||
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
|
||||
if ($i != $index) {
|
||||
if ($config['interfaces']['opt' . $i]['bridge'] == $_POST['bridge']) {
|
||||
//$input_errors[] = "Optional interface {$i} " .
|
||||
// "({$config['interfaces']['opt' . $i]['descr']}) is already bridged to " .
|
||||
$iflist = get_configured_interface_list(true, true);
|
||||
foreach ($iflist as $if) {
|
||||
if ($if != $index) { /* XXX: totaly bogus */
|
||||
if ($config['interfaces'][$if]['bridge'] == $_POST['bridge']) {
|
||||
//$input_errors[] = "Optional interface {$if} " .
|
||||
// "({$config['interfaces'][$if]['descr']}) is already bridged to " .
|
||||
// "the specified interface.";
|
||||
} else if ($config['interfaces']['opt' . $i]['bridge'] == "opt{$index}") {
|
||||
//$input_errors[] = "Optional interface {$i} " .
|
||||
// "({$config['interfaces']['opt' . $i]['descr']}) is already bridged to " .
|
||||
} else if ($config['interfaces'][$if]['bridge'] == $if) {
|
||||
//$input_errors[] = "Optional interface {$if} " .
|
||||
// "({$config['interfaces'][$if]['descr']}) is already bridged to " .
|
||||
// "this interface.";
|
||||
}
|
||||
}
|
||||
@ -174,13 +175,10 @@ function enable_change(enable_over) {
|
||||
<td width="78%" class="vtable">
|
||||
<select name="bridge" class="formselect" id="bridge" onChange="enable_change(false)">
|
||||
<option <?php if (!$pconfig['bridge']) echo "selected";?> value="">none</option>
|
||||
<?php $opts = array('wan' => "WAN");
|
||||
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
|
||||
if ($i != $index)
|
||||
$opts['opt' . $i] = "Optional " . $i . " (" .
|
||||
$config['interfaces']['opt' . $i]['descr'] . ")";
|
||||
}
|
||||
foreach ($opts as $opt => $optname): ?>
|
||||
<?php
|
||||
$opts = get_configured_interface_with_descr();
|
||||
foreach ($opts as $opt => $optname):
|
||||
if ($opt == "lan") continue;?>
|
||||
<option <?php if ($opt == $pconfig['bridge']) echo "selected";?> value="<?=htmlspecialchars($opt);?>">
|
||||
<?=htmlspecialchars($optname);?>
|
||||
</option>
|
||||
|
||||
@ -41,13 +41,9 @@ $a_ppps = &$config['ppps']['ppp'] ;
|
||||
function ppp_inuse($num) {
|
||||
global $config, $g;
|
||||
|
||||
if ($config['interfaces']['lan']['if'] == "ppp{$num}")
|
||||
return true;
|
||||
if ($config['interfaces']['wan']['if'] == "ppp{$num}")
|
||||
return true;
|
||||
|
||||
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
|
||||
if ($config['interfaces']['opt' . $i]['if'] == "ppp{$num}")
|
||||
$iflist = get_configured_interface_list(false, true);
|
||||
foreach ($iflist as $if) {
|
||||
if ($config['interfaces'][$if]['if'] == "ppp{$num}")
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -72,11 +68,9 @@ if ($_GET['act'] == "del") {
|
||||
} else {
|
||||
unset($a_ppps[$_GET['id']]);
|
||||
|
||||
/* renumber all interfaces that use PPP */
|
||||
$config['interfaces']['lan']['if'] = renumber_ppp($config['interfaces']['lan']['if'], $_GET['id']);
|
||||
$config['interfaces']['wan']['if'] = renumber_ppp($config['interfaces']['wan']['if'], $_GET['id']);
|
||||
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++)
|
||||
$config['interfaces']['opt' . $i]['if'] = renumber_ppp($config['interfaces']['opt' . $i]['if'], $_GET['id']);
|
||||
$iflist = get_configured_interface_list(false, true);
|
||||
foreach ($iflist as $if)
|
||||
$config['interfaces'][$if]['if'] = renumber_ppp($config['interfaces'][$if]['if'], $_GET['id']);
|
||||
|
||||
write_config();
|
||||
|
||||
|
||||
@ -39,13 +39,9 @@ $a_vlans = &$config['vlans']['vlan'] ;
|
||||
function vlan_inuse($num) {
|
||||
global $config, $g;
|
||||
|
||||
if ($config['interfaces']['lan']['if'] == "vlan{$num}")
|
||||
return true;
|
||||
if ($config['interfaces']['wan']['if'] == "vlan{$num}")
|
||||
return true;
|
||||
|
||||
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
|
||||
if ($config['interfaces']['opt' . $i]['if'] == "vlan{$num}")
|
||||
$iflist = get_configured_interface_list(false, true);
|
||||
foreach ($iflist as $if) {
|
||||
if ($config['interfaces'][$if]['if'] == "vlan{$num}")
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -327,11 +327,10 @@ function clearcombo(){
|
||||
<div style="float: none;">
|
||||
<select id="gatewayip" name="gatewayip" onchange="gateway_change();" style="float: left;">
|
||||
<?php
|
||||
$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(false, true);
|
||||
foreach ($interfaces as $iface => $ifacename) {
|
||||
if ($iface == "lan")
|
||||
continue;
|
||||
$ifinfo = get_interface_info($iface);
|
||||
if(isset($ifinfo['gateway'])) { ?>
|
||||
<option value="<?=$ifinfo['gateway'];?>"><?=htmlspecialchars($ifacename);?>'s Gateway</option>
|
||||
@ -357,13 +356,7 @@ function clearcombo(){
|
||||
<input name="ipaddr" type="text" size="16" style="float: left;">
|
||||
<select id="iface" name="iface" style="float: left; display: none;">
|
||||
<?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(false, true);
|
||||
foreach ($interfaces as $iface => $ifacename) {
|
||||
$ifinfo = get_interface_info($iface);
|
||||
if(isset($ifinfo['gateway'])) { ?>
|
||||
|
||||
@ -92,9 +92,10 @@ if ($_POST) {
|
||||
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
|
||||
|
||||
/* make sure no interfaces are bridged */
|
||||
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
|
||||
$coptif = &$config['interfaces']['opt' . $i];
|
||||
if (isset($coptif['enable']) && $coptif['bridge'] == $pconfig['cinterface']) {
|
||||
$iflist = get_configured_interface_list(true);
|
||||
foreach ($iflist as $if) {
|
||||
$coptif = &$config['interfaces'][$if];
|
||||
if ($coptif['bridge'] == $pconfig['cinterface']) {
|
||||
$input_errors[] = "The captive portal cannot be used when one or more interfaces are bridged.";
|
||||
break;
|
||||
}
|
||||
@ -279,14 +280,7 @@ function enable_change(enable_change) {
|
||||
<td width="78%" class="vtable">
|
||||
<select name="cinterface" class="formselect" id="cinterface">
|
||||
<?php
|
||||
if($config['interfaces']['lan'])
|
||||
$interfaces = array('lan' => 'LAN');
|
||||
else
|
||||
$interfaces = array();
|
||||
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['cinterface']) echo "selected"; ?>>
|
||||
<?=htmlspecialchars($ifacename);?>
|
||||
|
||||
@ -39,30 +39,21 @@ if ($_POST['if'])
|
||||
if($config['installedpackages']['olsrd']) {
|
||||
foreach($config['installedpackages']['olsrd']['config'] as $olsrd) {
|
||||
if($olsrd['enable']) {
|
||||
$iflist = array("lan" => "LAN", "wan" => "WAN");
|
||||
$is_olsr_enabled = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($config['interfaces']['lan']) {
|
||||
if(!$iflist)
|
||||
$iflist = array("lan" => "LAN");
|
||||
} else {
|
||||
/* if WAN is configured for anything other than static
|
||||
IP, do not allow DHCP server to be configured. */
|
||||
if (!is_ipaddr($config['interfaces']['wan']['ipaddr']))
|
||||
$ifdescrs = get_configured_interface_with_descr();
|
||||
|
||||
foreach ($ifdescrs as $ifname => $ifdesc) {
|
||||
$oc = $config['interfaces'][$ifname];
|
||||
|
||||
if (!is_ipaddr($oc['ipaddr']) && $is_olsr_enabled)
|
||||
$singleif_nostaticip = true;
|
||||
$iflist = array("wan" => strtoupper($g['wan_interface_name']));
|
||||
}
|
||||
|
||||
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'];
|
||||
}
|
||||
else if ($oc['if'] && (!$oc['bridge']))
|
||||
$iflist[$ifname] = $ifdesc['descr'];
|
||||
}
|
||||
|
||||
/* set the starting interface */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user