Project

General

Profile

Download (20.8 KB) Statistics
| Branch: | Tag: | Revision:
1 5b237745 Scott Ullrich
<?php
2
/*
3
	vpn_ipsec_mobile.php
4
	
5 3462a529 Matthew Grooms
	Copyright (C) 2008 Shrew Soft Inc
6 5b237745 Scott Ullrich
	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 6b07c15a Matthew Grooms
##|+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 0f84b741 Scott Ullrich
require("functions.inc");
38 5b237745 Scott Ullrich
require("guiconfig.inc");
39 483e6de8 Scott Ullrich
require_once("ipsec.inc");
40
require_once("vpn.inc");
41 5b237745 Scott Ullrich
42 3462a529 Matthew Grooms
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 4178a1dd jim-p
	$pconfig['save_passwd'] = $a_client['save_passwd'];
63 3462a529 Matthew Grooms
	$pconfig['dns_domain'] = $a_client['dns_domain'];
64
	$pconfig['dns_server1'] = $a_client['dns_server1'];
65
	$pconfig['dns_server2'] = $a_client['dns_server2'];
66
	$pconfig['dns_server3'] = $a_client['dns_server3'];
67
	$pconfig['dns_server4'] = $a_client['dns_server4'];
68
	$pconfig['wins_server1'] = $a_client['wins_server1'];
69
	$pconfig['wins_server2'] = $a_client['wins_server2'];
70
	$pconfig['pfs_group'] = $a_client['pfs_group'];
71
	$pconfig['login_banner'] = $a_client['login_banner'];
72
73
	if (isset($pconfig['enable']))
74
		$pconfig['enable'] = true;
75
76
	if ($pconfig['pool_address']&&$pconfig['pool_netbits'])
77
		$pconfig['pool_enable'] = true;
78
	else
79
		$pconfig['pool_netbits'] = 24;
80
81
	if (isset($pconfig['net_list']))
82
		$pconfig['net_list_enable'] = true;
83
84 4178a1dd jim-p
	if (isset($pconfig['save_passwd']))
85
		$pconfig['save_passwd_enable'] = true;
86
87 3462a529 Matthew Grooms
	if ($pconfig['dns_domain'])
88
		$pconfig['dns_domain_enable'] = true;
89
90
	if ($pconfig['dns_server1']||$pconfig['dns_server2']||$pconfig['dns_server3']||$pconfig['dns_server4'])
91
		$pconfig['dns_server_enable'] = true;
92
93
	if ($pconfig['wins_server1']||$pconfig['wins_server2'])
94
		$pconfig['wins_server_enable'] = true;
95
96
	if (isset($pconfig['pfs_group']))
97
		$pconfig['pfs_group_enable'] = true;
98
99
	if ($pconfig['login_banner'])
100
		$pconfig['login_banner_enable'] = true;
101 5b237745 Scott Ullrich
}
102 3462a529 Matthew Grooms
103
if ($_POST['create']) {
104
	header("Location: vpn_ipsec_phase1.php?mobile=true");
105
}
106
107
if ($_POST['apply']) {
108
	$retval = 0;
109
	$retval = vpn_ipsec_configure();
110
	$savemsg = get_std_save_message($retval);
111
	if ($retval == 0)
112 a368a026 Ermal Lu?i
		if (is_subsystem_dirty('ipsec'))
113
			clear_subsystem_dirty('ipsec');
114 5b237745 Scott Ullrich
}
115
116 3462a529 Matthew Grooms
if ($_POST['submit']) {
117
118 5b237745 Scott Ullrich
	unset($input_errors);
119
	$pconfig = $_POST;
120
121 3462a529 Matthew Grooms
	/* input consolidation */
122
123 e2411886 Scott Ullrich
	
124 3462a529 Matthew Grooms
125
	/* input validation */
126
127
	$reqdfields = explode(" ", "user_source group_source");
128 bfbd2610 Carlos Eduardo Ramos
	$reqdfieldsn =  array(gettext("User Authentication Source"),gettext("Group Authentication Source"));
129 3462a529 Matthew Grooms
130
    do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
