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-2014 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

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

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

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

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

    
53
if (count($a_client)) {
54

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
126
	/* input consolidation */
127

    
128
	
129

    
130
	/* input validation */
131

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
253
function pool_change() {
254

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

    
264
function dns_domain_change() {
265

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

    
272
function dns_split_change() {
273

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

    
280
function dns_server_change() {
281

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

    
295
function wins_server_change() {
296

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

    
306
function pfs_group_change() {
307

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

    
314
function login_banner_change() {
315

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

    
322
//]]>
323
</script>
324

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

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

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

    
683
<?php
684

    
685
/* local utility functions */
686

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

    
694
?>
(240-240/256)