Project

General

Profile

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

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

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

    
47
$a_phase1 = &$config['ipsec']['phase1'];
48

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

    
52
$a_client = &$config['ipsec']['client'];
53

    
54
if (count($a_client)) {
55

    
56
	$pconfig['enable'] = $a_client['enable'];
57

    
58
	$pconfig['user_source'] = $a_client['user_source'];
59
	$pconfig['group_source'] = $a_client['group_source'];
60

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

    
76
	if (isset($pconfig['enable']))
77
		$pconfig['enable'] = true;
78

    
79
	if ($pconfig['pool_address']&&$pconfig['pool_netbits'])
80
		$pconfig['pool_enable'] = true;
81
	else
82
		$pconfig['pool_netbits'] = 24;
83

    
84
	if (isset($pconfig['net_list']))
85
		$pconfig['net_list_enable'] = true;
86

    
87
	if (isset($pconfig['save_passwd']))
88
		$pconfig['save_passwd_enable'] = true;
89

    
90
	if ($pconfig['dns_domain'])
91
		$pconfig['dns_domain_enable'] = true;
92

    
93
	if ($pconfig['dns_split'])
94
		$pconfig['dns_split_enable'] = true;
95

    
96
	if ($pconfig['dns_server1']||$pconfig['dns_server2']||$pconfig['dns_server3']||$pconfig['dns_server4'])
97
		$pconfig['dns_server_enable'] = true;
98

    
99
	if ($pconfig['wins_server1']||$pconfig['wins_server2'])
100
		$pconfig['wins_server_enable'] = true;
101

    
102
	if (isset($pconfig['pfs_group']))
103
		$pconfig['pfs_group_enable'] = true;
104

    
105
	if ($pconfig['login_banner'])
106
		$pconfig['login_banner_enable'] = true;
107
}
108

    
109
if ($_POST['create']) {
110
	header("Location: vpn_ipsec_phase1.php?mobile=true");
111
}
112

    
113
if ($_POST['apply']) {
114
	$retval = 0;
115
	/* NOTE: #4353 Always restart ipsec when mobile clients settings change */
116
	$retval = vpn_ipsec_configure(true);
117
	$savemsg = get_std_save_message($retval);
118
	if ($retval >= 0)
119
		if (is_subsystem_dirty('ipsec'))
120
			clear_subsystem_dirty('ipsec');
121
}
122

    
123
if ($_POST['submit']) {
124

    
125
	unset($input_errors);
126
	$pconfig = $_POST;
127

    
128
	/* input consolidation */
129

    
130
	
131

    
132
	/* input validation */
133

    
134
	$reqdfields = explode(" ", "user_source group_source");
135
	$reqdfieldsn =  array(gettext("User Authentication Source"),gettext("Group Authentication Source"));
136

    
137
    do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
138

    
139
	if ($pconfig['pool_enable'])
140
		if (!is_ipaddr($pconfig['pool_address']))
141
			$input_errors[] = gettext("A valid IP address for 'Virtual Address Pool Network' must be specified.");
142

    
143
	if ($pconfig['dns_domain_enable'])
144
		if (!is_domain($pconfig['dns_domain']))
145
			$input_errors[] = gettext("A valid value for 'DNS Default Domain' must be specified.");
146

    
147
	if ($pconfig['dns_split_enable']) {
148
		if (!empty($pconfig['dns_split'])) {
149
			/* Replace multiple spaces by single */
150
			$pconfig['dns_split'] = preg_replace('/\s+/', ' ', trim($pconfig['dns_split']));
151
			$domain_array=explode(' ', $pconfig['dns_split']);
152
			foreach ($domain_array as $curdomain) {
153
				if (!is_domain($curdomain)) {
154
					$input_errors[] = gettext("A valid split DNS domain list must be specified.");
155
					break;
156
				}
157
			}
158
		}
159
	}
160

    
161
	if ($pconfig['dns_server_enable']) {
162
		if (!$pconfig['dns_server1'] && !$pconfig['dns_server2'] &&
163
			!$pconfig['dns_server3'] && !$pconfig['dns_server4'] )
164
			$input_errors[] = gettext("At least one DNS server must be specified to enable the DNS Server option.");
165
		if ($pconfig['dns_server1'] && !is_ipaddr($pconfig['dns_server1']))
166
			$input_errors[] = gettext("A valid IP address for 'DNS Server #1' must be specified.");
167
		if ($pconfig['dns_server2'] && !is_ipaddr($pconfig['dns_server2']))
168
			$input_errors[] = gettext("A valid IP address for 'DNS Server #2' must be specified.");
169
		if ($pconfig['dns_server3'] && !is_ipaddr($pconfig['dns_server3']))
170
			$input_errors[] = gettext("A valid IP address for 'DNS Server #3' must be specified.");
171
		if ($pconfig['dns_server4'] && !is_ipaddr($pconfig['dns_server4']))
172
			$input_errors[] = gettext("A valid IP address for 'DNS Server #4' must be specified.");
173
	}
174

    
175
	if ($pconfig['wins_server_enable']) {
176
		if (!$pconfig['wins_server1'] && !$pconfig['wins_server2'])
177
			$input_errors[] = gettext("At least one WINS server must be specified to enable the DNS Server option.");
178
		if ($pconfig['wins_server1'] && !is_ipaddr($pconfig['wins_server1']))
179
			$input_errors[] = gettext("A valid IP address for 'WINS Server #1' must be specified.");
180
		if ($pconfig['wins_server2'] && !is_ipaddr($pconfig['wins_server2']))
181
			$input_errors[] = gettext("A valid IP address for 'WINS Server #2' must be specified.");
182
	}
183

    
184
	if ($pconfig['login_banner_enable'])
185
		if (!strlen($pconfig['login_banner']))
186
			$input_errors[] = gettext("A valid value for 'Login Banner' must be specified.");
187

    
188
	if (!$input_errors) {
189
		$client = array();
190
		
191
		if ($pconfig['enable'])
192
			$client['enable'] = true;
193

    
194
		if (!empty($pconfig['user_source']))
195
			$client['user_source'] = implode(",", $pconfig['user_source']);
196
		$client['group_source'] = $pconfig['group_source'];
197

    
198
		if ($pconfig['pool_enable']) {
199
			$client['pool_address'] = $pconfig['pool_address'];
200
			$client['pool_netbits'] = $pconfig['pool_netbits'];
201
		}
202

    
203
		if ($pconfig['net_list_enable'])
204
			$client['net_list'] = true;
205

    
206
		if ($pconfig['save_passwd_enable'])
207
			$client['save_passwd'] = true;
208

    
209
		if ($pconfig['dns_domain_enable'])
210
			$client['dns_domain'] = $pconfig['dns_domain'];
211

    
212
		if ($pconfig['dns_split_enable'])
213
			$client['dns_split'] = $pconfig['dns_split'];
214

    
215
		if ($pconfig['dns_server_enable']) {
216
			$client['dns_server1'] = $pconfig['dns_server1'];
217
			$client['dns_server2'] = $pconfig['dns_server2'];
218
			$client['dns_server3'] = $pconfig['dns_server3'];
219
			$client['dns_server4'] = $pconfig['dns_server4'];
220
		}
221

    
222
		if ($pconfig['wins_server_enable']) {
223
			$client['wins_server1'] = $pconfig['wins_server1'];
224
			$client['wins_server2'] = $pconfig['wins_server2'];
225
		}
226

    
227
		if ($pconfig['pfs_group_enable'])
228
			$client['pfs_group'] = $pconfig['pfs_group'];
229

    
230
		if ($pconfig['login_banner_enable'])
231
			$client['login_banner'] = $pconfig['login_banner'];
232

    
233
		$a_client = $client;
234
		
235
		write_config();
236
		mark_subsystem_dirty('ipsec');
237
		
238
		header("Location: vpn_ipsec_mobile.php");
239
		exit;
240
	}
241
}
242

    
243
$pgtitle = array(gettext("VPN"),gettext("IPsec"),gettext("Mobile"));
244
$shortcut_section = "ipsec";
245

    
246
include("head.inc");
247
?>
248

    
249
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
250
<?php include("fbegin.inc"); ?>
251

    
252
<script type="text/javascript">
253
//<![CDATA[
254

    
255
function pool_change() {
256

    
257
	if (document.iform.pool_enable.checked) {
258
		document.iform.pool_address.disabled = 0;
259
		document.iform.pool_netbits.disabled = 0;
260
	} else {
261
		document.iform.pool_address.disabled = 1;
262
		document.iform.pool_netbits.disabled = 1;
263
	}
264
}
265

    
266
function dns_domain_change() {
267

    
268
	if (document.iform.dns_domain_enable.checked)
269
		document.iform.dns_domain.disabled = 0;
270
	else
271
		document.iform.dns_domain.disabled = 1;
272
}
273

    
274
function dns_split_change() {
275

    
276
	if (document.iform.dns_split_enable.checked)
277
		document.iform.dns_split.disabled = 0;
278
	else
279
		document.iform.dns_split.disabled = 1;
280
}
281

    
282
function dns_server_change() {
283

    
284
	if (document.iform.dns_server_enable.checked) {
285
		document.iform.dns_server1.disabled = 0;
286
		document.iform.dns_server2.disabled = 0;
287
		document.iform.dns_server3.disabled = 0;
288
		document.iform.dns_server4.disabled = 0;
289
	} else {
290
		document.iform.dns_server1.disabled = 1;
291
		document.iform.dns_server2.disabled = 1;
292
		document.iform.dns_server3.disabled = 1;
293
		document.iform.dns_server4.disabled = 1;
294
	}
295
}
296

    
297
function wins_server_change() {
298

    
299
	if (document.iform.wins_server_enable.checked) {
300
		document.iform.wins_server1.disabled = 0;
301
		document.iform.wins_server2.disabled = 0;
302
	} else {
303
		document.iform.wins_server1.disabled = 1;
304
		document.iform.wins_server2.disabled = 1;
305
	}
306
}
307

    
308
function pfs_group_change() {
309

    
310
	if (document.iform.pfs_group_enable.checked)
311
		document.iform.pfs_group.disabled = 0;
312
	else
313
		document.iform.pfs_group.disabled = 1;
314
}
315

    
316
function login_banner_change() {
317

    
318
	if (document.iform.login_banner_enable.checked)
319
		document.iform.login_banner.disabled = 0;
320
	else
321
		document.iform.login_banner.disabled = 1;
322
}
323

    
324
//]]>
325
</script>
326

    
327
<form action="vpn_ipsec_mobile.php" method="post" name="iform" id="iform">
328

    
329
<?php
330
	if ($savemsg)
