Project

General

Profile

Download (21.3 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/*
3
	vpn_ipsec_mobile.php
4
	
5
	Copyright (C) 2008 Shrew Soft Inc
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
##|+PRIV
31
##|*IDENT=page-vpn-ipsec-mobile
32
##|*NAME=VPN: IPsec: Mobile page
33
##|*DESCR=Allow access to the 'VPN: IPsec: Mobile' page.
34
##|*MATCH=vpn_ipsec_mobile.php*
35
##|-PRIV
36

    
37
require("functions.inc");
38
require("guiconfig.inc");
39
require_once("ipsec.inc");
40
require_once("vpn.inc");
41

    
42
if (!is_array($config['ipsec']['phase1']))
43
	$config['ipsec']['phase1'] = array();
44

    
45
$a_phase1 = &$config['ipsec']['phase1'];
46

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

    
50
$a_client = &$config['ipsec']['client'];
51

    
52
if (count($a_client)) {
53

    
54
	$pconfig['enable'] = $a_client['enable'];
55

    
56
	$pconfig['user_source'] = $a_client['user_source'];
57
	$pconfig['group_source'] = $a_client['group_source'];
58

    
59
	$pconfig['pool_address'] = $a_client['pool_address'];
60
	$pconfig['pool_netbits'] = $a_client['pool_netbits'];
61
	$pconfig['net_list'] = $a_client['net_list'];
62
	$pconfig['save_passwd'] = $a_client['save_passwd'];
63
	$pconfig['dns_domain'] = $a_client['dns_domain'];
64
	$pconfig['dns_server1'] = $a_client['dns_server1'];
65
	$pconfig['dns_server2'] = $a_client['dns_server2'];
66
	$pconfig['dns_server3'] = $a_client['dns_server3'];
67
	$pconfig['dns_server4'] = $a_client['dns_server4'];
68
	$pconfig['wins_server1'] = $a_client['wins_server1'];
69
	$pconfig['wins_server2'] = $a_client['wins_server2'];
70
	$pconfig['pfs_group'] = $a_client['pfs_group'];
71
	$pconfig['login_banner'] = $a_client['login_banner'];
72

    
73
	if (isset($pconfig['enable']))
74
		$pconfig['enable'] = true;
75

    
76
	if ($pconfig['pool_address']&&$pconfig['pool_netbits'])
77
		$pconfig['pool_enable'] = true;
78
	else
79
		$pconfig['pool_netbits'] = 24;
80

    
81
	if (isset($pconfig['net_list']))
82
		$pconfig['net_list_enable'] = true;
83

    
84
	if (isset($pconfig['save_passwd']))
85
		$pconfig['save_passwd_enable'] = true;
86

    
87
	if ($pconfig['dns_domain'])
88
		$pconfig['dns_domain_enable'] = true;
89

    
90
	if ($pconfig['dns_server1']||$pconfig['dns_server2']||$pconfig['dns_server3']||$pconfig['dns_server4'])
91
		$pconfig['dns_server_enable'] = true;
92

    
93
	if ($pconfig['wins_server1']||$pconfig['wins_server2'])
94
		$pconfig['wins_server_enable'] = true;
95

    
96
	if (isset($pconfig['pfs_group']))
97
		$pconfig['pfs_group_enable'] = true;
98

    
99
	if ($pconfig['login_banner'])
100
		$pconfig['login_banner_enable'] = true;
101
}
102

    
103
if ($_POST['create']) {
104
	header("Location: vpn_ipsec_phase1.php?mobile=true");
105
}
106

    
107
if ($_POST['apply']) {
108
	$retval = 0;
109
	$retval = vpn_ipsec_configure();
110
	$savemsg = get_std_save_message($retval);
111
	if ($retval == 0)
112
		if (is_subsystem_dirty('ipsec'))
113
			clear_subsystem_dirty('ipsec');
114
}
115

    
116
if ($_POST['submit']) {
117

    
118
	unset($input_errors);
119
	$pconfig = $_POST;
120

    
121
	/* input consolidation */
122

    
123
	
124

    
125
	/* input validation */
126

    
127
	$reqdfields = explode(" ", "user_source group_source");
128
	$reqdfieldsn =  array(gettext("User Authentication Source"),gettext("Group Authentication Source"));
129

    
130
    do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
131

    
132
	if ($pconfig['pool_enable'])
133
		if (!is_ipaddr($pconfig['pool_address']))
134
			$input_errors[] = gettext("A valid IP address for 'Virtual Address Pool Network' must be specified.");
135

    
136
	if ($pconfig['dns_domain_enable'])
137
		if (!is_domain($pconfig['dns_domain']))
138
			$input_errors[] = gettext("A valid value for 'DNS Default Domain' must be specified.");
139

    
140
	if ($pconfig['dns_server_enable']) {
141
		if (!$pconfig['dns_server1'] && !$pconfig['dns_server2'] &&
142
			!$pconfig['dns_server3'] && !$pconfig['dns_server4'] )
143
			$input_errors[] = gettext("At least one DNS server must be specified to enable the DNS Server option.");
144
		if ($pconfig['dns_server1'] && !is_ipaddr($pconfig['dns_server1']))
145
			$input_errors[] = gettext("A valid IP address for 'DNS Server #1' must be specified.");
146
		if ($pconfig['dns_server2'] && !is_ipaddr($pconfig['dns_server2']))
147
			$input_errors[] = gettext("A valid IP address for 'DNS Server #2' must be specified.");
148
		if ($pconfig['dns_server3'] && !is_ipaddr($pconfig['dns_server3']))
149
			$input_errors[] = gettext("A valid IP address for 'DNS Server #3' must be specified.");
150
		if ($pconfig['dns_server4'] && !is_ipaddr($pconfig['dns_server4']))
151
			$input_errors[] = gettext("A valid IP address for 'DNS Server #4' must be specified.");
152
	}
153

    
154
	if ($pconfig['wins_server_enable']) {
155
		if (!$pconfig['wins_server1'] && !$pconfig['wins_server2'])
156
			$input_errors[] = gettext("At least one WINS server must be specified to enable the DNS Server option.");
157
		if ($pconfig['wins_server1'] && !is_ipaddr($pconfig['wins_server1']))
158
			$input_errors[] = gettext("A valid IP address for 'WINS Server #1' must be specified.");
159
		if ($pconfig['wins_server2'] && !is_ipaddr($pconfig['wins_server2']))
160
			$input_errors[] = gettext("A valid IP address for 'WINS Server #2' must be specified.");
161
	}
162

    
163
	if ($pconfig['login_banner_enable'])
164
		if (!strlen($pconfig['login_banner']))
165
			$input_errors[] = gettext("A valid value for 'Login Banner' must be specified.");
166

    
167
	if (!$input_errors) {
168
		$client = array();
169
		
170
		if ($pconfig['enable'])
171
			$client['enable'] = true;
172

    
173
		$client['user_source'] = $pconfig['user_source'];
174
		$client['group_source'] = $pconfig['group_source'];
175

    
176
		if ($pconfig['pool_enable']) {
177
			$client['pool_address'] = $pconfig['pool_address'];
178
			$client['pool_netbits'] = $pconfig['pool_netbits'];
179
		}
180

    
181
		if ($pconfig['net_list_enable'])
182
			$client['net_list'] = true;
183

    
184
		if ($pconfig['save_passwd_enable'])
185
			$client['save_passwd'] = true;
186

    
187
		if ($pconfig['dns_domain_enable'])
188
			$client['dns_domain'] = $pconfig['dns_domain'];
189

    
190
		if ($pconfig['dns_server_enable']) {
191
			$client['dns_server1'] = $pconfig['dns_server1'];
192
			$client['dns_server2'] = $pconfig['dns_server2'];
193
			$client['dns_server3'] = $pconfig['dns_server3'];
194
			$client['dns_server4'] = $pconfig['dns_server4'];
195
		}
196

    
197
		if ($pconfig['wins_server_enable']) {
198
			$client['wins_server1'] = $pconfig['wins_server1'];
199
			$client['wins_server2'] = $pconfig['wins_server2'];
200
		}
201

    
202
		if ($pconfig['pfs_group_enable'])
203
			$client['pfs_group'] = $pconfig['pfs_group'];
204

    
205
		if ($pconfig['login_banner_enable'])
206
			$client['login_banner'] = $pconfig['login_banner'];
207

    
208
//		$echo "login banner = {$pconfig['login_banner']}";
209

    
210
		$a_client = $client;
211
		
212
		write_config();
213
		mark_subsystem_dirty('ipsec');
214
		
215
		header("Location: vpn_ipsec_mobile.php");
216
		exit;
217
	}
218
}
219

    
220
$pgtitle = array(gettext("VPN"),gettext("IPsec"),gettext("Mobile"));
221
$shortcut_section = "ipsec";
222

    
223
include("head.inc");
224
?>
225

    
226
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
227
<?php include("fbegin.inc"); ?>
228

    
229
<script language="JavaScript">
230
<!--
231

    
232
function pool_change() {
233

    
234
	if (document.iform.pool_enable.checked) {
235
		document.iform.pool_address.disabled = 0;
236
		document.iform.pool_netbits.disabled = 0;
237
	} else {
238
		document.iform.pool_address.disabled = 1;
239
		document.iform.pool_netbits.disabled = 1;
240
	}
241
}
242

    
243
function dns_domain_change() {
244

    
245
	if (document.iform.dns_domain_enable.checked)
246
		document.iform.dns_domain.disabled = 0;
247
	else
248
		document.iform.dns_domain.disabled = 1;
249
}
250

    
251
function dns_server_change() {
252

    
253
	if (document.iform.dns_server_enable.checked) {
254
		document.iform.dns_server1.disabled = 0;
255
		document.iform.dns_server2.disabled = 0;
256
		document.iform.dns_server3.disabled = 0;
257
		document.iform.dns_server4.disabled = 0;
258
	} else {
259
		document.iform.dns_server1.disabled = 1;
260
		document.iform.dns_server2.disabled = 1;
261
		document.iform.dns_server3.disabled = 1;
262
		document.iform.dns_server4.disabled = 1;
263
	}
264
}
265

    
266
function wins_server_change() {
267

    
268
	if (document.iform.wins_server_enable.checked) {
269
		document.iform.wins_server1.disabled = 0;
270
		document.iform.wins_server2.disabled = 0;
271
	} else {
272
		document.iform.wins_server1.disabled = 1;
273
		document.iform.wins_server2.disabled = 1;
274
	}
275
}
276

    
277
function pfs_group_change() {
278

    
279
	if (document.iform.pfs_group_enable.checked)
280
		document.iform.pfs_group.disabled = 0;
281
	else
282
		document.iform.pfs_group.disabled = 1;
283
}
284

    
285
function login_banner_change() {
286

    
287
	if (document.iform.login_banner_enable.checked)
288
		document.iform.login_banner.disabled = 0;
289
	else
290
		document.iform.login_banner.disabled = 1;
291
}
292

    
293
//-->
294
</script>
295

    
296
<form action="vpn_ipsec_mobile.php" method="post" name="iform" id="iform">
297

    
298
<?php
299
	if ($savemsg)
