summaryrefslogtreecommitdiffstats
path: root/usr/local/www/vpn_ipsec.php
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-06-21 23:30:39 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-06-21 23:30:39 +0000
commite24118864179ac426ca9c9105263be7a3b9cfdc0 (patch)
tree4f851c44d5b7bcb74bcf9307f7b3525e69eb6f75 /usr/local/www/vpn_ipsec.php
parent76f95b1e459651b1e1585283e2a9f7b544dd8114 (diff)
downloadpfsense-e24118864179ac426ca9c9105263be7a3b9cfdc0.zip
pfsense-e24118864179ac426ca9c9105263be7a3b9cfdc0.tar.gz
Import m0n0wall ipsec cert code
Diffstat (limited to 'usr/local/www/vpn_ipsec.php')
-rwxr-xr-xusr/local/www/vpn_ipsec.php120
1 files changed, 39 insertions, 81 deletions
diff --git a/usr/local/www/vpn_ipsec.php b/usr/local/www/vpn_ipsec.php
index 4cfbfaa..9a52898 100755
--- a/usr/local/www/vpn_ipsec.php
+++ b/usr/local/www/vpn_ipsec.php
@@ -1,25 +1,22 @@
#!/usr/local/bin/php
<?php
-/* $Id$ */
/*
vpn_ipsec.php
- Copyright (C) 2004 Scott Ullrich
+ part of m0n0wall (http://m0n0.ch/wall)
+
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
-
- originally part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-
+
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
-
+
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
@@ -32,16 +29,16 @@
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("VPN", "IPsec");
require("guiconfig.inc");
if (!is_array($config['ipsec']['tunnel'])) {
$config['ipsec']['tunnel'] = array();
}
$a_ipsec = &$config['ipsec']['tunnel'];
+$wancfg = &$config['interfaces']['wan'];
$pconfig['enable'] = isset($config['ipsec']['enable']);
-$pconfig['preferredoldsa'] = isset($config['ipsec']['preferredoldsa']);
-$pconfig['ipcomp'] = isset($config['ipsec']['ipcomp']);
if ($_POST) {
@@ -56,15 +53,11 @@ if ($_POST) {
}
} else if ($_POST['submit']) {
$pconfig = $_POST;
-
+
$config['ipsec']['enable'] = $_POST['enable'] ? true : false;
- $config['ipsec']['preferredoldsa'] = $_POST['preferredoldsa'] ? true : false;
- $config['ipsec']['ipcomp'] = $_POST['ipcomp'] ? true : false;
- if($_POST['interface'] <> "")
- $config['ipsec']['interface'] = $_POST['interface'];
-
+
write_config();
-
+
$retval = 0;
if (!file_exists($d_sysrebootreqd_path)) {
config_lock();
@@ -89,17 +82,7 @@ if ($_GET['act'] == "del") {
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("VPN: IPsec");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">VPN: IPsec</p>
<form action="vpn_ipsec.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_ipsecconfdirty_path)): ?><p>
@@ -107,35 +90,24 @@ if ($_GET['act'] == "del") {
<input name="apply" type="submit" class="formbtn" id="apply" value="Apply changes"></p>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
<li class="tabact">Tunnels</li>
<li class="tabinact"><a href="vpn_ipsec_mobile.php">Mobile clients</a></li>
<li class="tabinact"><a href="vpn_ipsec_keys.php">Pre-shared keys</a></li>
+ <li class="tabinact"><a href="vpn_ipsec_ca.php">CAs</a></li>
</ul>
</td></tr>
- <tr>
+ <tr>
<td class="tabcont">
- <table width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td class="vtable"><p><span class="vexpl"> </span>
- <input name="enable" type="checkbox" id="enable" value="yes" <?php if ($pconfig['enable'] == "yes") echo "checked";?>>
- <strong>Enable IPsec<br>
- </strong></p>
- </td>
- <td class="vtable"><p><span class="vexpl"> </span>
- <input name="preferredoldsa" type="checkbox" id="preferredoldsa" value="yes" <?php if ($pconfig['preferredoldsa'] == "yes") echo "checked";?>>
- <strong>Prefer newer SA's.<br>
- </strong></p>
- </td>
- <td class="vtable"><p><span class="vexpl"> </span>
- <input name="ipcomp" type="checkbox" id="ipcomp" value="yes" <?php if ($pconfig['ipcomp'] == "yes") echo "checked";?>>
- <strong>Enable VPN IP Compression<br>
- </strong></p>
- </td>
- </tr>
- <tr>
- <td> <input name="submit" type="submit" class="formbtn" value="Save">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td class="vtable">
+ <input name="enable" type="checkbox" id="enable" value="yes" <?php if ($pconfig['enable']) echo "checked";?>>
+ <strong>Enable IPsec</strong></td>
+ </tr>
+ <tr>
+ <td> <input name="submit" type="submit" class="formbtn" value="Save">
</td>
</tr>
</table>
@@ -160,7 +132,7 @@ if ($_GET['act'] == "del") {
}
?>
<tr valign="top">
- <td nowrap class="listlr" ondblclick="document.location='vpn_ipsec_edit.php?id=<?=$i;?>';"><?=$spans;?>
+ <td nowrap class="listlr"><?=$spans;?>
<?php if ($ipsecent['local-subnet']['network'])
echo strtoupper($ipsecent['local-subnet']['network']);
else
@@ -169,7 +141,7 @@ if ($_GET['act'] == "del") {
<br>
<?=$ipsecent['remote-subnet'];?>
<?=$spane;?></td>
- <td class="listr" ondblclick="document.location='vpn_ipsec_edit.php?id=<?=$i;?>';"><?=$spans;?>
+ <td class="listr"><?=$spans;?>
<?php if ($ipsecent['interface']) {
$iflabels = array('lan' => 'LAN', 'wan' => 'WAN');
for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++)
@@ -177,47 +149,33 @@ if ($_GET['act'] == "del") {
$if = htmlspecialchars($iflabels[$ipsecent['interface']]);
} else
$if = "WAN";
-
+
echo $if . "<br>" . $ipsecent['remote-gateway'];
?>
<?=$spane;?></td>
- <td class="listr" ondblclick="document.location='vpn_ipsec_edit.php?id=<?=$i;?>';"><?=$spans;?>
+ <td class="listr"><?=$spans;?>
<?=$ipsecent['p1']['mode'];?>
<?=$spane;?></td>
- <td class="listr" ondblclick="document.location='vpn_ipsec_edit.php?id=<?=$i;?>';"><?=$spans;?>
+ <td class="listr"><?=$spans;?>
<?=$p1_ealgos[$ipsecent['p1']['encryption-algorithm']];?>
<?=$spane;?></td>
- <td class="listr" ondblclick="document.location='vpn_ipsec_edit.php?id=<?=$i;?>';"><?=$spans;?>
+ <td class="listr"><?=$spans;?>
<?=$p1_halgos[$ipsecent['p1']['hash-algorithm']];?>
<?=$spane;?></td>
- <td class="listbg" ondblclick="document.location='vpn_ipsec_edit.php?id=<?=$i;?>';"><?=$spans;?>
- <font color="#FFFFFF"><?=htmlspecialchars($ipsecent['descr']);?>&nbsp;
+ <td class="listbg"><?=$spans;?>
+ <?=htmlspecialchars($ipsecent['descr']);?>&nbsp;
<?=$spane;?></td>
- <td valign="middle" nowrap class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="vpn_ipsec_edit.php?id=<?=$i;?>"><img src="e.gif" width="17" height="17" border="0"></a></td>
- <td valign="middle"><a href="vpn_ipsec.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this tunnel?')"><img src="x.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
- <?php $i++; endforeach; ?>
- <tr>
+ <td valign="middle" nowrap class="list"> <a href="vpn_ipsec_edit.php?id=<?=$i;?>"><img src="e.gif" title="edit tunnel" width="17" height="17" border="0"></a>
+ &nbsp;<a href="vpn_ipsec.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this tunnel?')"><img src="x.gif" title="delete tunnel" width="17" height="17" border="0"></a></td>
+ </tr>
+ <?php $i++; endforeach; ?>
+ <tr>
<td class="list" colspan="6"></td>
- <td class="list">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td valign="middle"><a href="vpn_ipsec_edit.php"><img src="plus.gif" width="17" height="17" border="0"></a></td>
- </tr>
- </table>
- </td>
- </tr>
+ <td class="list"> <a href="vpn_ipsec_edit.php"><img src="plus.gif" title="add tunnel" width="17" height="17" border="0"></a></td>
+ </tr>
</table>
- </td>
+ </td>
</tr>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
OpenPOWER on IntegriCloud