Project

General

Profile

Download (4.34 KB) Statistics
| Branch: | Tag: | Revision:

univnautes / usr / local / www / diag_ipsec_leases.php @ a1b66bec

1
<?php
2
/* $Id$ */
3
/*
4
	diag_ipsec_leases.php
5
	Copyright (C) 2014 Ermal LUÇi
6
	All rights reserved.
7

    
8
	Redistribution and use in source and binary forms, with or without
9
	modification, are permitted provided that the following conditions are met:
10

    
11
	1. Redistributions of source code must retain the above copyright notice,
12
	   this list of conditions and the following disclaimer.
13

    
14
	2. Redistributions in binary form must reproduce the above copyright
15
	   notice, this list of conditions and the following disclaimer in the
16
	   documentation and/or other materials provided with the distribution.
17

    
18
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
19
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
20
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
22
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
	POSSIBILITY OF SUCH DAMAGE.
28
*/
29

    
30
/*
31
	pfSense_BUILDER_BINARIES:	/usr/local/sbin/ipsec
32
	pfSense_MODULE:	ipsec
33
*/
34

    
35
##|+PRIV
36
##|*IDENT=page-status-ipsec-leases
37
##|*NAME=Status: IPsec: Leases page
38
##|*DESCR=Allow access to the 'Status: IPsec: Leases' page.
39
##|*MATCH=diag_ipsec_leases.php*
40
##|-PRIV
41

    
42
require("guiconfig.inc");
43
require("ipsec.inc");
44

    
45
$pgtitle = array(gettext("Status"),gettext("IPsec"),gettext("Leases"));
46
$shortcut_section = "ipsec";
47
include("head.inc");
48

    
49
$mobile = ipsec_dump_mobile();
50

    
51
?>
52

    
53
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
54
	<?php include("fbegin.inc"); ?>
55
	<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="status ipsec sad">
56
		<tr>
57
			<td>
58
				<?php
59
					$tab_array = array();
60
					$tab_array[0] = array(gettext("Overview"), false, "diag_ipsec.php");
61
					$tab_array[1] = array(gettext("Leases"), true, "diag_ipsec_leases.php");
62
					$tab_array[2] = array(gettext("SAD"), false, "diag_ipsec_sad.php");
63
					$tab_array[3] = array(gettext("SPD"), false, "diag_ipsec_spd.php");
64
					$tab_array[4] = array(gettext("Logs"), false, "diag_logs_ipsec.php");
65
					display_top_tabs($tab_array);
66
				?>
67
			</td>
68
		</tr>
69
		<tr>
70
			<td>
71
				<div id="mainarea">
72
				<?php if (isset($mobile['pool']) && is_array($mobile['pool'])): ?>
73
					<?php foreach($mobile['pool'] as $pool): ?>
74
						<table class="tabcont sortable" width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
75
							<tr>
76
								<td colspan="4" valign="top" class="listtopic">
77
								<?php
78
									echo gettext("Pool: ") . $pool['name'];
79
									echo ' ' . gettext("usage: ") . $pool['usage'];
80
									echo ' ' . gettext("online: ") . $pool['online'];
81
								?>
82
								</td>
83
							</tr>
84
							<?php if (is_array($pool['lease']) && count($pool['lease']) > 0): ?>
85
							<tr>
86
								<td class="listhdrr nowrap"><?=gettext("ID");?></td>
87
								<td class="listhdrr nowrap"><?=gettext("Host");?></td>
88
								<td class="listhdrr nowrap"><?=gettext("Status");?></td>
89
								<td class="list nowrap"></td>
90
							</tr>
91
							<?php foreach ($pool['lease'] as $lease): ?>
92
							<tr>
93
								<td class="listlr"><?=htmlspecialchars($lease['id']);?></td>
94
								<td class="listr"><?=htmlspecialchars($lease['host']);?></td>
95
								<td class="listr"><?=htmlspecialchars($lease['status']);?></td>
96
								<td class="list nowrap">
97
								</td>
98
							</tr>
99
							<?php endforeach;
100
							else: ?>
101
							<tr>
102
								<td>
103
									<p><strong><?=gettext("No leases from this pool yet.");?></strong></p>
104
								</td>
105
							</tr>
106
							<?php endif; ?>
107
						</table>
108
					<?php endforeach; ?>
109
				<?php else: ?>
110
					<table class="tabcont sortable" width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
111
						<tr>
112
							<td>
113
								<p><strong><?=gettext("No IPsec pools.");?></strong></p>
114
							</td>
115
						</tr>
116
					</table>
117
				<?php endif; ?>
118
				</div>
119
			</td>
120
		</tr>
121
	</table>
122

    
123
<p class="vexpl">
124
<span class="red"><strong><?=gettext("Note:");?><br /></strong></span>
125
<?=gettext("You can configure your IPsec");?> <a href="vpn_ipsec.php"><?=gettext("here.");?></a>
126
</p>
127

    
128
<?php include("fend.inc"); ?>
129
</body>
130
</html>
(15-15/256)