300
		print_info_box($savemsg);
301
	if (isset($config['ipsec']['enable']) && is_subsystem_dirty('ipsec'))
302
		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."));
303
	foreach ($a_phase1 as $ph1ent)
304
		if (isset($ph1ent['mobile']))
305
			$ph1found = true;
306
	if ($pconfig['enable'] && !$ph1found)
307
		print_info_box_np(gettext("Support for IPsec Mobile clients is enabled but a Phase1 definition was not found") . ".<br>" . gettext("Please click Create to define one."),gettext("create"),gettext("Create Phase1"));
308
	if ($input_errors)
309
		print_input_errors($input_errors);
310
?>
311

    
312
<table width="100%" border="0" cellpadding="0" cellspacing="0">
313
	<tr>
314
		<td class="tabnavtbl">
315
			<?php
316
				$tab_array = array();
317
				$tab_array[0] = array(gettext("Tunnels"), false, "vpn_ipsec.php");
318
				$tab_array[1] = array(gettext("Mobile clients"), true, "vpn_ipsec_mobile.php");
319
				$tab_array[2] = array(gettext("Pre-shared keys"), false, "vpn_ipsec_keys.php");
320
				display_top_tabs($tab_array);
321
			?>
322
		</td>
323
	</tr>
324
	<tr> 
