Project

General

Profile

Download (16.6 KB) Statistics
| Branch: | Tag: | Revision:
1 cf7d1057 Scott Ullrich
<?php
2
/* $Id$ */
3
/*
4
	diag_ipsec.php
5 13d193c2 Scott Ullrich
	Copyright (C) 2004-2009 Scott Ullrich
6 a93e56c5 Matthew Grooms
	Copyright (C) 2008 Shrew Soft Inc <mgrooms@shrew.net>.
7 6317d31d Phil Davis
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
8 cf7d1057 Scott Ullrich
	All rights reserved.
9
10
	Parts of this code was originally based on vpn_ipsec_sad.php
11
	Copyright (C) 2003-2004 Manuel Kasper
12
13
	Redistribution and use in source and binary forms, with or without
14
	modification, are permitted provided that the following conditions are met:
15
16
	1. Redistributions of source code must retain the above copyright notice,
17
	   this list of conditions and the following disclaimer.
18
19
	2. Redistributions in binary form must reproduce the above copyright
20
	   notice, this list of conditions and the following disclaimer in the
21
	   documentation and/or other materials provided with the distribution.
22
23
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
24
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
25
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
27
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
	POSSIBILITY OF SUCH DAMAGE.
33
*/
34
35 13d193c2 Scott Ullrich
/*
36
	pfSense_MODULE:	ipsec
37
*/
38
39 6b07c15a Matthew Grooms
##|+PRIV
40
##|*IDENT=page-status-ipsec
41
##|*NAME=Status: IPsec page
42
##|*DESCR=Allow access to the 'Status: IPsec' page.
43
##|*MATCH=diag_ipsec.php*
44
##|-PRIV
45
46
47 a93e56c5 Matthew Grooms
global $g;
48
49 f8ec8de4 Renato Botelho
$pgtitle = array(gettext("Status"),gettext("IPsec"));
50 b32dd0a6 jim-p
$shortcut_section = "ipsec";
51 cf7d1057 Scott Ullrich
52
require("guiconfig.inc");
53
include("head.inc");
54 483e6de8 Scott Ullrich
require("ipsec.inc");
55 a93e56c5 Matthew Grooms
56 17402c63 Ermal
if ($_GET['act'] == 'connect') {
57
	if (ctype_digit($_GET['ikeid'])) {
58 fe2e680b Ermal LUÇI
		$ph1ent = ipsec_get_phase1($_GET['ikeid']);
59
		if (!empty($ph1ent)) {
60 6e26b9c5 Phil Davis
			if (empty($ph1ent['iketype']) || $ph1ent['iketype'] == 'ikev1') {
61 fe2e680b Ermal LUÇI
				$ph2entries = ipsec_get_number_of_phase2($_GET['ikeid']);
62
				for ($i = 0; $i < $ph2entries; $i++) {
63
					$connid = escapeshellarg("con{$_GET['ikeid']}00{$i}");
64
					mwexec("/usr/local/sbin/ipsec down {$connid}");
65
					mwexec("/usr/local/sbin/ipsec up {$connid}");
66
				}
67
			} else {
68
				mwexec("/usr/local/sbin/ipsec down con" . escapeshellarg($_GET['ikeid']));
69
				mwexec("/usr/local/sbin/ipsec up con" . escapeshellarg($_GET['ikeid']));
70
			}
71
		}
72 6e8b0ec3 jim-p
	}
73 17402c63 Ermal
} else if ($_GET['act'] == 'ikedisconnect') {
74
	if (ctype_digit($_GET['ikeid'])) {
75 e952906e Ermal
		if (!empty($_GET['ikesaid']) && ctype_digit($_GET['ikesaid']))
76
			mwexec("/usr/local/sbin/ipsec down con" . escapeshellarg($_GET['ikeid']) . "[" . escapeshellarg($_GET['ikesaid']) . "]");
77
		else
78
			mwexec("/usr/local/sbin/ipsec down con" . escapeshellarg($_GET['ikeid']));
79 614be051 bcyrill
	}
80 e952906e Ermal
} else if ($_GET['act'] == 'childdisconnect') {
81
	if (ctype_digit($_GET['ikeid'])) {
82
		if (!empty($_GET['ikesaid']) && ctype_digit($_GET['ikesaid']))
83
			mwexec("/usr/local/sbin/ipsec down con" . escapeshellarg($_GET['ikeid']) . "{" . escapeshellarg($_GET['ikesaid']) . "}");
84 6e0b68bf jim-p
	}
85
}
86
87 fd875a8d Ermal
if (!is_array($config['ipsec']['phase1']))
88
    $config['ipsec']['phase1'] = array();
