Projet

Général

Profil

Télécharger (19,9 ko) Statistiques
| Branche: | Tag: | Révision:

univnautes / usr / local / www / vpn_ipsec.php @ a6057836

1
<?php
2
/*
3
	vpn_ipsec.php
4
	part of m0n0wall (http://m0n0.ch/wall)
5

    
6
	Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
7
	Copyright (C) 2008 Shrew Soft Inc
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
##|+PRIV
33
##|*IDENT=page-vpn-ipsec
34
##|*NAME=VPN: IPsec page
35
##|*DESCR=Allow access to the 'VPN: IPsec' page.
36
##|*MATCH=vpn_ipsec.php*
37
##|-PRIV
38

    
39
require("guiconfig.inc");
40
require_once("functions.inc");
41
require_once("filter.inc");
42
require_once("shaper.inc");
43
require_once("ipsec.inc");
44
require_once("vpn.inc");
45

    
46
if (!is_array($config['ipsec']['phase1']))
47
	$config['ipsec']['phase1'] = array();
48

    
49
if (!is_array($config['ipsec']['phase2']))
50
	$config['ipsec']['phase2'] = array();
51

    
52
$a_phase1 = &$config['ipsec']['phase1'];
53
$a_phase2 = &$config['ipsec']['phase2'];
54

    
55
$pconfig['enable'] = isset($config['ipsec']['enable']);
56

    
57
if ($_POST) {
58
	if ($_POST['apply']) {
59
		$retval = 0;
60
		$retval = vpn_ipsec_configure();
61
		/* reload the filter in the background */
62
		filter_configure();
63
		$savemsg = get_std_save_message($retval);
64
		if ($retval >= 0) {
65
			if (is_subsystem_dirty('ipsec'))
66
				clear_subsystem_dirty('ipsec');
67
		}
68
	} else if ($_POST['submit']) {
69
		$pconfig = $_POST;
70

    
71
		$config['ipsec']['enable'] = $_POST['enable'] ? true : false;
72

    
73
		write_config();
74

    
75
		$retval = vpn_ipsec_configure();
76
	} else if (isset($_POST['del_x'])) {
77
		/* delete selected p1 entries */
78
		if (is_array($_POST['p1entry']) && count($_POST['p1entry'])) {
79
			foreach ($_POST['p1entry'] as $p1entrydel) {
80
				unset($a_phase1[$p1entrydel]);
81
			}
82
			if (write_config())
83
				mark_subsystem_dirty('ipsec');
84
			header("Location: vpn_ipsec.php");
85
			exit;
86
		}
87
	} else {
88
		/* yuck - IE won't send value attributes for image buttons, while Mozilla does - so we use .x/.y to find move button clicks instead... */
89
		unset($movebtn);
90
		foreach ($_POST as $pn => $pd) {
91
			if (preg_match("/move_(\d+)_x/", $pn, $matches)) {
92
				$movebtn = $matches[1];
93
				break;
94
			}
95
		}
96
		/* move selected p1 entries before this */
97
		if (isset($movebtn) && is_array($_POST['p1entry']) && count($_POST['p1entry'])) {
98
			$a_phase1_new = array();
99

    
100
			/* copy all p1 entries < $movebtn and not selected */
101
			for ($i = 0; $i < $movebtn; $i++) {
102
				if (!in_array($i, $_POST['p1entry']))
103
					$a_phase1_new[] = $a_phase1[$i];
104
			}
105

    
106
			/* copy all selected p1 entries */
107
			for ($i = 0; $i < count($a_phase1); $i++) {
108
				if ($i == $movebtn)
109
					continue;
110
				if (in_array($i, $_POST['p1entry']))
111
					$a_phase1_new[] = $a_phase1[$i];
112
			}
113

    
114
			/* copy $movebtn p1 entry */
115
			if ($movebtn < count($a_phase1))
116
				$a_phase1_new[] = $a_phase1[$movebtn];
117

    
118
			/* copy all p1 entries > $movebtn and not selected */
119
			for ($i = $movebtn+1; $i < count($a_phase1); $i++) {
120
				if (!in_array($i, $_POST['p1entry']))
121
					$a_phase1_new[] = $a_phase1[$i];
122
			}
123
			if (count($a_phase1_new) > 0)
124
				$a_phase1 = $a_phase1_new;
125

    
126
			if (write_config())
127
				mark_subsystem_dirty('ipsec');
128
			header("Location: vpn_ipsec.php");
129
			exit;
130
		}
131
	}