325
		<td id="mainarea">
326
			<div class="tabcont">
327
				<table width="100%" border="0" cellpadding="6" cellspacing="0">
328
					<tr>
329
						<td width="22%" valign="top" class="vncellreq"><?=gettext("IKE Extensions"); ?></td>
330
						<td width="78%" class="vtable">
331
							<table border="0" cellspacing="2" cellpadding="0">
332
								<tr>
333
									<td>
334
										<?php set_checked($pconfig['enable'],$chk); ?>
335
										<input name="enable" type="checkbox" id="enable" value="yes" <?=$chk;?>>
336
									</td>
337
									<td>
338
										<strong><?=gettext("Enable IPsec Mobile Client Support"); ?></strong>
339
									</td>
340
								</tr>
341
							</table>
342
						</td>
343
					</tr>
344
					<tr>
345
						<td colspan="2" class="list" height="12"></td>
346
					</tr>
347
					<tr>
348
						<td colspan="2" valign="top" class="listtopic">
349
							<?=gettext("Extended Authentication (Xauth)"); ?>
350
						</td>
351
					</tr>
352
					<tr>
353
						<td width="22%" valign="top" class="vncellreq"><?=gettext("User Authentication"); ?></td>
354
						<td width="78%" class="vtable">
355
							<?=gettext("Source"); ?>:&nbsp;&nbsp;
