Project

General

Profile

Download (23.8 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
	$retval = vpn_ipsec_configure();
116
	$savemsg = get_std_save_message($retval);
117
	if ($retval >= 0)
118
		if (is_subsystem_dirty('ipsec'))
119
			clear_subsystem_dirty('ipsec');
120
}
121

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

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

    
127
	/* input consolidation */
128

    
129
	
130

    
131
	/* input validation */
132

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

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

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

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

    
146
	if ($pconfig['dns_split_enable']) {
147
		if (!empty($pconfig['dns_split'])) {
148
			$domain_array=preg_split("/[ ,]+/",$pconfig['dns_split']);
149
			foreach ($domain_array as $curdomain) {
150
				if (!is_domain($curdomain)) {
151
					$input_errors[] = gettext("A valid split DNS domain list must be specified.");
152
					break;
153
				}
154
			}
155
		}
156
	}
157

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

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

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

    
185
	if (!$input_errors) {
186
		$client = array();
187
		
188
		if ($pconfig['enable'])
189
			$client['enable'] = true;
190

    
191
		if (!empty($pconfig['user_source']))
192
			$client['user_source'] = implode(",", $pconfig['user_source']);
193
		$client['group_source'] = $pconfig['group_source'];
194

    
195
		if ($pconfig['pool_enable']) {
196
			$client['pool_address'] = $pconfig['pool_address'];
197
			$client['pool_netbits'] = $pconfig['pool_netbits'];
198
		}
199

    
200
		if ($pconfig['net_list_enable'])
201
			$client['net_list'] = true;
202

    
203
		if ($pconfig['save_passwd_enable'])
204
			$client['save_passwd'] = true;
205

    
206
		if ($pconfig['dns_domain_enable'])
207
			$client['dns_domain'] = $pconfig['dns_domain'];
208

    
209
		if ($pconfig['dns_split_enable'])
210
			$client['dns_split'] = $pconfig['dns_split'];
211

    
212
		if ($pconfig['dns_server_enable']) {
213
			$client['dns_server1'] = $pconfig['dns_server1'];
214
			$client['dns_server2'] = $pconfig['dns_server2'];
215
			$client['dns_server3'] = $pconfig['dns_server3'];
216
			$client['dns_server4'] = $pconfig['dns_server4'];
217
		}
218

    
219
		if ($pconfig['wins_server_enable']) {
220
			$client['wins_server1'] = $pconfig['wins_server1'];
221
			$client['wins_server2'] = $pconfig['wins_server2'];
222
		}
223

    
224
		if ($pconfig['pfs_group_enable'])
225
			$client['pfs_group'] = $pconfig['pfs_group'];
226

    
227
		if ($pconfig['login_banner_enable'])
228
			$client['login_banner'] = $pconfig['login_banner'];
229

    
230
//		$echo "login banner = {$pconfig['login_banner']}";
231

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

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

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

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

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

    
254
function pool_change() {
255

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

    
265
function dns_domain_change() {
266

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

    
273
function dns_split_change() {
274

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

    
281
function dns_server_change() {
282

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

    
296
function wins_server_change() {
297

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

    
307
function pfs_group_change() {
308

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

    
315
function login_banner_change() {
316

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

    
323
//]]>
324
</script>
325

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

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

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

    
684
<?php
685

    
686
/* local utility functions */
687

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

    
695
?>
(240-240/256)