89 a93e56c5 Matthew Grooms
90 fd875a8d Ermal
$a_phase1 = &$config['ipsec']['phase1'];
91 a93e56c5 Matthew Grooms
92 df0878b0 Ermal
$status = ipsec_smp_dump_status();
93 a93e56c5 Matthew Grooms
94 cf7d1057 Scott Ullrich
?>
95
96 6e0b68bf jim-p
<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?php echo $jsevents["body"]["onload"]; ?>">
97 cf7d1057 Scott Ullrich
<?php include("fbegin.inc"); ?>
98
<div id="inputerrors"></div>
99 a8590dd6 Colin Fleming
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="status ipsec">
100 cf7d1057 Scott Ullrich
	<tr>
101 a93e56c5 Matthew Grooms
		<td>
102 6795e0da Renato Botelho
<?php
103
			$tab_array = array();
104
			$tab_array[0] = array(gettext("Overview"), true, "diag_ipsec.php");
105
			$tab_array[1] = array(gettext("Leases"), false, "diag_ipsec_leases.php");
106
			$tab_array[2] = array(gettext("SAD"), false, "diag_ipsec_sad.php");
107
			$tab_array[3] = array(gettext("SPD"), false, "diag_ipsec_spd.php");
108
			$tab_array[4] = array(gettext("Logs"), false, "diag_logs_ipsec.php");
109
			display_top_tabs($tab_array);
110
?>
111 331aa57b Scott Ullrich
		</td>
112 cf7d1057 Scott Ullrich
	</tr>
113 a93e56c5 Matthew Grooms
	<tr>
114 6795e0da Renato Botelho
		<td>
115
		<div id="mainarea">
116 a8590dd6 Colin Fleming
		<table width="100%" border="0" cellpadding="6" cellspacing="0" class="tabcont sortable" summary="status">
117 c7fbdd6c Ermal
		<thead>
118
			<tr>
119 a8590dd6 Colin Fleming
				<th class="listhdrr nowrap"><?php echo gettext("Description");?></th>
120
				<th class="listhdrr nowrap"><?php echo gettext("Local ID");?></th>
121
				<th class="listhdrr nowrap"><?php echo gettext("Local IP");?></th>
122
				<th class="listhdrr nowrap"><?php echo gettext("Remote ID");?></th>
123
				<th class="listhdrr nowrap"><?php echo gettext("Remote IP");?></th>
124
				<th class="listhdrr nowrap"><?php echo gettext("Role");?></th>
125 fe0430f7 Ermal
				<th class="listhdrr nowrap"><?php echo gettext("Reauth");?></th>
126 6da9a160 Ermal
				<th class="listhdrr nowrap"><?php echo gettext("Algo");?></th>
127 a8590dd6 Colin Fleming
				<th class="listhdrr nowrap"><?php echo gettext("Status");?></th>
128 6795e0da Renato Botelho
				<th class="list nowrap"></th>
129
			</tr>
130 c7fbdd6c Ermal
		</thead>
131
		<tbody>
132
<?php
133 fd875a8d Ermal
	$ipsecconnected = array();
134 6795e0da Renato Botelho
	if (is_array($status['query']) && is_array($status['query']['ikesalist']) && is_array($status['query']['ikesalist']['ikesa'])):
135
		foreach ($status['query']['ikesalist']['ikesa'] as $ikeid => $ikesa):
136 55d6f48b Renato Botelho
			$con_id = substr($ikesa['peerconfig'], 3);
137 0314cbf4 Ermal LUÇI
			if ($ikesa['version'] == 1) {
138
				$ph1idx = substr($con_id, 0, strrpos(substr($con_id, 0, -1), '00'));
139
				$ipsecconnected[$ph1idx] = $ph1idx;
140 5afffea4 Ermal LUÇI
			} else {
141
				$ipsecconnected[$con_id] = $ph1idx = $con_id;
142
			}
