Project

General

Profile

Download (4.39 KB) Statistics
| Branch: | Tag: | Revision:
1 eb183863 Ermal
<?php
2
/* $Id$ */
3
/*
4
	diag_ipsec_leases.php
5
	Copyright (C) 2014 Ermal LUÇi
6 6317d31d Phil Davis
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
7 eb183863 Ermal
	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
/*
32
	pfSense_BUILDER_BINARIES:	/usr/local/sbin/ipsec
33
	pfSense_MODULE:	ipsec
34
*/
35
36
##|+PRIV
37
##|*IDENT=page-status-ipsec-leases
38
##|*NAME=Status: IPsec: Leases page
39
##|*DESCR=Allow access to the 'Status: IPsec: Leases' page.
40
##|*MATCH=diag_ipsec_leases.php*
41
##|-PRIV
42
43
require("guiconfig.inc");
44
require("ipsec.inc");
45
46
$pgtitle = array(gettext("Status"),gettext("IPsec"),gettext("Leases"));
47
$shortcut_section = "ipsec";
48
include("head.inc");
49
50
$mobile = ipsec_dump_mobile();
51
52
?>
53
54
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
55
	<?php include("fbegin.inc"); ?>
56
	<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="status ipsec sad">
57
		<tr>
58
			<td>
59
				<?php
60
					$tab_array = array();
61
					$tab_array[0] = array(gettext("Overview"), false, "diag_ipsec.php");
62
					$tab_array[1] = array(gettext("Leases"), true, "diag_ipsec_leases.php");
63
					$tab_array[2] = array(gettext("SAD"), false, "diag_ipsec_sad.php");
64
					$tab_array[3] = array(gettext("SPD"), false, "diag_ipsec_spd.php");
65
					$tab_array[4] = array(gettext("Logs"), false, "diag_logs_ipsec.php");
66
					display_top_tabs($tab_array);
67
				?>
68
			</td>
69
		</tr>
70
		<tr>
71
			<td>
72
				<div id="mainarea">
73 93ee78b7 Renato Botelho
				<?php if (isset($mobile['pool']) && is_array($mobile['pool'])): ?>
74
					<?php foreach($mobile['pool'] as $pool): ?>
75
						<table class="tabcont sortable" width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
76
							<tr>
77
								<td colspan="4" valign="top" class="listtopic">
78
								<?php
79
									echo gettext("Pool: ") . $pool['name'];
80
									echo ' ' . gettext("usage: ") . $pool['usage'];
81
									echo ' ' . gettext("online: ") . $pool['online'];
82
								?>
83
								</td>
84
							</tr>
85
							<?php if (is_array($pool['lease']) && count($pool['lease']) > 0): ?>
86
							<tr>
87
								<td class="listhdrr nowrap"><?=gettext("ID");?></td>
88
								<td class="listhdrr nowrap"><?=gettext("Host");?></td>
89
								<td class="listhdrr nowrap"><?=gettext("Status");?></td>
90
								<td class="list nowrap"></td>
91
							</tr>
92
							<?php foreach ($pool['lease'] as $lease): ?>
93
							<tr>
94
								<td class="listlr"><?=htmlspecialchars($lease['id']);?></td>
95
								<td class="listr"><?=htmlspecialchars($lease['host']);?></td>
96
								<td class="listr"><?=htmlspecialchars($lease['status']);?></td>
97
								<td class="list nowrap">
98
								</td>
99
							</tr>
100
							<?php endforeach;
101
							else: ?>
102
							<tr>
103
								<td>
104
									<p><strong><?=gettext("No leases from this pool yet.");?></strong></p>
105
								</td>
106
							</tr>
107
							<?php endif; ?>
108
						</table>
109
					<?php endforeach; ?>
110
				<?php else: ?>
111 eb183863 Ermal
					<table class="tabcont sortable" width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
112
						<tr>
113
							<td>
114 93ee78b7 Renato Botelho
								<p><strong><?=gettext("No IPsec pools.");?></strong></p>
115 eb183863 Ermal
							</td>
116
						</tr>
117
					</table>
118 93ee78b7 Renato Botelho
				<?php endif; ?>
119 eb183863 Ermal
				</div>
120
			</td>
121
		</tr>
122
	</table>
123
124
<p class="vexpl">
125
<span class="red"><strong><?=gettext("Note:");?><br /></strong></span>
126
<?=gettext("You can configure your IPsec");?> <a href="vpn_ipsec.php"><?=gettext("here.");?></a>
127
</p>
128
129
<?php include("fend.inc"); ?>
130
</body>
131
</html>