131
132
	if ($pconfig['pool_enable'])
133
		if (!is_ipaddr($pconfig['pool_address']))
134 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid IP address for 'Virtual Address Pool Network' must be specified.");
135 3462a529 Matthew Grooms
136
	if ($pconfig['dns_domain_enable'])
137
		if (!is_domain($pconfig['dns_domain']))
138 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid value for 'DNS Default Domain' must be specified.");
139 3462a529 Matthew Grooms
140
	if ($pconfig['dns_server_enable']) {
141
		if (!$pconfig['dns_server1'] && !$pconfig['dns_server2'] &&
142
			!$pconfig['dns_server3'] && !$pconfig['dns_server4'] )
143 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("At least one DNS server must be specified to enable the DNS Server option.");
144 3462a529 Matthew Grooms
		if ($pconfig['dns_server1'] && !is_ipaddr($pconfig['dns_server1']))
145 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid IP address for 'DNS Server #1' must be specified.");
146 3462a529 Matthew Grooms
		if ($pconfig['dns_server2'] && !is_ipaddr($pconfig['dns_server2']))
147 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid IP address for 'DNS Server #2' must be specified.");
148 3462a529 Matthew Grooms
		if ($pconfig['dns_server3'] && !is_ipaddr($pconfig['dns_server3']))
149 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid IP address for 'DNS Server #3' must be specified.");
150 3462a529 Matthew Grooms
		if ($pconfig['dns_server4'] && !is_ipaddr($pconfig['dns_server4']))
151 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid IP address for 'DNS Server #4' must be specified.");
152 5b237745 Scott Ullrich
	}
153 3462a529 Matthew Grooms
154
	if ($pconfig['wins_server_enable']) {
155
		if (!$pconfig['wins_server1'] && !$pconfig['wins_server2'])
156 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("At least one WINS server must be specified to enable the DNS Server option.");
157 3462a529 Matthew Grooms
		if ($pconfig['wins_server1'] && !is_ipaddr($pconfig['wins_server1']))
158 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid IP address for 'WINS Server #1' must be specified.");
159 3462a529 Matthew Grooms
		if ($pconfig['wins_server2'] && !is_ipaddr($pconfig['wins_server2']))
160 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid IP address for 'WINS Server #2' must be specified.");
161 5b237745 Scott Ullrich
	}
162 3462a529 Matthew Grooms
163
	if ($pconfig['login_banner_enable'])
164
		if (!strlen($pconfig['login_banner']))
165 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid value for 'Login Banner' must be specified.");
166 5b237745 Scott Ullrich
167
	if (!$input_errors) {
168 3462a529 Matthew Grooms
		$client = array();
169 5b237745 Scott Ullrich
		
170 3462a529 Matthew Grooms
		if ($pconfig['enable'])
171
			$client['enable'] = true;
172
173
		$client['user_source'] = $pconfig['user_source'];
174
		$client['group_source'] = $pconfig['group_source'];
175
176
		if ($pconfig['pool_enable']) {
177
			$client['pool_address'] = $pconfig['pool_address'];
178
			$client['pool_netbits'] = $pconfig['pool_netbits'];
179 5b237745 Scott Ullrich
		}
180 3462a529 Matthew Grooms
181
		if ($pconfig['net_list_enable'])
182
			$client['net_list'] = true;
183
184 4178a1dd jim-p
		if ($pconfig['save_passwd_enable'])
185
			$client['save_passwd'] = true;
186
187 3462a529 Matthew Grooms
		if ($pconfig['dns_domain_enable'])
188
			$client['dns_domain'] = $pconfig['dns_domain'];
189
190
		if ($pconfig['dns_server_enable']) {
191
			$client['dns_server1'] = $pconfig['dns_server1'];
192
			$client['dns_server2'] = $pconfig['dns_server2'];
193
			$client['dns_server3'] = $pconfig['dns_server3'];
194
			$client['dns_server4'] = $pconfig['dns_server4'];
195
		}
196
197
		if ($pconfig['wins_server_enable']) {
198
			$client['wins_server1'] = $pconfig['wins_server1'];
199
			$client['wins_server2'] = $pconfig['wins_server2'];
200
		}
201
202
		if ($pconfig['pfs_group_enable'])
203
			$client['pfs_group'] = $pconfig['pfs_group'];
204
205
		if ($pconfig['login_banner_enable'])
206
			$client['login_banner'] = $pconfig['login_banner'];
207
208
//		$echo "login banner = {$pconfig['login_banner']}";
209
210
		$a_client = $client;
211 5b237745 Scott Ullrich
		
212
		write_config();
213 a368a026 Ermal Lu?i
		mark_subsystem_dirty('ipsec');
214 5b237745 Scott Ullrich
		
215
		header("Location: vpn_ipsec_mobile.php");
216
		exit;
217
	}