132
}
133

    
134
if (isset($_GET['p1index']) && is_numericint($_GET['p1index']) && isset($a_phase1[$_GET['p1index']])) {
135
	if ($_GET['act'] == "delph1") {
136
		/* remove static route if interface is not WAN */
137
		if ($a_phase1[$_GET['p1index']]['interface'] <> "wan")
138
			mwexec("/sbin/route delete -host {$a_phase1[$_GET['p1index']]['remote-gateway']}");
139

    
140
		/* remove all phase2 entries that match the ikeid */
141
		$ikeid = $a_phase1[$_GET['p1index']]['ikeid'];
142
		foreach ($a_phase2 as $p2index => $ph2tmp)
143
			if ($ph2tmp['ikeid'] == $ikeid) {
144
				unset($a_phase2[$p2index]);
145
			}
146

    
147
		/* remove the phase1 entry */
148
		unset($a_phase1[$_GET['p1index']]);
149
		write_config();
150
		mark_subsystem_dirty('ipsec');
151
	} else if ($_GET['act'] == "delph2") {
152
		/* remove the phase2 entry */
153
		unset($a_phase2[$_GET['p2index']]);
154
		write_config();
155
		mark_subsystem_dirty('ipsec');
156
	} else if ($_GET['act'] == "toggle") {
157
		if (isset($a_phase1[$_GET['p1index']]['disabled']))
158
			unset($a_phase1[$_GET['p1index']]['disabled']);
159
		else
160
			$a_phase1[$_GET['p1index']]['disabled'] = true;
161

    
162
		write_config();
163
		mark_subsystem_dirty('ipsec');
164
	}
165

    
166
	header("Location: vpn_ipsec.php");
167
	exit;
168
}
169

    
170
$pgtitle = array(gettext("VPN"),gettext("IPsec"));
171
$shortcut_section = "ipsec";
172

    
173
include("head.inc");
174

    
175
?>
176

    
177
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
178
<?php include("fbegin.inc"); ?>
179
<form action="vpn_ipsec.php" method="post">
180
<script type="text/javascript" src="/javascript/row_toggle.js"></script>
181
<?php
182
	if ($savemsg)
183
		print_info_box($savemsg);
184
	if ($pconfig['enable'] && is_subsystem_dirty('ipsec'))
