From e24118864179ac426ca9c9105263be7a3b9cfdc0 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 21 Jun 2005 23:30:39 +0000 Subject: Import m0n0wall ipsec cert code --- usr/local/www/vpn_ipsec.php | 120 ++++++++++++++------------------------------ 1 file changed, 39 insertions(+), 81 deletions(-) (limited to 'usr/local/www/vpn_ipsec.php') 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 . All rights reserved. - - originally part of m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2004 Manuel Kasper . - 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") { } } ?> - - - -<?=gentitle("VPN: IPsec");?> - - - - - -

VPN: IPsec

@@ -107,35 +90,24 @@ if ($_GET['act'] == "del") {

- - + +
+
- - - - - - - - - - - - - - - - - - + + + + - - + +

- > - Enable IPsec
-

-

- > - Prefer newer SA's.
-

-

- > - Enable VPN IP Compression
-

-
+ + + + + +
+ > + Enable IPsec
@@ -160,7 +132,7 @@ if ($_GET['act'] == "del") { } ?>
+ + '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 . "
" . $ipsecent['remote-gateway']; ?>
+ + + -   + +   - - - - - -
-
+  
- - - - -
-
-
- - -- cgit v1.1