143 55d6f48b Renato Botelho
144 6795e0da Renato Botelho
			if (ipsec_phase1_status($status['query']['ikesalist']['ikesa'], $ikesa['id']))
145 17402c63 Ermal
				$icon = "pass";
146 6795e0da Renato Botelho
			elseif (!isset($config['ipsec']['enable']))
147 17402c63 Ermal
				$icon = "block";
148 6795e0da Renato Botelho
			else
149 17402c63 Ermal
				$icon = "reject";
150 c7fbdd6c Ermal
?>
151
			<tr>
152
				<td class="listlr">
153 6795e0da Renato Botelho
<?php
154 5afffea4 Ermal LUÇI
					echo htmlspecialchars(ipsec_get_descr($ph1idx));
155 6795e0da Renato Botelho
?>
156 c7fbdd6c Ermal
				</td>
157
				<td class="listr">
158 6795e0da Renato Botelho
<?php
159
				if (!is_array($ikesa['local']))
160 d6c9dcf9 Renato Botelho
					echo gettext("Unknown");
161 c7fbdd6c Ermal
				else {
162 ea0efb36 Ermal
					if (!empty($ikesa['local']['identification'])) {
163
						if ($ikesa['local']['identification'] == '%any')
164 d6c9dcf9 Renato Botelho
							echo gettext('Any identifier');
165 ea0efb36 Ermal
						else
166
							echo htmlspecialchars($ikesa['local']['identification']);
167
					} else
168 d6c9dcf9 Renato Botelho
						echo gettext("Unknown");
169 c7fbdd6c Ermal
				}
170 6795e0da Renato Botelho
?>
171 c7fbdd6c Ermal
				</td>
172
				<td class="listr">
173 6795e0da Renato Botelho
<?php
174
				if (!is_array($ikesa['local']))
175 d6c9dcf9 Renato Botelho
					echo gettext("Unknown");
176 c7fbdd6c Ermal
				else {
177
					if (!empty($ikesa['local']['address']))
178 d6c9dcf9 Renato Botelho
						echo htmlspecialchars($ikesa['local']['address']) . '<br/>' .
179
							gettext('Port: ') . htmlspecialchars($ikesa['local']['port']);
180 c7fbdd6c Ermal
					else
181 d6c9dcf9 Renato Botelho
						echo gettext("Unknown");
182 261f2efe Chris Buechler
					if ($ikesa['local']['port'] == '4500')
183 c7fbdd6c Ermal
						echo " NAT-T";
184
				}
185 6795e0da Renato Botelho
?>
186 c7fbdd6c Ermal
				</td>
187
				<td class="listr">
188 6795e0da Renato Botelho
<?php
189
				if (!is_array($ikesa['remote']))
190 d6c9dcf9 Renato Botelho
					echo gettext("Unknown");
191 c7fbdd6c Ermal
				else {
192 6da9a160 Ermal
					$identity = "";
193 ea0efb36 Ermal
					if (!empty($ikesa['remote']['identification'])) {
194
						if ($ikesa['remote']['identification'] == '%any')
195 6da9a160 Ermal
							$identity = 'Any identifier';
196 ea0efb36 Ermal
						else
197 6da9a160 Ermal
							$identity = htmlspecialchars($ikesa['remote']['identification']);
198
					}
199 fe0430f7 Ermal
200 6da9a160 Ermal
					if (is_array($ikesa['remote']['auth']) && !empty($ikesa['remote']['auth'][0]['identity'])) {
201
						echo htmlspecialchars($ikesa['remote']['auth'][0]['identity']);
202
						echo "<br/>{$identity}";
203
					} else {
204
						if (empty($identity))
205 d6c9dcf9 Renato Botelho
							echo gettext("Unknown");
206 6da9a160 Ermal
						else
207
							echo $identity;
208 fe0430f7 Ermal
					}
209 c7fbdd6c Ermal
				}
210 6795e0da Renato Botelho
?>
211 c7fbdd6c Ermal
				</td>
212
				<td class="listr">
213 6795e0da Renato Botelho
<?php
214
				if (!is_array($ikesa['remote']))
215 d6c9dcf9 Renato Botelho
					echo gettext("Unknown");