185
		print_info_box_np(gettext("The IPsec tunnel configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));
186
?>
187
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="vpn ipsec">
188
	<tr>
189
		<td class="tabnavtbl">
190
<?php
191
			$tab_array = array();
192
			$tab_array[0] = array(gettext("Tunnels"), true, "vpn_ipsec.php");
193
			$tab_array[1] = array(gettext("Mobile clients"), false, "vpn_ipsec_mobile.php");
194
			$tab_array[2] = array(gettext("Pre-Shared Keys"), false, "vpn_ipsec_keys.php");
195
			$tab_array[3] = array(gettext("Advanced Settings"), false, "vpn_ipsec_settings.php");
196
			display_top_tabs($tab_array);
197
?>
198
		</td>
199
	</tr>
200
	<tr>
201
		<td>
202
			<div id="mainarea">
203
				<table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
204
					<tr>
205
						<td class="vtable">
206
							<table border="0" cellspacing="2" cellpadding="0" summary="enable">
207
								<tr>
208
									<td>
209
										<input name="enable" type="checkbox" id="enable" value="yes" <?php if ($pconfig['enable']) echo "checked=\"checked\"";?> />
210
									</td>
211
									<td>
212
										<strong><?=gettext("Enable IPsec"); ?></strong>
213
									</td>
214
								</tr>
215
							</table>
216
						</td>
217
					</tr>
218
					<tr>
219
						<td>
220
							<input name="submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
221
						</td>
222
					</tr>
223
				</table>
224
				<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="phase-1 entries">
225
					<tr id="frheader">
226
						<td class="list">&nbsp;</td>
227
						<td class="list">&nbsp;</td>
228
						<td class="listhdrr"><?=gettext("IKE"); ?></td>
229
						<td class="listhdrr"><?=gettext("Remote Gateway"); ?></td>
230
						<td class="listhdrr"><?=gettext("Mode"); ?></td>
231
						<td class="listhdrr"><?=gettext("P1 Protocol"); ?></td>
232
						<td class="listhdrr"><?=gettext("P1 Transforms"); ?></td>
233
						<td class="listhdrr"><?=gettext("P1 Description"); ?></td>
234
						<td class="list">
235
						</td>
236
					</tr>
237
<?php
238
				$i = 0;
239
				foreach ($a_phase1 as $ph1ent):
240
					$iconfn = "pass";
241
					$spans = $spane = "";
242
					if (isset($ph1ent['disabled'])) {
243
						$spans = "<span class=\"gray\">";
244
						$spane = "</span>";
245
						$iconfn .= "_d";
246
					}
247
?>
248
					<tr valign="top" id="fr<?=$i;?>" ondblclick="document.location='vpn_ipsec_phase1.php?p1index=<?=$i;?>'">
249
						<td class="listt" align="center" valign="middle">
250
							<input type="checkbox" id="frc<?=$i;?>" name="p1entry[]" value="<?=$i;?>" onclick="fr_bgcolor('<?=$i;?>')" style="margin: 0; padding: 0; width: 15px; height: 15px;" />
251
						</td>
252
						<td class="listt" align="center" valign="middle">
253
							<a href="?p1index=<?=$i;?>&amp;act=toggle"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_<?=$iconfn;?>.gif" width="11" height="11" border="0" title="<?=gettext("click to toggle enabled/disabled status");?>" alt="icon" /></a>
254
<?php
255
							if (isset($filterent['log'])):
256
								$iconfnlog = "log_s";
257
							if (isset($filterent['disabled']))
258
								$iconfnlog .= "_d";
259
?>
260
						<br /><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_<?=$iconfnlog;?>.gif" width="11" height="15" border="0" alt="icon" />
261
			<?php endif; ?>
262
						</td>
263
						<td class="listlr" onclick="fr_toggle(<?=$i;?>)" id="frd<?=$i;?>">
264
							<?=$spans;?>
265
<?php
266
							if (empty($ph1ent['iketype']) || $ph1ent['iketype'] == "ikev1")
267
								echo "V1";
268
							else
269
								echo "V2";
270
?>
271
							<?=$spane;?>
272
						</td>
273
						<td class="listr" onclick="fr_toggle(<?=$i;?>)" id="frd<?=$i;?>">
274
							<?=$spans;?>
275
<?php
276
							if ($ph1ent['interface']) {
277
								$iflabels = get_configured_interface_with_descr();
278

    
279
								$carplist = get_configured_carp_interface_list();
280
								foreach ($carplist as $cif => $carpip)
281
									$iflabels[$cif] = $carpip." (".get_vip_descr($carpip).")";
282

    
283
								$aliaslist = get_configured_ip_aliases_list();
284
								foreach ($aliaslist as $aliasip => $aliasif)
285
									$iflabels[$aliasip] = $aliasip." (".get_vip_descr($aliasip).")";
286

    
287
								$grouplist = return_gateway_groups_array();
288
								foreach ($grouplist as $name => $group) {
289
									if($group[0]['vip'] <> "")
290
										$vipif = $group[0]['vip'];
291
									else
292
										$vipif = $group[0]['int'];
293
									$iflabels[$name] = "GW Group {$name}";
294
								}
295
								$if = htmlspecialchars($iflabels[$ph1ent['interface']]);
296
							}
297
							else
298
								$if = "WAN";
299

    
300
							if (!isset($ph1ent['mobile']))
301
								echo $if."<br />".$ph1ent['remote-gateway'];
302
							else
303
								echo $if."<br /><strong>" . gettext("Mobile Client") . "</strong>";
304
?>
305
							<?=$spane;?>
306
						</td>
307
						<td class="listr" onclick="fr_toggle(<?=$i;?>)" id="frd<?=$i;?>">
308
							<?=$spans;?>
309
							<?=$ph1ent['mode'];?>
310
							<?=$spane;?>
311
						</td>
312
						<td class="listr" onclick="fr_toggle(<?=$i;?>)" id="frd<?=$i;?>">
313
							<?=$spans;?>
314
							<?=$p1_ealgos[$ph1ent['encryption-algorithm']['name']]['name'];?>
315
<?php
316
							if ($ph1ent['encryption-algorithm']['keylen']) {
317
								if ($ph1ent['encryption-algorithm']['keylen']=="auto")
318
									echo " (" . gettext("auto") . ")";
319
								else
320
									echo " ({$ph1ent['encryption-algorithm']['keylen']} " . gettext("bits") . ")";
321
							}
322
?>
323
							<?=$spane;?>
324
						</td>
325
						<td class="listr" onclick="fr_toggle(<?=$i;?>)" id="frd<?=$i;?>">
326
							<?=$spans;?>
327
							<?=$p1_halgos[$ph1ent['hash-algorithm']];?>
328
							<?=$spane;?>
329
						</td>
330
						<td class="listbg" onclick="fr_toggle(<?=$i;?>)">
331
							<?=$spans;?>
332
							<?=htmlspecialchars($ph1ent['descr']);?>&nbsp;
333
							<?=$spane;?>
334
						</td>
335
						<td valign="middle" class="list nowrap">
336
							<table border="0" cellspacing="0" cellpadding="1" summary="icons">
337
								<tr>
338
									<td>
339
										<input onmouseover="fr_insline(<?=$i;?>, true)" onmouseout="fr_insline(<?=$i;?>, false)"
340
											name="move_<?=$i;?>" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif"
341
											title="<?=gettext("move selected entries before this");?>"
342
											type="image" style="height:17;width:17;border:0" />
343
									</td>
344
									<td>
345
										<a href="vpn_ipsec_phase1.php?p1index=<?=$i;?>">
346
											<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit phase1 entry"); ?>" width="17" height="17" border="0" alt="edit" />
347
										</a>
348
									</td>
349
								</tr>
350
								<tr>
351
									<td>
352
										<a href="vpn_ipsec.php?act=delph1&amp;p1index=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this phase1 and all associated phase2 entries?"); ?>')">
353
											<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="<?=gettext("delete phase1 entry"); ?>" width="17" height="17" border="0" alt="delete" />
354
										</a>
355
									</td>
356
									<td>
357
<?php
358
							if (!isset($ph1ent['mobile'])):
359
?>
360
										<a href="vpn_ipsec_phase1.php?dup=<?=$i;?>">
361
											<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("copy phase1 entry"); ?>" width="17" height="17" border="0" alt="add" />
362
										</a>
363
<?php
364
							endif;
365
?>
366
									</td>
367
								</tr>
368
							</table>
369
						</td>
370
					</tr>
371
					<tr>
372
						<td class="listt">&nbsp;</td>
373
						<td class="listt">&nbsp;</td>
374
						<td class="listrborder" colspan="6">
375
							<div id="shph2but-<?=$i?>">
376
<?php
377
								$phase2count=0;
378
								foreach ($a_phase2 as $ph2ent) {
379
									if ($ph2ent['ikeid'] != $ph1ent['ikeid'])
380
										continue;
381
									$phase2count++;
382
								}
383
?>
384
								<input type="button" onclick="show_phase2('tdph2-<?=$i?>','shph2but-<?=$i?>')" value="+" /> - <?php printf(gettext("Show %s Phase-2 entries"), $phase2count); ?>
385
							</div>
386
							<div id="tdph2-<?=$i?>" style="display:none">
387
							<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0" summary="phase-2 entries">
388
								<tr>
389
									<td class="listhdrr"><?=gettext("Mode"); ?></td>
390
<?php
391
								if(($ph2ent['mode'] == "tunnel") or ($ph2ent['mode'] == "tunnel6")):
392
?>
393
									<td class="listhdrr"><?=gettext("Local Subnet"); ?></td>
394
									<td class="listhdrr"><?=gettext("Remote Subnet"); ?></td>
395
<?php
396
								endif;
397
?>
398
									<td class="listhdrr"><?=gettext("P2 Protocol"); ?></td>
399
									<td class="listhdrr"><?=gettext("P2 Transforms"); ?></td>
400
									<td class="listhdrr"><?=gettext("P2 Auth Methods"); ?></td>
401
									<td class ="list">
402
										<a href="vpn_ipsec_phase2.php?ikeid=<?=$ph1ent['ikeid'];?><?php if (isset($ph1ent['mobile'])) echo "&amp;mobile=true";?>">
403
											<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add phase2 entry"); ?>" width="17" height="17" border="0" alt="add" />
404
										</a>
405
									</td>
406
								</tr>
407
<?php
408
								foreach ($a_phase2 as $ph2index => $ph2ent):
409
									if ($ph2ent['ikeid'] != $ph1ent['ikeid'])
410
										continue;
411

    
412
									if (isset( $ph2ent['disabled']) || isset($ph1ent['disabled'])) {
413
										$spans = "<span class=\"gray\">";
414
										$spane = "</span>";
415
									} else
416
										$spans = $spane = "";
417
?>
418
								<tr valign="top" ondblclick="document.location='vpn_ipsec_phase2.php?p2index=<?=$ph2ent['uniqid'];?>'">
419

    
420
									<td class="listlr nowrap">
421
										<?=$spans;?>
422
										<?=$ph2ent['mode'];?>
423
										<?=$spane;?>
424
									</td>
425
<?php
426
									if(($ph2ent['mode'] <> "tunnel") and ($ph2ent['mode'] <> "tunnel6")) {
427
										echo "<td class=\"listr nowrap\">&nbsp;</td><td class=\"listr nowrap\">&nbsp;</td>";
428
									}
429
?>
430
<?php
431
									if(($ph2ent['mode'] == "tunnel") or ($ph2ent['mode'] == "tunnel6")):
432
?>
433
										<td class="listr nowrap">
434
											<?=$spans;?>
435
												<?=ipsec_idinfo_to_text($ph2ent['localid']); ?>
436
											<?=$spane;?>
437
										</td>
438
										<td class="listr nowrap">
439
											<?=$spans;?>
440
												<?=ipsec_idinfo_to_text($ph2ent['remoteid']); ?>
441
											<?=$spane;?>
442
										</td>
443
<?php
444
									endif;
445
?>
446
									<td class="listr nowrap">
447
										<?=$spans;?>
448
										<?php echo $p2_protos[$ph2ent['protocol']]; ?>
449
										<?=$spane;?>
450
									</td>
451
									<td class="listr">
452
										<?=$spans;?>
453
<?php
454
										foreach ($ph2ent['encryption-algorithm-option'] as $k => $ph2ea) {
455
											if ($k)
456
												echo ", ";
457
											echo $p2_ealgos[$ph2ea['name']]['name'];
458
											if ($ph2ea['keylen']) {
459
												if ($ph2ea['keylen']=="auto")
460
													echo " (" . gettext("auto") . ")";
461
												else
462
													echo " ({$ph2ea['keylen']} " . gettext("bits") . ")";
463
											}
464
										}
465
?>
466
										<?=$spane;?>
467
									</td>
468
									<td class="listr nowrap">
469
										<?=$spans;?>
470
<?php
471
										if (!empty($ph2ent['hash-algorithm-option']) && is_array($ph2ent['hash-algorithm-option'])) {
472
											foreach ($ph2ent['hash-algorithm-option'] as $k => $ph2ha) {
473
												if ($k)
474
													echo ", ";
475
												echo $p2_halgos[$ph2ha];
476
											}
477
										}
478
?>
479
										<?=$spane;?>
480
									</td>
481
									<td class="list nowrap">
482
										<a href="vpn_ipsec_phase2.php?p2index=<?=$ph2ent['uniqid'];?>">
483
											<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit phase2 entry"); ?>" width="17" height="17" border="0" alt="edit" />
484
										</a>
485
										<a href="vpn_ipsec.php?act=delph2&amp;p1index=<?=$i;?>&amp;p2index=<?=$ph2index;?>" onclick="return confirm('<?=gettext("Do you really want to delete this phase2 entry?"); ?>')">
486
											<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="<?=gettext("delete phase2 entry"); ?>" width="17" height="17" border="0" alt="delete" />
487
										</a>
488
										<a href="vpn_ipsec_phase2.php?dup=<?=$ph2ent['uniqid'];?>">
489
											<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add a new Phase 2 based on this one"); ?>" width="17" height="17" border="0" alt="add" />
490
										</a>
491
									</td>
492
								</tr>
493
<?php
494
								endforeach;
495
?>
496
							</table>
497
							</div>
498
						</td>
499
					</tr>
500
<?php
501
					$i++;
502
				endforeach;  // $a_phase1 as $ph1ent
503
?>
504
					<tr>
505
						<td class="list" colspan="8"></td>
506
						<td class="list nowrap" valign="middle">
507
							<table border="0" cellspacing="0" cellpadding="1" summary="edit">
508
								<tr>
509
									<td>
510
	<?php
511
									if ($i == 0):
512
	?>
513
										<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="<?=gettext("move selected phase1 entries to end");?>" border="0" alt="move" />
514
	<?php
515
									else:
516
	?>
517
										<input name="move_<?=$i;?>" type="image" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" style="width:17;height:17;border:0" title="<?=gettext("move selected phase1 entries to end");?>" />
518
	<?php
519
									endif;
520
	?>
521
									</td>
522
									<td>
523
										<a href="vpn_ipsec_phase1.php">
524
											<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?=gettext("add new phase1");?>" alt="add" />
525
										</a>
526
									</td>
527
								</tr>
528
								<tr>
529
									<td>
530
	<?php
531
									if ($i == 0):
532
	?>
533
										<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="<?=gettext("delete selected phase1 entries");?>" border="0" alt="delete" />
534
	<?php
535
									else:
536
	?>
537
										<input name="del" type="image" src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" style="width:17;height:17" title="<?=gettext("delete selected phase1 entries");?>" onclick="return confirm('<?=gettext("Do you really want to delete the selected phase1 entries?");?>')" />
538
	<?php
539
									endif;
540
	?>
541
									</td>
542
								</tr>
543
							</table>
544
						</td>
545
					</tr>
546
					<tr>
547
						<td colspan="8">
548
							<p>
549
								<span class="vexpl">
550
									<span class="red">
551
										<strong><?=gettext("Note"); ?>:<br /></strong>
552
									</span>
553
									<?=gettext("You can check your IPsec status at"); ?> <a href="diag_ipsec.php"><?=gettext("Status:IPsec"); ?></a>.<br />
554
									<?=gettext("IPsec Debug Mode can be enabled at"); ?> <a href="vpn_ipsec_settings.php"><?=gettext("VPN:IPsec:Advanced Settings"); ?></a>.<br />
555
									<?=gettext("IPsec can be set to prefer older SAs at"); ?> <a href="vpn_ipsec_settings.php"><?=gettext("VPN:IPsec:Advanced Settings"); ?></a>.
556
								</span>
557
							</p>
558
						</td>
559
					</tr>
560
				</table>
561
			</div>
562
		</td>
563
	</tr>
564
</table>
565
</form>
566
<?php include("fend.inc"); ?>
567
<script type="text/javascript">
568
//<![CDATA[
569
function show_phase2(id, buttonid) {
570
	document.getElementById(buttonid).innerHTML='';
571
	aodiv = document.getElementById(id);
572
	aodiv.style.display = "block";
573
}
574
//]]>
575
</script>
576
</body>
577
</html>
(236-236/255)