356
							<select name="user_source" class="formselect" id="user_source">
357
								<option value="system" <?php if ($pconfig['user_source'] == 'system') echo "selected"; ?>><?=gettext("system"); ?></option>
358
								<?php
359
									if (is_array($config['system']['authserver'])) {
360
										foreach ($config['system']['authserver'] as $authcfg) {
361
											if ($authcfg['type'] == 'ldap') {
362
												$selected = "";
363
												if ($pconfig['user_source'] == $authcfg['name'])
364
													$selected = "selected";
365
												echo "<option value='{$authcfg['name']}' {$selected} >{$authcfg['name']}</option>\n";
366
											}
367
										}
368
									}
369
								?>
370
							</select>
371
						</td>
372
					</tr>
373
					<tr>
374
						<td width="22%" valign="top" class="vncellreq"><?=gettext("Group Authentication"); ?></td>
375
						<td width="78%" class="vtable">
376
							<?=gettext("Source"); ?>:&nbsp;&nbsp;
377
							<select name="group_source" class="formselect" id="group_source">
378
								<option value="system"><?=gettext("system"); ?></option>
379
							</select>
380
						</td>
381
					</tr>
382
					<tr>
383
						<td colspan="2" class="list" height="12"></td>
384
					</tr>
385
					<tr> 
386
						<td colspan="2" valign="top" class="listtopic">
387
							<?=gettext("Client Configuration (mode-cfg)"); ?>
388
						</td>
389
					</tr>
390
					<tr> 
391
						<td width="22%" valign="top" class="vncell"><?=gettext("Virtual Address Pool"); ?></td>
392
						<td width="78%" class="vtable">
393
							<table border="0" cellspacing="2" cellpadding="0">
394
								<tr>
395
									<td>
396
										<?php set_checked($pconfig['pool_enable'],$chk); ?>
397
										<input name="pool_enable" type="checkbox" id="pool_enable" value="yes" <?=$chk;?> onClick="pool_change()">
398
									</td>
399
									<td>
400
										<?=gettext("Provide a virtual IP address to clients"); ?><br>
401
									</td>
402
								</tr>
403
							</table>
404
							<table border="0" cellspacing="2" cellpadding="0">
405
								<tr>
406
									<td>
407
										<?=gettext("Network"); ?>:&nbsp;
408
										<input name="pool_address" type="text" class="formfld unknown" id="pool_address" size="20" value="<?=htmlspecialchars($pconfig['pool_address']);?>">
409
										/
410
										<select name="pool_netbits" class="formselect" id="pool_netbits">
411
											<?php for ($i = 32; $i >= 0; $i--): ?>
412
											<option value="<?=$i;?>" <?php if ($i == $pconfig['pool_netbits']) echo "selected"; ?>>
413
												<?=$i;?>
414
											</option>
415
											<?php endfor; ?>
416
										</select>
417
									</td>
418
								</tr>
419
							</table>
420
						</td>
421
					</tr>
422
					<tr>
423
						<td width="22%" valign="top" class="vncell"><?=gettext("Network List"); ?></td>
424
						<td width="78%" class="vtable">
425
							<table border="0" cellspacing="2" cellpadding="0">
426
								<tr>
427
									<td>
428
										<?php set_checked($pconfig['net_list_enable'],$chk); ?>
429
										<input name="net_list_enable" type="checkbox" id="net_list_enable" value="yes" <?=$chk;?>>
430
									</td>
431
									<td>
432
										<?=gettext("Provide a list of accessible networks to clients"); ?><br>
433
									</td>
434
								</tr>
435
							</table>
436
						</td>
437
					</tr>