216 c7fbdd6c Ermal
				else {
217
					if (!empty($ikesa['remote']['address']))
218 d6c9dcf9 Renato Botelho
						echo htmlspecialchars($ikesa['remote']['address']) . '<br/>' .
219
							gettext('Port: ') . htmlspecialchars($ikesa['remote']['port']);
220 c7fbdd6c Ermal
					else
221 d6c9dcf9 Renato Botelho
						echo gettext("Unknown");
222 261f2efe Chris Buechler
					if ($ikesa['remote']['port'] == '4500')
223 c7fbdd6c Ermal
						echo " NAT-T";
224
				}
225 6795e0da Renato Botelho
?>
226 c7fbdd6c Ermal
				</td>
227
				<td class="listr">
228 6da9a160 Ermal
					IKEv<?php echo htmlspecialchars($ikesa['version']);?>
229
					<br/>
230 6795e0da Renato Botelho
<?php
231
					echo htmlspecialchars($ikesa['role']);
232
?>
233 c7fbdd6c Ermal
				</td>
234 fe0430f7 Ermal
				<td class="listr">
235 6795e0da Renato Botelho
<?php
236
					echo htmlspecialchars($ikesa['reauth']);
237
?>
238 fe0430f7 Ermal
				</td>
239 6da9a160 Ermal
				<td class="listr">
240 6795e0da Renato Botelho
<?php
241
					echo htmlspecialchars($ikesa['encalg']);
242
					echo "<br/>";
243
					echo htmlspecialchars($ikesa['intalg']);
244
					echo "<br/>";
245
					echo htmlspecialchars($ikesa['prfalg']);
246
					echo "<br/>";
247
					echo htmlspecialchars($ikesa['dhgroup']);
248
?>
249 6da9a160 Ermal
				</td>
250 c7fbdd6c Ermal
				<td class="listr">
251 17402c63 Ermal
					<center>
252
						<img src ="/themes/<?php echo $g['theme']; ?>/images/icons/icon_<?php echo $icon; ?>.gif" title="<?php echo $ikesa['status']; ?>" alt=""/>
253
						<br/><?php echo htmlspecialchars($ikesa['status']);?>
254 6da9a160 Ermal
						<br/><?php echo htmlspecialchars($ikesa['established']);?>
255 17402c63 Ermal
					</center>
256 c7fbdd6c Ermal
				</td>
257 17402c63 Ermal
				<td >
258 6795e0da Renato Botelho
<?php
259
				if ($icon != "pass"):
260
?>
261 17402c63 Ermal
					<center>
262 55d6f48b Renato Botelho
						<a href="diag_ipsec.php?act=connect&amp;ikeid=<?php echo $con_id; ?>">
263 d6c9dcf9 Renato Botelho
						<img src ="/themes/<?php echo $g['theme']; ?>/images/icons/icon_service_start.gif" alt=<?php echo gettext("Connect VPN");?> title=<?php echo gettext("Connect VPN");?> border="0"/>
264 17402c63 Ermal
						</a>
265
					</center>
266 6795e0da Renato Botelho
<?php
267
				else:
268
?>
269 17402c63 Ermal
					<center>
270 55d6f48b Renato Botelho
						<a href="diag_ipsec.php?act=ikedisconnect&amp;ikeid=<?php echo $con_id; ?>">
271 d6c9dcf9 Renato Botelho
						<img src ="/themes/<?php echo $g['theme']; ?>/images/icons/icon_service_stop.gif" alt=<?php echo gettext("Disconnect VPN");?> title=<?php echo gettext("Disconnect VPN");?> border="0"/>
272 17402c63 Ermal
						</a>
273 e952906e Ermal
						<a href="diag_ipsec.php?act=ikedisconnect&amp;ikeid=<?php echo $con_id; ?>&amp;ikesaid=<?php echo $ikesa['id']; ?>">
274 d6c9dcf9 Renato Botelho
						<img src ="/themes/<?php echo $g['theme']; ?>/images/icons/icon_x.gif" alt=<?php echo gettext("Disconnect VPN Connection");?> title=<?php echo gettext("Disconnect VPN Connection");?> border="0"/>
275 e952906e Ermal
						</a>
276 17402c63 Ermal
					</center>
277 6795e0da Renato Botelho
<?php
278
				endif;
279
?>
280 c7fbdd6c Ermal
				</td>