218
}
219 422f27c0 Scott Ullrich
220 bfbd2610 Carlos Eduardo Ramos
$pgtitle = array(gettext("VPN"),gettext("IPsec"),gettext("Mobile"));
221 6deedfde jim-p
$statusurl = "diag_ipsec.php";
222
$logurl = "diag_logs_ipsec.php";
223
224 4df96eff Scott Ullrich
include("head.inc");
225
?>
226 3462a529 Matthew Grooms
227 422f27c0 Scott Ullrich
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
228 5b237745 Scott Ullrich
<?php include("fbegin.inc"); ?>
229 3462a529 Matthew Grooms
230 e2411886 Scott Ullrich
<script language="JavaScript">
231
<!--
232 3462a529 Matthew Grooms
233
function pool_change() {
234
235
	if (document.iform.pool_enable.checked) {
236
		document.iform.pool_address.disabled = 0;
237
		document.iform.pool_netbits.disabled = 0;
238
	} else {
239
		document.iform.pool_address.disabled = 1;
240
		document.iform.pool_netbits.disabled = 1;
241
	}
242
}
243
244
function dns_domain_change() {
245
246
	if (document.iform.dns_domain_enable.checked)
247
		document.iform.dns_domain.disabled = 0;
248
	else
249
		document.iform.dns_domain.disabled = 1;
250
}
251
252
function dns_server_change() {
253
254
	if (document.iform.dns_server_enable.checked) {
255
		document.iform.dns_server1.disabled = 0;
256
		document.iform.dns_server2.disabled = 0;
257
		document.iform.dns_server3.disabled = 0;
258
		document.iform.dns_server4.disabled = 0;
259
	} else {
260
		document.iform.dns_server1.disabled = 1;
261
		document.iform.dns_server2.disabled = 1;
262
		document.iform.dns_server3.disabled = 1;
263
		document.iform.dns_server4.disabled = 1;
264
	}
265
}
266
267
function wins_server_change() {
268
269
	if (document.iform.wins_server_enable.checked) {
270
		document.iform.wins_server1.disabled = 0;
271
		document.iform.wins_server2.disabled = 0;
272
	} else {
273
		document.iform.wins_server1.disabled = 1;
274
		document.iform.wins_server2.disabled = 1;
275 e2411886 Scott Ullrich
	}
276
}
277 3462a529 Matthew Grooms
278
function pfs_group_change() {
279
280
	if (document.iform.pfs_group_enable.checked)
281
		document.iform.pfs_group.disabled = 0;
282
	else
283
		document.iform.pfs_group.disabled = 1;
284
}
285
286
function login_banner_change() {
287
288
	if (document.iform.login_banner_enable.checked)
289
		document.iform.login_banner.disabled = 0;
290
	else
291
		document.iform.login_banner.disabled = 1;
292
}
293
294 e2411886 Scott Ullrich
//-->
295
</script>
296 3462a529 Matthew Grooms
297 5b237745 Scott Ullrich
<form action="vpn_ipsec_mobile.php" method="post" name="iform" id="iform">
298 5a3b0d3b mgrooms
299 323d040b Scott Ullrich
<?php
300 3462a529 Matthew Grooms
	if ($savemsg)
301
		print_info_box($savemsg);