331
		print_info_box($savemsg);
332
	if (isset($config['ipsec']['enable']) && is_subsystem_dirty('ipsec'))
333
		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."));
334
	foreach ($a_phase1 as $ph1ent)
335
		if (isset($ph1ent['mobile']))
336
			$ph1found = true;
337
	if ($pconfig['enable'] && !$ph1found)
338
		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"));
339
	if ($input_errors)
340
		print_input_errors($input_errors);
341
?>
342

    
343
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="vpn ipsec mobile">
344
	<tr>
345
		<td class="tabnavtbl">
346
			<?php
347
				$tab_array = array();
348
				$tab_array[0] = array(gettext("Tunnels"), false, "vpn_ipsec.php");
349
				$tab_array[1] = array(gettext("Mobile clients"), true, "vpn_ipsec_mobile.php");
350
				$tab_array[2] = array(gettext("Pre-Shared Key"), false, "vpn_ipsec_keys.php");
351
				$tab_array[3] = array(gettext("Advanced Settings"), false, "vpn_ipsec_settings.php");
352
				display_top_tabs($tab_array);
353
			?>
354
		</td>
355
	</tr>
356
	<tr> 
357
		<td id="mainarea">
358
			<div class="tabcont">
359
				<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
360
					<tr>
361
						<td width="22%" valign="top" class="vncellreq"><?=gettext("IKE Extensions"); ?></td>