281 a8590dd6 Colin Fleming
				<td valign="middle" class="list nowrap">
282
					<table border="0" cellspacing="0" cellpadding="1" summary="">
283 c7fbdd6c Ermal
					</table>
284
				</td>
285
			</tr>
286 6795e0da Renato Botelho
<?php
287
			if (is_array($ikesa['childsalist'])):
288
?>
289 c7fbdd6c Ermal
			<tr>
290 6da9a160 Ermal
				<td class="listrborder" colspan="9">
291 c7fbdd6c Ermal
				<div id="btnchildsa-<?=$ikeid;?>">
292 a8590dd6 Colin Fleming
					<input  type="button" onclick="show_childsa('childsa-<?=$ikeid;?>','btnchildsa-<?=$ikeid;?>');" value="+" /> - Show child SA entries
293 c7fbdd6c Ermal
				</div>
294 a8590dd6 Colin Fleming
				<table class="tabcont" width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" id="childsa-<?=$ikeid;?>" style="display:none" summary="">
295 6795e0da Renato Botelho
					<thead>
296
						<tr>
297
							<th class="listhdrr nowrap"><?php echo gettext("Local subnets");?></th>
298
							<th class="listhdrr nowrap"><?php echo gettext("Local SPI(s)");?></th>
299
							<th class="listhdrr nowrap"><?php echo gettext("Remote subnets");?></th>
300
							<th class="listhdrr nowrap"><?php echo gettext("Times");?></th>
301
							<th class="listhdrr nowrap"><?php echo gettext("Algo");?></th>
302
							<th class="listhdrr nowrap"><?php echo gettext("Stats");?></th>
303
						</tr>
304
					</thead>
305
					<tbody>
306
<?php
307
				if (is_array($ikesa['childsalist']['childsa'])):
308
					foreach ($ikesa['childsalist']['childsa'] as $childsa):
309
?>
310
						<tr valign="top">
311
							<td class="listlr nowrap">
312
<?php
313
							if (is_array($childsa['local']) &&
314
							    is_array($childsa['local']['networks']) &&
315
							    is_array($childsa['local']['networks']['network']))
316
								foreach ($childsa['local']['networks']['network'] as $lnets)
317
									echo htmlspecialchars(ipsec_fixup_network($lnets)) . "<br />";
318
							else
319 d6c9dcf9 Renato Botelho
								echo gettext("Unknown");
320 6795e0da Renato Botelho
?>
321
							</td>
322
							<td class="listr nowrap">
323
<?php
324
							if (is_array($childsa['local']))
325 d6c9dcf9 Renato Botelho
								echo gettext("Local: ") . htmlspecialchars($childsa['local']['spi']);
326 6795e0da Renato Botelho
							if (is_array($childsa['remote']))
327 d6c9dcf9 Renato Botelho
								echo "<br/>" . gettext("Remote: ") . htmlspecialchars($childsa['remote']['spi']);
328 6795e0da Renato Botelho
?>
329
							</td>
330
							<td class="listr nowrap">
331
<?php
332
							if (is_array($childsa['remote']) &&
333
							    is_array($childsa['remote']['networks']) &&
334
							    is_array($childsa['remote']['networks']['network']))
335
								foreach ($childsa['remote']['networks']['network'] as $rnets)
336
									echo htmlspecialchars(ipsec_fixup_network($rnets)) . "<br />";
337
							else
338 d6c9dcf9 Renato Botelho
								echo gettext("Unknown");
339 6795e0da Renato Botelho
?>
340
							</td>
341
							<td class="listr nowrap">
342
<?php
343 d6c9dcf9 Renato Botelho
								echo gettext("Rekey: ") . htmlspecialchars($childsa['rekey']);
344
								echo "<br/>" . gettext("Life: ") . htmlspecialchars($childsa['lifetime']);
345
								echo "<br/>" . gettext("Install: ") .htmlspecialchars($childsa['installtime']);
346 6da9a160 Ermal
347 6795e0da Renato Botelho
?>
348
							</td>
349
							<td class="listr nowrap">
350
<?php
351
								echo htmlspecialchars($childsa['encalg']);
352 6da9a160 Ermal
								echo "<br/>";
353 6795e0da Renato Botelho
								echo htmlspecialchars($childsa['intalg']);
354 6da9a160 Ermal
								echo "<br/>";