438
					<tr>
439
						<td width="22%" valign="top" class="vncell"><?=gettext("Save Xauth Password"); ?></td>
440
						<td width="78%" class="vtable">
441
							<table border="0" cellspacing="2" cellpadding="0">
442
								<tr>
443
									<td>
444
										<?php set_checked($pconfig['save_passwd_enable'],$chk); ?>
445
										<input name="save_passwd_enable" type="checkbox" id="save_passwd_enable" value="yes" <?=$chk;?>>
446
									</td>
447
									<td>
448
										<?=gettext("Allow clients to save Xauth passwords (Cisco VPN client only)."); ?><br>
449
										<?=gettext("NOTE: With iPhone clients, this does not work when deployed via the iPhone configuration utility, only by manual entry."); ?><br>
450
									</td>
451
								</tr>
452
							</table>
453
						</td>
454
					</tr>
455
					<tr> 
456
						<td width="22%" valign="top" class="vncell"><?=gettext("DNS Default Domain"); ?></td>
457
						<td width="78%" class="vtable">
458
							<table border="0" cellspacing="2" cellpadding="0">
459
								<tr>
460
									<td>
461
										<?php set_checked($pconfig['dns_domain_enable'],$chk); ?>
462
										<input name="dns_domain_enable" type="checkbox" id="dns_domain_enable" value="yes" <?=$chk;?> onClick="dns_domain_change()">
463
									</td>
464
									<td>
465
										<?=gettext("Provide a default domain name to clients"); ?><br>
466
									</td>
467
								</tr>
468
							</table>
469
							<table border="0" cellspacing="2" cellpadding="0">
470
								<tr>
471
									<td>
472
										<input name="dns_domain" type="text" class="formfld unknown" id="dns_domain" size="30" value="<?=htmlspecialchars($pconfig['dns_domain']);?>">
473
									</td>
474
								</tr>
475
							</table>
476
						</td>
477
					</tr>
478
					<tr> 
479
						<td width="22%" valign="top" class="vncell"><?=gettext("DNS Servers"); ?></td>
480
						<td width="78%" class="vtable">
481
							<table border="0" cellspacing="2" cellpadding="0">
482
								<tr>
483
									<td>
484
										<?php set_checked($pconfig['dns_server_enable'],$chk); ?>
485
										<input name="dns_server_enable" type="checkbox" id="dns_server_enable" value="yes" <?=$chk;?> onClick="dns_server_change()">
486
									</td>
487
									<td>
488
										<?=gettext("Provide a DNS server list to clients"); ?><br>
489
									</td>
490
								</tr>
491
							</table>
492
							<table border="0" cellspacing="2" cellpadding="0">
493
								<tr>
494
									<td>
495
										<?=gettext("Server"); ?> #1:&nbsp;
496
										<input name="dns_server1" type="text" class="formfld unknown" id="dns_server1" size="20" value="<?=htmlspecialchars($pconfig['dns_server1']);?>">
497
									</td>
498
								</tr>
499
								<tr>
500
									<td>
501
										<?=gettext("Server"); ?> #2:&nbsp;
502
										<input name="dns_server2" type="text" class="formfld unknown" id="dns_server2" size="20" value="<?=htmlspecialchars($pconfig['dns_server2']);?>">
503
									</td>
504
								</tr>
505
								<tr>
506
									<td>
507
										<?=gettext("Server"); ?> #3:&nbsp;
508
										<input name="dns_server3" type="text" class="formfld unknown" id="dns_server3" size="20" value="<?=htmlspecialchars($pconfig['dns_server3']);?>">
509
									</td>
510
								</tr>
511
								<tr>
512
									<td>
513
										<?=gettext("Server"); ?> #4:&nbsp;
514
										<input name="dns_server4" type="text" class="formfld unknown" id="dns_server4" size="20" value="<?=htmlspecialchars($pconfig['dns_server4']);?>">
515
									</td>
516
								</tr>
517
							</table>
518
						</td>
519
					</tr>
520
					<tr> 
521
						<td width="22%" valign="top" class="vncell"><?=gettext("WINS Servers"); ?></td>
522
						<td width="78%" class="vtable">
523
							<table border="0" cellspacing="2" cellpadding="0">
524
								<tr>
525
									<td>
526
										<?php set_checked($pconfig['wins_server_enable'],$chk); ?>