302 a368a026 Ermal Lu?i
	if (isset($config['ipsec']['enable']) && is_subsystem_dirty('ipsec'))
303 bfbd2610 Carlos Eduardo Ramos
		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."));
304 3462a529 Matthew Grooms
	foreach ($a_phase1 as $ph1ent)
305
		if (isset($ph1ent['mobile']))
306
			$ph1found = true;
307
	if ($pconfig['enable'] && !$ph1found)
308 bfbd2610 Carlos Eduardo Ramos
		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"));
309 5a3b0d3b mgrooms
	if ($input_errors)
310
		print_input_errors($input_errors);
311 323d040b Scott Ullrich
?>
312 5a3b0d3b mgrooms
313 3462a529 Matthew Grooms
<table width="100%" border="0" cellpadding="0" cellspacing="0">
314
	<tr>
315
		<td class="tabnavtbl">
316
			<?php
317
				$tab_array = array();
318 bfbd2610 Carlos Eduardo Ramos
				$tab_array[0] = array(gettext("Tunnels"), false, "vpn_ipsec.php");
319
				$tab_array[1] = array(gettext("Mobile clients"), true, "vpn_ipsec_mobile.php");
320
				$tab_array[2] = array(gettext("Pre-shared keys"), false, "vpn_ipsec_keys.php");
321 3462a529 Matthew Grooms
				display_top_tabs($tab_array);
322
			?>
323
		</td>
324
	</tr>
325
	<tr> 
326 5a3b0d3b mgrooms
		<td id="mainarea">
327
			<div class="tabcont">
328
				<table width="100%" border="0" cellpadding="6" cellspacing="0">
329 3462a529 Matthew Grooms
					<tr>
330 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncellreq"><?=gettext("IKE Extensions"); ?></td>
331 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
332 667725ce Matthew Grooms
							<table border="0" cellspacing="2" cellpadding="0">
333
								<tr>
334
									<td>
335
										<?php set_checked($pconfig['enable'],$chk); ?>
336
										<input name="enable" type="checkbox" id="enable" value="yes" <?=$chk;?>>
337
									</td>
338
									<td>
339 bfbd2610 Carlos Eduardo Ramos
										<strong><?=gettext("Enable IPsec Mobile Client Support"); ?></strong>
340 667725ce Matthew Grooms
									</td>
341
								</tr>
342
							</table>
343 3462a529 Matthew Grooms
						</td>
344
					</tr>
345
					<tr>
346
						<td colspan="2" class="list" height="12"></td>
347
					</tr>
348
					<tr>
349
						<td colspan="2" valign="top" class="listtopic">
350 bfbd2610 Carlos Eduardo Ramos
							<?=gettext("Extended Authentication (Xauth)"); ?>
351 3462a529 Matthew Grooms
						</td>
352
					</tr>
353
					<tr>
354 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncellreq"><?=gettext("User Authentication"); ?></td>
355 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
356 bfbd2610 Carlos Eduardo Ramos
							<?=gettext("Source"); ?>:&nbsp;&nbsp;
357 3462a529 Matthew Grooms
							<select name="user_source" class="formselect" id="user_source">
358 bfbd2610 Carlos Eduardo Ramos
								<option value="system"><?=gettext("system"); ?></option>
359 3462a529 Matthew Grooms
							</select>
360
						</td>
361
					</tr>
362
					<tr>
363 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncellreq"><?=gettext("Group Authentication"); ?></td>
364 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
365 bfbd2610 Carlos Eduardo Ramos
							<?=gettext("Source"); ?>:&nbsp;&nbsp;
366 3462a529 Matthew Grooms
							<select name="group_source" class="formselect" id="group_source">
367 bfbd2610 Carlos Eduardo Ramos
								<option value="system"><?=gettext("system"); ?></option>
368 3462a529 Matthew Grooms
							</select>
369
						</td>
370
					</tr>
371
					<tr>
372
						<td colspan="2" class="list" height="12"></td>
373
					</tr>
374
					<tr> 
375
						<td colspan="2" valign="top" class="listtopic">
376 bfbd2610 Carlos Eduardo Ramos
							<?=gettext("Client Configuration (mode-cfg)"); ?>
