summaryrefslogtreecommitdiffstats
path: root/usr/local/www/vpn_ipsec_edit.php
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2008-02-09 22:28:01 +0000
committerScott Ullrich <sullrich@pfsense.org>2008-02-09 22:28:01 +0000
commit739090a9eadb98d999f27841328b3fc736d631a6 (patch)
tree60d95a97d447c23f07bce739149c6de9ab84be1a /usr/local/www/vpn_ipsec_edit.php
parente47499d578802a7d20fc07380aad9c0f74c779be (diff)
downloadpfsense-739090a9eadb98d999f27841328b3fc736d631a6.zip
pfsense-739090a9eadb98d999f27841328b3fc736d631a6.tar.gz
Do not show LAN related items when the interface is not present.
Diffstat (limited to 'usr/local/www/vpn_ipsec_edit.php')
-rwxr-xr-xusr/local/www/vpn_ipsec_edit.php27
1 files changed, 18 insertions, 9 deletions
diff --git a/usr/local/www/vpn_ipsec_edit.php b/usr/local/www/vpn_ipsec_edit.php
index f8040c1..5e047eb 100755
--- a/usr/local/www/vpn_ipsec_edit.php
+++ b/usr/local/www/vpn_ipsec_edit.php
@@ -35,7 +35,8 @@ if (!is_array($config['ipsec']['tunnel'])) {
}
$a_ipsec = &$config['ipsec']['tunnel'];
-$specialsrcdst = explode(" ", "lan");
+if($config['interfaces']['lan'])
+ $specialsrcdst = explode(" ", "lan");
$id = $_GET['id'];
if (isset($_POST['id']))
@@ -49,11 +50,13 @@ if (isset($id) && $a_ipsec[$id]) {
$pconfig['disabled'] = isset($a_ipsec[$id]['disabled']);
$pconfig['auto'] = isset($a_ipsec[$id]['auto']);
- if (!isset($a_ipsec[$id]['local-subnet']))
- $pconfig['localnet'] = "lan";
- else
+ if (!isset($a_ipsec[$id]['local-subnet'])) {
+ if($config['interfaces']['lan'])
+ $pconfig['localnet'] = "lan";
+ } else {
address_to_pconfig_vpn($a_ipsec[$id]['local-subnet'], $pconfig['localnet'], $pconfig['localnetmask']);
-
+ }
+
if ($a_ipsec[$id]['interface'])
$pconfig['interface'] = $a_ipsec[$id]['interface'];
else
@@ -102,7 +105,8 @@ if (isset($id) && $a_ipsec[$id]) {
} else {
/* defaults */
$pconfig['interface'] = "wan";
- $pconfig['localnet'] = "lan";
+ if($config['interfaces']['lan'])
+ $pconfig['localnet'] = "lan";
$pconfig['p1mode'] = "aggressive";
$pconfig['p1myidentt'] = "myaddress";
$pconfig['p1authentication_method'] = "pre_shared_key";
@@ -354,7 +358,10 @@ function methodsel_change() {
<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');
+ 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'];
}
@@ -384,8 +391,10 @@ function methodsel_change() {
Single host</option>
<option value="network" <?php if (!$sel) echo "selected"; ?>>
Network</option>
- <option value="lan" <?php if ($pconfig['localnet'] == "lan") { echo "selected"; } ?>>
+ <?php if($config['interfaces']['lan']): ?>
+ <option value="lan" <?php if ($pconfig['localnet'] == "lan") { echo "selected"; } ?>>
LAN subnet</option>
+ <?php endif; ?>
</select></td>
</tr>
<tr>
@@ -626,7 +635,7 @@ function methodsel_change() {
</tr>
</table>
</form>
-<script language="JavaScript">
+<script lannguage="JavaScript">
<!--
typesel_change();
methodsel_change();
OpenPOWER on IntegriCloud