362
						<td width="78%" class="vtable">
363
							<table border="0" cellspacing="2" cellpadding="0" summary="ike extensions">
364
								<tr>
365
									<td>
366
										<?php set_checked($pconfig['enable'],$chk); ?>
367
										<input name="enable" type="checkbox" id="enable" value="yes" <?=$chk;?> />
368
									</td>
369
									<td>
370
										<strong><?=gettext("Enable IPsec Mobile Client Support"); ?></strong>
371
									</td>
372
								</tr>
373
							</table>
374
						</td>
375
					</tr>
376
					<tr>
377
						<td colspan="2" class="list" height="12"></td>
378
					</tr>
379
					<tr>
380
						<td colspan="2" valign="top" class="listtopic">
381
							<?=gettext("Extended Authentication (Xauth)"); ?>
382
						</td>
383
					</tr>
384
					<tr>
385
						<td width="22%" valign="top" class="vncellreq"><?=gettext("User Authentication"); ?></td>
386
						<td width="78%" class="vtable">
387
							<?=gettext("Source"); ?>:&nbsp;&nbsp;
388
							<select name="user_source[]" class="formselect" id="user_source" multiple="multiple" size="3">
389
							<?php
390
								$authmodes = explode(",", $pconfig['user_source']);
391
								$auth_servers = auth_get_authserver_list();
