Projet

Général

Profil

Télécharger (23,1 ko) Statistiques
| Branche: | Tag: | Révision:

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

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

    
680
<?php
681

    
682
/* local utility functions */
683

    
684
function set_checked($var,& $chk) {
685
	if($var)
686
		$chk = 'checked="checked"';
687
	else
688
		$chk = '';
689
}
690

    
691
?>
692

    
(231-231/246)