Project

General

Profile

Download (4.03 KB) Statistics
| Branch: | Tag: | Revision:
1 e2411886 Scott Ullrich
#!/usr/local/bin/php
2
<?php
3
/*
4
	vpn_ipsec_ca.php
5
	part of m0n0wall (http://m0n0.ch/wall)
6
	
7
	Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
8
	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']['cacert'])) {
35
	$config['ipsec']['cacert'] = array();
36
}
37
ipsec_ca_sort();
38
$a_secret = &$config['ipsec']['cacert'];
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_ca.php");
46
		exit;
47
	}
48
}
49
50 b128368a Bill Marquette
$pgtitle = "VPN: IPsec: Certificate Authority";
51 4df96eff Scott Ullrich
include("head.inc");
52
53 e2411886 Scott Ullrich
?>
54 4df96eff Scott Ullrich
55 422f27c0 Scott Ullrich
56
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
57 e2411886 Scott Ullrich
<?php include("fbegin.inc"); ?>
58 b128368a Bill Marquette
<p class="pgtitle"><?=$pgtitle?></p>
59 e2411886 Scott Ullrich
<form action="vpn_ipsec.php" method="post">
60
<?php if ($savemsg) print_info_box($savemsg); ?>
61
<?php if (file_exists($d_ipsecconfdirty_path)): ?><p>
62
<?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>
63
<?php endif; ?>
64
<table width="100%" border="0" cellpadding="0" cellspacing="0">
65
  <tr><td>
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", false, "vpn_ipsec_keys.php");
71
	$tab_array[3] = array("CAs", true, "vpn_ipsec_ca.php");
72 83c5299b Scott Ullrich
	$tab_array[4] = array("Failover IPSEC", false, "/pkg_edit.php?xml=sasyncd.xml&id=0");
73 323d040b Scott Ullrich
	display_top_tabs($tab_array);
74
?>
75 e2411886 Scott Ullrich
  </td></tr>
76
  <tr> 
77 0f10aee4 Bill Marquette
    <td>
78
       <div id="mainarea">
79
              <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
80 e2411886 Scott Ullrich
                <tr> 
81
                  <td class="listhdrr">Identifier</td>
82
                  <td class="list"></td>
83
				</tr>
84
			  <?php $i = 0; foreach ($a_secret as $secretent): ?>
85
                <tr> 
86
                  <td class="listlr">
87
                    <?=htmlspecialchars($secretent['ident']);?>
88
                  </td>
89 677c0869 Erik Kristensen
                  <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>
90
                     &nbsp;<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>
91 e2411886 Scott Ullrich
				</tr>
92
			  <?php $i++; endforeach; ?>
93
                <tr> 
94
                  <td class="list"></td>
95 677c0869 Erik Kristensen
                  <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>
96 e2411886 Scott Ullrich
				</tr>
97
              </table>
98 0f10aee4 Bill Marquette
	</div>
99
    </td>
100
  </tr>
101
</table>
102 e2411886 Scott Ullrich
</form>
103
<?php include("fend.inc"); ?>
104 323d040b Scott Ullrich
</body>
105
</html>