392
								foreach ($auth_servers as $auth_server) {
393
									$selected = "";
394
									if (in_array($auth_server['name'], $authmodes))
395
										$selected = "selected=\"selected\"";
396
									echo "<option value='{$auth_server['name']}' {$selected}>{$auth_server['name']}</option>\n";
397
								}
398
							?>
399
							</select>
400
						</td>
401
					</tr>
402
					<tr>
403
						<td width="22%" valign="top" class="vncellreq"><?=gettext("Group Authentication"); ?></td>
404
						<td width="78%" class="vtable">
405
							<?=gettext("Source"); ?>:&nbsp;&nbsp;
406
							<select name="group_source" class="formselect" id="group_source">
407
								<option value="none"><?=gettext("none"); ?></option>
408
								<option value="system" <?php if ($pconfig['group_source'] == "system") echo "selected=\"selected\""; ?> ><?=gettext("system"); ?></option>
409
							</select>
410
						</td>
411
					</tr>
412
					<tr>
413
						<td colspan="2" class="list" height="12"></td>
414
					</tr>
415
					<tr> 
416
						<td colspan="2" valign="top" class="listtopic">
417
							<?=gettext("Client Configuration (mode-cfg)"); ?>
418
						</td>
419
					</tr>
420
					<tr> 
421
						<td width="22%" valign="top" class="vncell"><?=gettext("Virtual Address Pool"); ?></td>
422
						<td width="78%" class="vtable">
423
							<table border="0" cellspacing="2" cellpadding="0" summary="enable pool">
424
								<tr>
425
									<td>
426
										<?php set_checked($pconfig['pool_enable'],$chk); ?>
427
										<input name="pool_enable" type="checkbox" id="pool_enable" value="yes" <?=$chk;?> onclick="pool_change()" />
428
									</td>
429
									<td>
430
										<?=gettext("Provide a virtual IP address to clients"); ?><br />
431
									</td>
432
								</tr>
433
							</table>
434
							<table border="0" cellspacing="2" cellpadding="0" summary="virtual address pool">
435
								<tr>
436
									<td>
