1
|
<?php
|
2
|
/*
|
3
|
vpn_ipsec_ca.php
|
4
|
part of m0n0wall (http://m0n0.ch/wall)
|
5
|
|
6
|
Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
|
7
|
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
|
##|+PRIV
|
32
|
##|*IDENT=page-vpn-ipsec-certificateauthority
|
33
|
##|*NAME=VPN: IPsec: Certificate Authority page
|
34
|
##|*DESCR=Allow access to the 'VPN: IPsec: Certificate Authority' page.
|
35
|
##|*MATCH=vpn_ipsec_ca.php*
|
36
|
##|-PRIV
|
37
|
|
38
|
|
39
|
require("guiconfig.inc");
|
40
|
|
41
|
if (!is_array($config['ipsec']['cacert'])) {
|
42
|
$config['ipsec']['cacert'] = array();
|
43
|
}
|
44
|
ipsec_ca_sort();
|
45
|
$a_secret = &$config['ipsec']['cacert'];
|
46
|
|
47
|
if ($_GET['act'] == "del") {
|
48
|
if ($a_secret[$_GET['id']]) {
|
49
|
unset($a_secret[$_GET['id']]);
|
50
|
write_config();
|
51
|
touch($d_ipsecconfdirty_path);
|
52
|
header("Location: vpn_ipsec_ca.php");
|
53
|
exit;
|
54
|
}
|
55
|
}
|
56
|
|
57
|
$pgtitle = array("VPN","IPsec","Certificate Authority");
|
58
|
include("head.inc");
|
59
|
|
60
|
?>
|
61
|
|
62
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
63
|
<?php include("fbegin.inc"); ?>
|
64
|
<form action="vpn_ipsec.php" method="post">
|
65
|
<?php
|
66
|
if ($savemsg)
|
67
|
print_info_box($savemsg);
|
68
|
if ($pconfig['enable'] && file_exists($d_ipsecconfdirty_path))
|
69
|
print_info_box_np("The IPsec tunnel configuration has been changed.<br>You must apply the changes in order for them to take effect.");
|
70
|
?>
|
71
|
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
72
|
<tr><td>
|
73
|
<?php
|
74
|
$tab_array = array();
|
75
|
$tab_array[0] = array("Tunnels", false, "vpn_ipsec.php");
|
76
|
$tab_array[1] = array("Mobile clients", false, "vpn_ipsec_mobile.php");
|
77
|
$tab_array[2] = array("CAs", true, "vpn_ipsec_ca.php");
|
78
|
display_top_tabs($tab_array);
|
79
|
?>
|
80
|
</td></tr>
|
81
|
<tr>
|
82
|
<td>
|
83
|
<div id="mainarea">
|
84
|
<table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
|
85
|
<tr>
|
86
|
<td class="listhdrr">Identifier</td>
|
87
|
<td class="list"></td>
|
88
|
</tr>
|
89
|
<?php $i = 0; foreach ($a_secret as $secretent): ?>
|
90
|
<tr>
|
91
|
<td class="listlr">
|
92
|
<?=htmlspecialchars($secretent['ident']);?>
|
93
|
</td>
|
94
|
<td class="list" nowrap> <a href="vpn_ipsec_ca_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="edit certificate" width="17" height="17" border="0"></a>
|
95
|
<a href="vpn_ipsec_ca.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this certificate?')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="delete certificate" width="17" height="17" border="0"></a></td>
|
96
|
</tr>
|
97
|
<?php $i++; endforeach; ?>
|
98
|
<tr>
|
99
|
<td class="list"></td>
|
100
|
<td class="list"> <a href="vpn_ipsec_ca_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
|
101
|
</tr>
|
102
|
</table>
|
103
|
</div>
|
104
|
</td>
|
105
|
</tr>
|
106
|
</table>
|
107
|
</form>
|
108
|
<?php include("fend.inc"); ?>
|
109
|
</body>
|
110
|
</html>
|