1 |
5b237745
|
Scott Ullrich
|
#!/usr/local/bin/php
|
2 |
|
|
<?php
|
3 |
|
|
/*
|
4 |
|
|
vpn_ipsec_keys.php
|
5 |
|
|
part of m0n0wall (http://m0n0.ch/wall)
|
6 |
|
|
|
7 |
e2411886
|
Scott Ullrich
|
Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
|
8 |
5b237745
|
Scott Ullrich
|
All rights reserved.
|
9 |
|
|
|
10 |
|
|
Redistribution and use in source and binary forms, with or without
|
11 |
|
|
modification, are permitted provided that the following conditions are met:
|
12 |
|
|
|
13 |
|
|
1. Redistributions of source code must retain the above copyright notice,
|
14 |
|
|
this list of conditions and the following disclaimer.
|
15 |
|
|
|
16 |
|
|
2. Redistributions in binary form must reproduce the above copyright
|
17 |
|
|
notice, this list of conditions and the following disclaimer in the
|
18 |
|
|
documentation and/or other materials provided with the distribution.
|
19 |
|
|
|
20 |
|
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
21 |
|
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
22 |
|
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
23 |
|
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
24 |
|
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
25 |
|
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
26 |
|
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
27 |
|
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
28 |
|
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
29 |
|
|
POSSIBILITY OF SUCH DAMAGE.
|
30 |
|
|
*/
|
31 |
|
|
|
32 |
|
|
require("guiconfig.inc");
|
33 |
|
|
|
34 |
|
|
if (!is_array($config['ipsec']['mobilekey'])) {
|
35 |
|
|
$config['ipsec']['mobilekey'] = array();
|
36 |
|
|
}
|
37 |
|
|
ipsec_mobilekey_sort();
|
38 |
|
|
$a_secret = &$config['ipsec']['mobilekey'];
|
39 |
|
|
|
40 |
|
|
if ($_GET['act'] == "del") {
|
41 |
|
|
if ($a_secret[$_GET['id']]) {
|
42 |
|
|
unset($a_secret[$_GET['id']]);
|
43 |
|
|
write_config();
|
44 |
|
|
touch($d_ipsecconfdirty_path);
|
45 |
|
|
header("Location: vpn_ipsec_keys.php");
|
46 |
|
|
exit;
|
47 |
|
|
}
|
48 |
|
|
}
|
49 |
|
|
|
50 |
b128368a
|
Bill Marquette
|
$pgtitle = "VPN: IPsec: Keys";
|
51 |
4df96eff
|
Scott Ullrich
|
include("head.inc");
|
52 |
|
|
|
53 |
5b237745
|
Scott Ullrich
|
?>
|
54 |
422f27c0
|
Scott Ullrich
|
|
55 |
|
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
56 |
5b237745
|
Scott Ullrich
|
<?php include("fbegin.inc"); ?>
|
57 |
b128368a
|
Bill Marquette
|
<p class="pgtitle"><?=$pgtitle?></p>
|
58 |
5b237745
|
Scott Ullrich
|
<form action="vpn_ipsec.php" method="post">
|
59 |
|
|
<?php if ($savemsg) print_info_box($savemsg); ?>
|
60 |
|
|
<?php if (file_exists($d_ipsecconfdirty_path)): ?><p>
|
61 |
|
|
<?php print_info_box_np("The IPsec tunnel configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
|
62 |
|
|
<?php endif; ?>
|
63 |
323d040b
|
Scott Ullrich
|
<div id="mainarea">
|
64 |
5b237745
|
Scott Ullrich
|
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
65 |
e2411886
|
Scott Ullrich
|
<tr><td class="tabnavtbl">
|
66 |
323d040b
|
Scott Ullrich
|
<?php
|
67 |
|
|
$tab_array = array();
|
68 |
|
|
$tab_array[0] = array("Tunnels", false, "vpn_ipsec.php");
|
69 |
|
|
$tab_array[1] = array("Mobile clients", false, "vpn_ipsec_mobile.php");
|
70 |
|
|
$tab_array[2] = array("Pre-shared keys", true, "vpn_ipsec_keys.php");
|
71 |
|
|
$tab_array[3] = array("CAs", false, "vpn_ipsec_ca.php");
|
72 |
|
|
display_top_tabs($tab_array);
|
73 |
|
|
?>
|
74 |
5b237745
|
Scott Ullrich
|
</td></tr>
|
75 |
|
|
<tr>
|
76 |
|
|
<td class="tabcont">
|
77 |
|
|
<table width="80%" border="0" cellpadding="0" cellspacing="0">
|
78 |
|
|
<tr>
|
79 |
|
|
<td class="listhdrr">Identifier</td>
|
80 |
|
|
<td class="listhdr">Pre-shared key</td>
|
81 |
|
|
<td class="list"></td>
|
82 |
|
|
</tr>
|
83 |
|
|
<?php $i = 0; foreach ($a_secret as $secretent): ?>
|
84 |
|
|
<tr>
|
85 |
e2411886
|
Scott Ullrich
|
<td class="listlr">
|
86 |
5b237745
|
Scott Ullrich
|
<?=htmlspecialchars($secretent['ident']);?>
|
87 |
|
|
</td>
|
88 |
e2411886
|
Scott Ullrich
|
<td class="listr">
|
89 |
5b237745
|
Scott Ullrich
|
<?=htmlspecialchars($secretent['pre-shared-key']);?>
|
90 |
|
|
</td>
|
91 |
e2411886
|
Scott Ullrich
|
<td class="list" nowrap> <a href="vpn_ipsec_keys_edit.php?id=<?=$i;?>"><img src="e.gif" title="edit key" width="17" height="17" border="0"></a>
|
92 |
|
|
<a href="vpn_ipsec_keys.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this pre-shared key?')"><img src="x.gif" title="delete key" width="17" height="17" border="0"></a></td>
|
93 |
|
|
</tr>
|
94 |
|
|
<?php $i++; endforeach; ?>
|
95 |
5b237745
|
Scott Ullrich
|
<tr>
|
96 |
|
|
<td class="list" colspan="2"></td>
|
97 |
e2411886
|
Scott Ullrich
|
<td class="list"> <a href="vpn_ipsec_keys_edit.php"><img src="plus.gif" title="add key" width="17" height="17" border="0"></a></td>
|
98 |
|
|
</tr>
|
99 |
5b237745
|
Scott Ullrich
|
</table>
|
100 |
e2411886
|
Scott Ullrich
|
</td>
|
101 |
|
|
</tr>
|
102 |
|
|
</table>
|
103 |
323d040b
|
Scott Ullrich
|
</div>
|
104 |
5b237745
|
Scott Ullrich
|
</form>
|
105 |
|
|
<?php include("fend.inc"); ?>
|
106 |
323d040b
|
Scott Ullrich
|
<script type="text/javascript">
|
107 |
|
|
NiftyCheck();
|
108 |
|
|
Rounded("div#mainarea","bl br","#FFF","#eeeeee","smooth");
|
109 |
|
|
</script>
|
110 |
|
|
|
111 |
|
|
</body>
|
112 |
b128368a
|
Bill Marquette
|
</html>
|