437
										<?=gettext("Network"); ?>:&nbsp;
438
										<input name="pool_address" type="text" class="formfld unknown" id="pool_address" size="20" value="<?=htmlspecialchars($pconfig['pool_address']);?>" />
439
										/
440
										<select name="pool_netbits" class="formselect" id="pool_netbits">
441
											<?php for ($i = 32; $i >= 0; $i--): ?>
442
											<option value="<?=$i;?>" <?php if ($i == $pconfig['pool_netbits']) echo "selected=\"selected\""; ?>>
443
												<?=$i;?>
444
											</option>
445
											<?php endfor; ?>
446
										</select>
447
									</td>
448
								</tr>
449
							</table>
450
						</td>
451
					</tr>
452
					<tr>
453
						<td width="22%" valign="top" class="vncell"><?=gettext("Network List"); ?></td>
454
						<td width="78%" class="vtable">
455
							<table border="0" cellspacing="2" cellpadding="0" summary="network list">
456
								<tr>
457
									<td>
458
										<?php set_checked($pconfig['net_list_enable'],$chk); ?>
459
										<input name="net_list_enable" type="checkbox" id="net_list_enable" value="yes" <?=$chk;?> />
460
									</td>
461
									<td>
462
										<?=gettext("Provide a list of accessible networks to clients"); ?><br />
463
									</td>
464
								</tr>
465
							</table>
466
						</td>
467
					</tr>
468
					<tr>
469
						<td width="22%" valign="top" class="vncell"><?=gettext("Save Xauth Password"); ?></td>
470
						<td width="78%" class="vtable">
471
							<table border="0" cellspacing="2" cellpadding="0" summary="password">
472
								<tr>
473
									<td>
474
										<?php set_checked($pconfig['save_passwd_enable'],$chk); ?>
475
										<input name="save_passwd_enable" type="checkbox" id="save_passwd_enable" value="yes" <?=$chk;?> />
476
									</td>
477
									<td>
478
										<?=gettext("Allow clients to save Xauth passwords (Cisco VPN client only)."); ?><br />
479
										<?=gettext("NOTE: With iPhone clients, this does not work when deployed via the iPhone configuration utility, only by manual entry."); ?><br />
480
									</td>
481
								</tr>
482
							</table>
483
						</td>
484
					</tr>
485
					<tr> 
486
						<td width="22%" valign="top" class="vncell"><?=gettext("DNS Default Domain"); ?></td>
487
						<td width="78%" class="vtable">
488
							<table border="0" cellspacing="2" cellpadding="0" summary="enable dns default domain">
489
								<tr>
490
									<td>
491
										<?php set_checked($pconfig['dns_domain_enable'],$chk); ?>
492
										<input name="dns_domain_enable" type="checkbox" id="dns_domain_enable" value="yes" <?=$chk;?> onclick="dns_domain_change()" />
493
									</td>
494
									<td>
495
										<?=gettext("Provide a default domain name to clients"); ?><br />
496
									</td>
497
								</tr>
498
							</table>
499
							<table border="0" cellspacing="2" cellpadding="0" summary="dns default domain">
500
								<tr>
501
									<td>
502
										<input name="dns_domain" type="text" class="formfld unknown" id="dns_domain" size="30" value="<?=htmlspecialchars($pconfig['dns_domain']);?>" />
503
									</td>
504
								</tr>
505
							</table>
506
						</td>
507
					</tr>
508
					<tr>
509
						<td width="22%" valign="top" class="vncell"><?=gettext("Split DNS"); ?></td>
510
						<td width="78%" class="vtable">
511
							<table border="0" cellspacing="2" cellpadding="0" summary="enable split dns">
512
								<tr>
513
									<td>
514
										<?php set_checked($pconfig['dns_split_enable'],$chk); ?>
515
										<input name="dns_split_enable" type="checkbox" id="dns_split_enable" value="yes" <?=$chk;?> onclick="dns_split_change()" />
516
									</td>