377 3462a529 Matthew Grooms
						</td>
378
					</tr>
379
					<tr> 
380 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("Virtual Address Pool"); ?></td>
381 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
382
							<table border="0" cellspacing="2" cellpadding="0">
383
								<tr>
384
									<td>
385
										<?php set_checked($pconfig['pool_enable'],$chk); ?>
386
										<input name="pool_enable" type="checkbox" id="pool_enable" value="yes" <?=$chk;?> onClick="pool_change()">
387 667725ce Matthew Grooms
									</td>
388
									<td>
389 214bd062 jim-p
										<?=gettext("Provide a virtual IP address to clients"); ?><br>
390 3462a529 Matthew Grooms
									</td>
391
								</tr>
392 667725ce Matthew Grooms
							</table>
393
							<table border="0" cellspacing="2" cellpadding="0">
394 3462a529 Matthew Grooms
								<tr>
395
									<td>
396 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Network"); ?>:&nbsp;
397 dd5bf424 Scott Ullrich
										<input name="pool_address" type="text" class="formfld unknown" id="pool_address" size="20" value="<?=htmlspecialchars($pconfig['pool_address']);?>">
398 3462a529 Matthew Grooms
										/
399
										<select name="pool_netbits" class="formselect" id="pool_netbits">
400
											<?php for ($i = 32; $i >= 0; $i--): ?>
401
											<option value="<?=$i;?>" <?php if ($i == $pconfig['pool_netbits']) echo "selected"; ?>>
402
												<?=$i;?>
403
											</option>
404
											<?php endfor; ?>
405
										</select>
406
									</td>
407
								</tr>
408
							</table>
409
						</td>
410
					</tr>
411
					<tr>
412 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("Network List"); ?></td>
413 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
414 667725ce Matthew Grooms
							<table border="0" cellspacing="2" cellpadding="0">
415
								<tr>
416
									<td>
417
										<?php set_checked($pconfig['net_list_enable'],$chk); ?>
418
										<input name="net_list_enable" type="checkbox" id="net_list_enable" value="yes" <?=$chk;?>>
419
									</td>
420
									<td>
421 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Provide a list of accessible networks to clients"); ?><br>
422 667725ce Matthew Grooms
									</td>
423
								</tr>
424
							</table>
425 3462a529 Matthew Grooms
						</td>
426
					</tr>
427 4178a1dd jim-p
					<tr>
428
						<td width="22%" valign="top" class="vncell"><?=gettext("Save Xauth Password"); ?></td>
429
						<td width="78%" class="vtable">
430
							<table border="0" cellspacing="2" cellpadding="0">
431
								<tr>
432
									<td>
433
										<?php set_checked($pconfig['save_passwd_enable'],$chk); ?>
434
										<input name="save_passwd_enable" type="checkbox" id="save_passwd_enable" value="yes" <?=$chk;?>>
435
									</td>
436
									<td>
437
										<?=gettext("Allow clients to save Xauth passwords (Cisco VPN client only)."); ?><br>
438
										<?=gettext("NOTE: With iPhone clients, this does not work when deployed via the iPhone configuration utility, only by manual entry."); ?><br>
439
									</td>
440
								</tr>
441
							</table>
442
						</td>
443
					</tr>
444 3462a529 Matthew Grooms
					<tr> 
445 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("DNS Default Domain"); ?></td>
446 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
447
							<table border="0" cellspacing="2" cellpadding="0">
448
								<tr>
449
									<td>
450
										<?php set_checked($pconfig['dns_domain_enable'],$chk); ?>
451
										<input name="dns_domain_enable" type="checkbox" id="dns_domain_enable" value="yes" <?=$chk;?> onClick="dns_domain_change()">
452 667725ce Matthew Grooms
									</td>
453
									<td>
454 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Provide a default domain name to clients"); ?><br>
455 3462a529 Matthew Grooms
									</td>
456
								</tr>
457 667725ce Matthew Grooms
							</table>
458
							<table border="0" cellspacing="2" cellpadding="0">