355 6795e0da Renato Botelho
								if (!empty($childsa['prfalg'])) {
356
									echo htmlspecialchars($childsa['prfalg']);
357
									echo "<br/>";
358
								}
359
								if (!empty($childsa['dhgroup'])) {
360
									echo htmlspecialchars($childsa['dhgroup']);
361
									echo "<br/>";
362
								}
363
								if (!empty($childsa['esn'])) {
364
									echo htmlspecialchars($childsa['esn']);
365
									echo "<br/>";
366
								}
367 d6c9dcf9 Renato Botelho
								echo gettext("IPComp: ") . htmlspecialchars($childsa['ipcomp']);
368 6795e0da Renato Botelho
?>
369
							</td>
370
							<td class="listr nowrap">
371
<?php
372 d6c9dcf9 Renato Botelho
								echo gettext("Bytes-In: ") . htmlspecialchars($childsa['bytesin']);
373 6da9a160 Ermal
								echo "<br/>";
374 d6c9dcf9 Renato Botelho
								echo gettext("Packets-In: ") . htmlspecialchars($childsa['packetsin']);
375
								echo "<br/>";
376
								echo gettext("Bytes-Out: ") . htmlspecialchars($childsa['bytesout']);
377
								echo "<br/>";
378
								echo gettext("Packets-Out: ") . htmlspecialchars($childsa['packetsout']);
379 6795e0da Renato Botelho
?>
380
							</td>
381
							<td>
382
								<center>
383
									<a href="diag_ipsec.php?act=childdisconnect&amp;ikeid=<?php echo $con_id; ?>&amp;ikesaid=<?php echo $childsa['reqid']; ?>">
384 d6c9dcf9 Renato Botelho
									<img src ="/themes/<?php echo $g['theme']; ?>/images/icons/icon_x.gif" alt=<?php echo gettext("Disconnect Child SA");?> title=<?php echo gettext("Disconnect Child SA");?> border="0"/>
385 6795e0da Renato Botelho
									</a>
386
								</center>
387
							</td>
388
							<td class="list nowrap">
389
								&nbsp;
390
							</td>
391
						</tr>
392
<?php
393
					endforeach;
394
				endif;
395
?>
396
						<tr style="display:none;"><td></td></tr>
397
					</tbody>
398 a93e56c5 Matthew Grooms
				</table>
399 c7fbdd6c Ermal
				</td>
400
			</tr>
401 6795e0da Renato Botelho
<?php
402
			endif;
403 55d6f48b Renato Botelho
404
			unset($con_id);
405 6795e0da Renato Botelho
		endforeach;
406
	endif;
407 fd875a8d Ermal
408
	$rgmap = array();
409
	foreach ($a_phase1 as $ph1ent):
410 b7419cfc Chris Buechler
		if (isset($ph1ent['disabled']))
411
			continue;
412 fd875a8d Ermal
		$rgmap[$ph1ent['remote-gateway']] = $ph1ent['remote-gateway'];
413
		if ($ipsecconnected[$ph1ent['ikeid']])
414
			continue;
415
?>
416 6795e0da Renato Botelho
			<tr>
417
				<td class="listlr">
418
<?php
419
					echo htmlspecialchars($ph1ent['descr']);
420
?>
421
				</td>
422
				<td class="listr">
423
<?php
424
				list ($myid_type, $myid_data) = ipsec_find_id($ph1ent, "local");
425
				if (empty($myid_data))
426 d6c9dcf9 Renato Botelho
					echo gettext("Unknown");
427 6795e0da Renato Botelho
				else
428
					echo htmlspecialchars($myid_data);
429
?>
430
				</td>
431
				<td class="listr">
432
<?php
433
				$ph1src = ipsec_get_phase1_src($ph1ent);
434
				if (empty($ph1src))
435 d6c9dcf9 Renato Botelho
					echo gettext("Unknown");
436 6795e0da Renato Botelho
				else
437
					echo htmlspecialchars($ph1src);
438
?>
439
				</td>
440
				<td class="listr">
441
<?php
442
				list ($peerid_type, $peerid_data) = ipsec_find_id($ph1ent, "peer", $rgmap);
443
				if (empty($peerid_data))
444 d6c9dcf9 Renato Botelho
					echo gettext("Unknown");