517
									<td>
518
										<?=gettext("Provide a list of split DNS domain names to clients. Enter a space separated list."); ?><br />
519
										<?=gettext("NOTE: If left blank, and a default domain is set, it will be used for this value."); ?>
520
									</td>
521
								</tr>
522
							</table>
523
							<table border="0" cellspacing="2" cellpadding="0" summary="split dns">
524
								<tr>
525
									<td>
526
										<input name="dns_split" type="text" class="formfld unknown" id="dns_split" size="30" value="<?=htmlspecialchars($pconfig['dns_split']);?>" />
527
									</td>
528
								</tr>
529
							</table>
530
						</td>
531
					</tr>
532
					<tr> 
533
						<td width="22%" valign="top" class="vncell"><?=gettext("DNS Servers"); ?></td>
534
						<td width="78%" class="vtable">
535
							<table border="0" cellspacing="2" cellpadding="0" summary="enable dns servers">
536
								<tr>
537
									<td>
538
										<?php set_checked($pconfig['dns_server_enable'],$chk); ?>
539
										<input name="dns_server_enable" type="checkbox" id="dns_server_enable" value="yes" <?=$chk;?> onclick="dns_server_change()" />
540
									</td>
541
									<td>
542
										<?=gettext("Provide a DNS server list to clients"); ?><br />
543
									</td>
544
								</tr>
545
							</table>
546
							<table border="0" cellspacing="2" cellpadding="0" summary="dns servers">
547
								<tr>
548
									<td>
549
										<?=gettext("Server"); ?> #1:&nbsp;
550
										<input name="dns_server1" type="text" class="formfld unknown" id="dns_server1" size="20" value="<?=htmlspecialchars($pconfig['dns_server1']);?>" />
551
									</td>
552
								</tr>
553
								<tr>
554
									<td>
555
										<?=gettext("Server"); ?> #2:&nbsp;
556
										<input name="dns_server2" type="text" class="formfld unknown" id="dns_server2" size="20" value="<?=htmlspecialchars($pconfig['dns_server2']);?>" />
557
									</td>
558
								</tr>
559
								<tr>
560
									<td>
561
										<?=gettext("Server"); ?> #3:&nbsp;
562
										<input name="dns_server3" type="text" class="formfld unknown" id="dns_server3" size="20" value="<?=htmlspecialchars($pconfig['dns_server3']);?>" />
563
									</td>
564
								</tr>
565
								<tr>
566
									<td>
567
										<?=gettext("Server"); ?> #4:&nbsp;
568
										<input name="dns_server4" type="text" class="formfld unknown" id="dns_server4" size="20" value="<?=htmlspecialchars($pconfig['dns_server4']);?>" />
569
									</td>
570
								</tr>
571
							</table>
572
						</td>
573
					</tr>
574
					<tr> 
575
						<td width="22%" valign="top" class="vncell"><?=gettext("WINS Servers"); ?></td>
576
						<td width="78%" class="vtable">
577
							<table border="0" cellspacing="2" cellpadding="0" summary="enable wins servers">
578
								<tr>
579
									<td>
580
										<?php set_checked($pconfig['wins_server_enable'],$chk); ?>
581
										<input name="wins_server_enable" type="checkbox" id="wins_server_enable" value="yes" <?=$chk;?> onclick="wins_server_change()" />
582
									</td>
583
									<td>
584
										<?=gettext("Provide a WINS server list to clients"); ?><br />
585
									</td>
586
								</tr>
587
							</table>
588
							<table border="0" cellspacing="2" cellpadding="0" summary="wins servers">
589
								<tr>
590
									<td>
591
										<?=gettext("Server"); ?> #1:&nbsp;
592
										<input name="wins_server1" type="text" class="formfld unknown" id="wins_server1" size="20" value="<?=htmlspecialchars($pconfig['wins_server1']);?>" />
593
									</td>
594
								</tr>
595
								<tr>