459 3462a529 Matthew Grooms
								<tr>
460
									<td>
461
										<input name="dns_domain" type="text" class="formfld unknown" id="dns_domain" size="30" value="<?=htmlspecialchars($pconfig['dns_domain']);?>">
462
									</td>
463
								</tr>
464
							</table>
465
						</td>
466
					</tr>
467
					<tr> 
468 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("DNS Servers"); ?></td>
469 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
470
							<table border="0" cellspacing="2" cellpadding="0">
471
								<tr>
472
									<td>
473
										<?php set_checked($pconfig['dns_server_enable'],$chk); ?>
474
										<input name="dns_server_enable" type="checkbox" id="dns_server_enable" value="yes" <?=$chk;?> onClick="dns_server_change()">
475 667725ce Matthew Grooms
									</td>
476
									<td>
477 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Provide a DNS server list to clients"); ?><br>
478 3462a529 Matthew Grooms
									</td>
479
								</tr>
480 667725ce Matthew Grooms
							</table>
481
							<table border="0" cellspacing="2" cellpadding="0">
482 3462a529 Matthew Grooms
								<tr>
483
									<td>
484 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Server"); ?> #1:&nbsp;
485 dd5bf424 Scott Ullrich
										<input name="dns_server1" type="text" class="formfld unknown" id="dns_server1" size="20" value="<?=htmlspecialchars($pconfig['dns_server1']);?>">
486 3462a529 Matthew Grooms
									</td>
487
								</tr>
488
								<tr>
489
									<td>
490 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Server"); ?> #2:&nbsp;
491 dd5bf424 Scott Ullrich
										<input name="dns_server2" type="text" class="formfld unknown" id="dns_server2" size="20" value="<?=htmlspecialchars($pconfig['dns_server2']);?>">
492 3462a529 Matthew Grooms
									</td>
493
								</tr>
494
								<tr>
495
									<td>
496 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Server"); ?> #3:&nbsp;
497 dd5bf424 Scott Ullrich
										<input name="dns_server3" type="text" class="formfld unknown" id="dns_server3" size="20" value="<?=htmlspecialchars($pconfig['dns_server3']);?>">
498 3462a529 Matthew Grooms
									</td>
499
								</tr>
500
								<tr>
501
									<td>
502 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Server"); ?> #4:&nbsp;
503 dd5bf424 Scott Ullrich
										<input name="dns_server4" type="text" class="formfld unknown" id="dns_server4" size="20" value="<?=htmlspecialchars($pconfig['dns_server4']);?>">
504 3462a529 Matthew Grooms
									</td>
505
								</tr>
506
							</table>
507
						</td>
508
					</tr>
509
					<tr> 
510 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("WINS Servers"); ?></td>
511 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
512
							<table border="0" cellspacing="2" cellpadding="0">
513
								<tr>
514
									<td>
515
										<?php set_checked($pconfig['wins_server_enable'],$chk); ?>
516
										<input name="wins_server_enable" type="checkbox" id="wins_server_enable" value="yes" <?=$chk;?> onClick="wins_server_change()">
517 667725ce Matthew Grooms
									</td>
518
									<td>
519 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Provide a WINS server list to clients"); ?><br>
520 3462a529 Matthew Grooms
									</td>
521
								</tr>
522 667725ce Matthew Grooms
							</table>
523
							<table border="0" cellspacing="2" cellpadding="0">
524 3462a529 Matthew Grooms
								<tr>
525
									<td>
526 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Server"); ?> #1:&nbsp;
527 dd5bf424 Scott Ullrich
										<input name="wins_server1" type="text" class="formfld unknown" id="wins_server1" size="20" value="<?=htmlspecialchars($pconfig['wins_server1']);?>">
528 3462a529 Matthew Grooms
									</td>
529
								</tr>
530
								<tr>
531
									<td>
532 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Server"); ?> #2:&nbsp;
533 dd5bf424 Scott Ullrich
										<input name="wins_server2" type="text" class="formfld unknown" id="wins_server2" size="20" value="<?=htmlspecialchars($pconfig['wins_server2']);?>">