527
										<input name="wins_server_enable" type="checkbox" id="wins_server_enable" value="yes" <?=$chk;?> onClick="wins_server_change()">
528
									</td>
529
									<td>
530
										<?=gettext("Provide a WINS server list to clients"); ?><br>
531
									</td>
532
								</tr>
533
							</table>
534
							<table border="0" cellspacing="2" cellpadding="0">
535
								<tr>
536
									<td>
537
										<?=gettext("Server"); ?> #1:&nbsp;
538
										<input name="wins_server1" type="text" class="formfld unknown" id="wins_server1" size="20" value="<?=htmlspecialchars($pconfig['wins_server1']);?>">
539
									</td>
540
								</tr>
541
								<tr>
542
									<td>
543
										<?=gettext("Server"); ?> #2:&nbsp;
544
										<input name="wins_server2" type="text" class="formfld unknown" id="wins_server2" size="20" value="<?=htmlspecialchars($pconfig['wins_server2']);?>">
545
									</td>
546
								</tr>
547
							</table>
548
						</td>
549
					</tr>
550
					<tr>
551
						<td width="22%" valign="top" class="vncell"><?=gettext("Phase2 PFS Group"); ?></td>
552
						<td width="78%" class="vtable">
553
							<table border="0" cellspacing="2" cellpadding="0">
554
								<tr>
555
									<td>
556
										<?php set_checked($pconfig['pfs_group_enable'],$chk); ?>
557
										<input name="pfs_group_enable" type="checkbox" id="pfs_group_enable" value="yes" <?=$chk;?> onClick="pfs_group_change()">
558
									</td>
559
									<td>
560
										<?=gettext("Provide the Phase2 PFS group to clients ( overrides all mobile phase2 settings )"); ?><br>
561
									</td>
562
								</tr>
563
							</table>
564
							<table border="0" cellspacing="2" cellpadding="0">
565
								<tr>
566
									<td>
567
										<?=gettext("Group"); ?>:&nbsp;&nbsp;
568
										<select name="pfs_group" class="formselect" id="pfs_group">
569
										<?php foreach ($p2_pfskeygroups as $keygroup => $keygroupname): ?>
570
											<option value="<?=$keygroup;?>" <?php if ($pconfig['pfs_group'] == $keygroup) echo "selected"; ?>>
571
												<?=htmlspecialchars($keygroupname);?>
572
											</option>
573
										<?php endforeach; ?>
574
										</select>
575
									</td>
576
								</tr>
577
							</table>
578
						</td>
579
					</tr>
580
					<tr> 
581
						<td width="22%" valign="top" class="vncell"><?=gettext("Login Banner"); ?></td>
582
						<td width="78%" class="vtable">
583
							<table border="0" cellspacing="2" cellpadding="0">
584
								<tr>
585
									<td>
586
										<?php set_checked($pconfig['login_banner_enable'],$chk); ?>
587
										<input name="login_banner_enable" type="checkbox" id="login_banner_enable" value="yes" <?=$chk;?> onClick="login_banner_change()">
588
									</td>
589
									<td>
590
										<?=gettext("Provide a login banner to clients"); ?><br>
591
									</td>
592
								</tr>
593
							</table>
594
							<table border="0" cellspacing="2" cellpadding="0">
595
								<tr>
596
									<td>
597
										<?php $banner = htmlspecialchars($pconfig['login_banner']); ?>
598
										<textarea name="login_banner" cols="65" rows="7" id="login_banner" class="formpre"><?=htmlspecialchars($banner);?></textarea>
599
									</td>
600
								</tr>
601
							</table>
602
						</td>
603
					</tr>
604
					<tr>
605
						<td width="22%" valign="top">&nbsp;</td>
606
						<td width="78%">
607
							<input name="submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>">
608
						</td>
609
					</tr>
610
				</table>
611
			</div>
612
		</td>
613
	</tr>
614
</table>
615
</form>
616
<script language="JavaScript">
617
pool_change();
618
dns_domain_change();
619
dns_server_change();
620
wins_server_change();
621
pfs_group_change();
622
login_banner_change();
623
//-->
624
</script>
625
<?php include("fend.inc"); ?>
626
</body>
627
</html>
628

    
629
<?php
630

    
631
/* local utility functions */
632

    
633
function set_checked($var,& $chk) {
634
	if($var)
635
		$chk = 'checked';
636
	else
637
		$chk = '';
638
}
639

    
640
?>
641

    
(236-236/251)