596
									<td>
597
										<?=gettext("Server"); ?> #2:&nbsp;
598
										<input name="wins_server2" type="text" class="formfld unknown" id="wins_server2" size="20" value="<?=htmlspecialchars($pconfig['wins_server2']);?>" />
599
									</td>
600
								</tr>
601
							</table>
602
						</td>
603
					</tr>
604
					<tr>
605
						<td width="22%" valign="top" class="vncell"><?=gettext("Phase2 PFS Group"); ?></td>
606
						<td width="78%" class="vtable">
607
							<table border="0" cellspacing="2" cellpadding="0" summary="enable pfs group">
608
								<tr>
609
									<td>
610
										<?php set_checked($pconfig['pfs_group_enable'],$chk); ?>
611
										<input name="pfs_group_enable" type="checkbox" id="pfs_group_enable" value="yes" <?=$chk;?> onclick="pfs_group_change()" />
612
									</td>
613
									<td>
614
										<?=gettext("Provide the Phase2 PFS group to clients ( overrides all mobile phase2 settings )"); ?><br />
615
									</td>
616
								</tr>
617
							</table>
618
							<table border="0" cellspacing="2" cellpadding="0" summary="phase-2 pfs group">
619
								<tr>
620
									<td>
621
										<?=gettext("Group"); ?>:&nbsp;&nbsp;
622
										<select name="pfs_group" class="formselect" id="pfs_group">
623
										<?php foreach ($p2_pfskeygroups as $keygroup => $keygroupname): ?>
624
											<option value="<?=$keygroup;?>" <?php if ($pconfig['pfs_group'] == $keygroup) echo "selected=\"selected\""; ?>>
625
												<?=htmlspecialchars($keygroupname);?>
626
											</option>
627
										<?php endforeach; ?>
628
										</select>
629
									</td>
630
								</tr>
631
							</table>
632
						</td>
633
					</tr>
634
					<tr> 
635
						<td width="22%" valign="top" class="vncell"><?=gettext("Login Banner"); ?></td>
636
						<td width="78%" class="vtable">
637
							<table border="0" cellspacing="2" cellpadding="0" summary="enable login banner">
638
								<tr>
639
									<td>
640
										<?php set_checked($pconfig['login_banner_enable'],$chk); ?>
641
										<input name="login_banner_enable" type="checkbox" id="login_banner_enable" value="yes" <?=$chk;?> onclick="login_banner_change()" />
642
									</td>
643
									<td>
644
										<?=gettext("Provide a login banner to clients"); ?><br />
645
									</td>
646
								</tr>
647
							</table>
648
							<table border="0" cellspacing="2" cellpadding="0" summary="banner">
649
								<tr>
650
									<td>
651
										<?php $banner = htmlspecialchars($pconfig['login_banner']); ?>
652
										<textarea name="login_banner" cols="65" rows="7" id="login_banner" class="formpre"><?=htmlspecialchars($banner);?></textarea>
653
									</td>
654
								</tr>
655
							</table>
656
						</td>
657
					</tr>
658
					<tr>
659
						<td width="22%" valign="top">&nbsp;</td>
660
						<td width="78%">
661
							<input name="submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
662
						</td>
663
					</tr>
664
				</table>
665
			</div>
666
		</td>
667
	</tr>
668
</table>
669
</form>
670
<script type="text/javascript">
671
//<![CDATA[
672
pool_change();
673
dns_domain_change();
674
dns_split_change();
675
dns_server_change();
676
wins_server_change();
677
pfs_group_change();
678
login_banner_change();
679
//]]>
680
</script>
681
<?php include("fend.inc"); ?>
682
</body>
683
</html>
684

    
685
<?php
686

    
687
/* local utility functions */
688

    
689
function set_checked($var,& $chk) {
690
	if($var)
691
		$chk = "checked=\"checked\"";
692
	else
693
		$chk = "";
694
}
695

    
696
?>
(240-240/256)