445 6795e0da Renato Botelho
				else
446
					echo htmlspecialchars($peerid_data);
447
?>
448
				</td>
449
				<td class="listr">
450
<?php
451
				$ph1src = ipsec_get_phase1_dst($ph1ent);
452
				if (empty($ph1src))
453 d6c9dcf9 Renato Botelho
					echo gettext("Unknown");
454 6795e0da Renato Botelho
				else
455
					echo htmlspecialchars($ph1src);
456
?>
457
				</td>
458
				<td class="listr" >
459
				</td>
460
				<td class="listr" >
461
				</td>
462
				<td class="listr" >
463
				</td>
464 b907136c Renato Botelho
<?php
465
			if (isset($ph1ent['mobile'])):
466
?>
467
				<td class="listr">
468
					<center>
469 261f2efe Chris Buechler
						<img src ="/themes/<?php echo $g['theme']; ?>/images/icons/icon_pass.gif" title=<?php echo gettext("Awaiting connections");?> alt=""/>
470
						<br/><?php echo gettext("Awaiting connections");?>
471 b907136c Renato Botelho
					</center>
472
				</td>
473
				<td valign="middle" class="list nowrap">
474
					<table border="0" cellspacing="0" cellpadding="1" summary="">
475
					</table>
476
				</td>
477
<?php
478
			else:
479
?>
480 6795e0da Renato Botelho
				<td class="listr">
481
					<center>
482 ca1fdcce Renato Botelho
						<img src ="/themes/<?php echo $g['theme']; ?>/images/icons/icon_reject.gif" title=<?php echo gettext("Disconnected");?> alt=""/>
483 b907136c Renato Botelho
						<br/><?php echo gettext("Disconnected");?>
484 6795e0da Renato Botelho
					</center>
485
				</td>
486
				<td >
487
					<center>
488
						<a href="diag_ipsec.php?act=connect&amp;ikeid=<?php echo $ph1ent['ikeid']; ?>">
489 d6c9dcf9 Renato Botelho
						<img src ="/themes/<?php echo $g['theme']; ?>/images/icons/icon_service_start.gif" alt=<?php echo gettext("Connect VPN");?> title=<?php echo gettext("Connect VPN");?> border="0"/>
490 6795e0da Renato Botelho
						</a>
491
					</center>
492
				</td>
493 b907136c Renato Botelho
<?php
494
			endif;
495
?>
496 6795e0da Renato Botelho
				<td valign="middle" class="list nowrap">
497
					<table border="0" cellspacing="0" cellpadding="1" summary="">
498
					</table>
499
				</td>
500
			</tr>
501 fd875a8d Ermal
<?php
502
	endforeach;
503
	unset($ipsecconnected, $phase1, $rgmap);
504 c7fbdd6c Ermal
?>
505 a8590dd6 Colin Fleming
			<tr style="display:none;"><td></td></tr>
506 c7fbdd6c Ermal
		</tbody>
507
		</table>
508
	</div>
509
	</td>
510 a93e56c5 Matthew Grooms
	</tr>
511 cf7d1057 Scott Ullrich
</table>
512 0f78d3ad Scott Ullrich
513 a8590dd6 Colin Fleming
<p class="vexpl">
514 0f78d3ad Scott Ullrich
	<span class="red">
515 6e0b68bf jim-p
		<strong><?php echo gettext("Note:");?><br /></strong>
516 0f78d3ad Scott Ullrich
	</span>
517 6e0b68bf jim-p
	<?php echo gettext("You can configure IPsec");?>
518 0f78d3ad Scott Ullrich
	<a href="vpn_ipsec.php">here</a>.
519 a8590dd6 Colin Fleming
</p>
520 c7fbdd6c Ermal
<?php unset($status); include("fend.inc"); ?>
521
<script type="text/javascript">
522 a8590dd6 Colin Fleming
//<![CDATA[
523 c7fbdd6c Ermal
function show_childsa(id, buttonid) {
524
	document.getElementById(buttonid).innerHTML='';
525
	aodiv = document.getElementById(id);
526
	aodiv.style.display = "block";
527
}
528 a8590dd6 Colin Fleming
//]]>
529 c7fbdd6c Ermal
</script>
530 cf7d1057 Scott Ullrich
</body>
531
</html>