Project

General

Profile

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