Project

General

Profile

Download (23.7 KB) Statistics
| Branch: | Tag: | Revision:

univnautes / usr / local / www / vpn_ipsec_mobile.php @ a1b66bec

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_split'] = $a_client['dns_split'];
65
	$pconfig['dns_server1'] = $a_client['dns_server1'];
66
	$pconfig['dns_server2'] = $a_client['dns_server2'];
67
	$pconfig['dns_server3'] = $a_client['dns_server3'];
68
	$pconfig['dns_server4'] = $a_client['dns_server4'];
69
	$pconfig['wins_server1'] = $a_client['wins_server1'];
70
	$pconfig['wins_server2'] = $a_client['wins_server2'];
71
	$pconfig['pfs_group'] = $a_client['pfs_group'];
72
	$pconfig['login_banner'] = $a_client['login_banner'];
73

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

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

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

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

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

    
91
	if ($pconfig['dns_split'])
92
		$pconfig['dns_split_enable'] = true;
93

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

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

    
100
	if (isset($pconfig['pfs_group']))
101
		$pconfig['pfs_group_enable'] = true;
102

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

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

    
111
if ($_POST['apply']) {
112
	$retval = 0;
113
	$retval = vpn_ipsec_configure();
114
	$savemsg = get_std_save_message($retval);
115
	if ($retval >= 0)
116
		if (is_subsystem_dirty('ipsec'))
117
			clear_subsystem_dirty('ipsec');
118
}
119

    
120
if ($_POST['submit']) {
121

    
122
	unset($input_errors);
123
	$pconfig = $_POST;
124

    
125
	/* input consolidation */
126

    
127
	
128

    
129
	/* input validation */
130

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

    
134
    do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
135

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

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

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

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

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

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

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

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

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

    
198
		if ($pconfig['net_list_enable'])
199
			$client['net_list'] = true;
200

    
201
		if ($pconfig['save_passwd_enable'])
202
			$client['save_passwd'] = true;
203

    
204
		if ($pconfig['dns_domain_enable'])
205
			$client['dns_domain'] = $pconfig['dns_domain'];
206

    
207
		if ($pconfig['dns_split_enable'])
208
			$client['dns_split'] = $pconfig['dns_split'];
209

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

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

    
222
		if ($pconfig['pfs_group_enable'])
223
			$client['pfs_group'] = $pconfig['pfs_group'];
224

    
225
		if ($pconfig['login_banner_enable'])
226
			$client['login_banner'] = $pconfig['login_banner'];
227

    
228
//		$echo "login banner = {$pconfig['login_banner']}";
229

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

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

    
243
include("head.inc");
244
?>
245

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

    
249
<script type="text/javascript">
250
//<![CDATA[
251

    
252
function pool_change() {
253

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

    
263
function dns_domain_change() {
264

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

    
271
function dns_split_change() {
272

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

    
279
function dns_server_change() {
280

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

    
294
function wins_server_change() {
295

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

    
305
function pfs_group_change() {
306

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

    
313
function login_banner_change() {
314

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

    
321
//]]>
322
</script>
323

    
324
<form action="vpn_ipsec_mobile.php" method="post" name="iform" id="iform">
325

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

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

    
682
<?php
683

    
684
/* local utility functions */
685

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

    
693
?>
(240-240/256)