534 3462a529 Matthew Grooms
									</td>
535
								</tr>
536
							</table>
537
						</td>
538
					</tr>
539
					<tr>
540 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("Phase2 PFS Group"); ?></td>
541 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
542
							<table border="0" cellspacing="2" cellpadding="0">
543
								<tr>
544
									<td>
545
										<?php set_checked($pconfig['pfs_group_enable'],$chk); ?>
546
										<input name="pfs_group_enable" type="checkbox" id="pfs_group_enable" value="yes" <?=$chk;?> onClick="pfs_group_change()">
547 667725ce Matthew Grooms
									</td>
548
									<td>
549 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Provide the Phase2 PFS group to clients ( overrides all mobile phase2 settings )"); ?><br>
550 3462a529 Matthew Grooms
									</td>
551
								</tr>
552 667725ce Matthew Grooms
							</table>
553
							<table border="0" cellspacing="2" cellpadding="0">
554 3462a529 Matthew Grooms
								<tr>
555
									<td>
556 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Group"); ?>:&nbsp;&nbsp;
557 3462a529 Matthew Grooms
										<select name="pfs_group" class="formselect" id="pfs_group">
558
										<?php foreach ($p2_pfskeygroups as $keygroup => $keygroupname): ?>
559
											<option value="<?=$keygroup;?>" <?php if ($pconfig['pfs_group'] == $keygroup) echo "selected"; ?>>
560
												<?=htmlspecialchars($keygroupname);?>
561
											</option>
562
										<?php endforeach; ?>
563
										</select>
564
									</td>
565
								</tr>
566
							</table>
567
						</td>
568
					</tr>
569
					<tr> 
570 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("Login Banner"); ?></td>
571 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
572
							<table border="0" cellspacing="2" cellpadding="0">
573
								<tr>
574
									<td>
575
										<?php set_checked($pconfig['login_banner_enable'],$chk); ?>
576
										<input name="login_banner_enable" type="checkbox" id="login_banner_enable" value="yes" <?=$chk;?> onClick="login_banner_change()">
577 667725ce Matthew Grooms
									</td>
578
									<td>
579 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Provide a login banner to clients"); ?><br>
580 3462a529 Matthew Grooms
									</td>
581
								</tr>
582 667725ce Matthew Grooms
							</table>
583
							<table border="0" cellspacing="2" cellpadding="0">
584 3462a529 Matthew Grooms
								<tr>
585
									<td>
586
										<?php $banner = htmlspecialchars($pconfig['login_banner']); ?>
587 dd5bf424 Scott Ullrich
										<textarea name="login_banner" cols="65" rows="7" id="login_banner" class="formpre"><?=htmlspecialchars($banner);?></textarea>
588 3462a529 Matthew Grooms
									</td>
589
								</tr>
590
							</table>
591
						</td>
592
					</tr>
593
					<tr>
594
						<td width="22%" valign="top">&nbsp;</td>
595
						<td width="78%">
596 bfbd2610 Carlos Eduardo Ramos
							<input name="submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>">
597 3462a529 Matthew Grooms
						</td>
598
					</tr>
599
				</table>
600
			</div>
601
		</td>
602 0f10aee4 Bill Marquette
	</tr>
603
</table>
604 5b237745 Scott Ullrich
</form>
605 e2411886 Scott Ullrich
<script language="JavaScript">
606 3462a529 Matthew Grooms
pool_change();
607
dns_domain_change();
608
dns_server_change();
609
wins_server_change();
610
pfs_group_change();
611
login_banner_change();
612 e2411886 Scott Ullrich
//-->
613
</script>
614 5b237745 Scott Ullrich
<?php include("fend.inc"); ?>
615 323d040b Scott Ullrich
</body>
616
</html>
617 3462a529 Matthew Grooms
618
<?php
619
620
/* local utility functions */
621
622
function set_checked($var,& $chk) {
623
	if($var)
624 135dad58 Matthew Grooms
		$chk = 'checked';
625 3462a529 Matthew Grooms
	else
626
		$chk = '';
627
}
628
629
?>