Project

General

Profile

Download (21.3 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 2c189c8c Bryan Haase
								<option value="system" <?php if ($pconfig['user_source'] == 'system') echo "selected"; ?>><?=gettext("system"); ?></option>
359 96267107 Ermal
								<?php
360
									if (is_array($config['system']['authserver'])) {
361 f9199cd3 Bryan Haase
										foreach ($config['system']['authserver'] as $authcfg) {
362
											if ($authcfg['type'] == 'ldap') {
363
												$selected = "";
364 96267107 Ermal
												if ($pconfig['user_source'] == $authcfg['name'])
365
													$selected = "selected";
366
												echo "<option value='{$authcfg['name']}' {$selected} >{$authcfg['name']}</option>\n";
367 f9199cd3 Bryan Haase
											}
368
										}
369
									}
370 96267107 Ermal
								?>
371 3462a529 Matthew Grooms
							</select>
372
						</td>
373
					</tr>
374
					<tr>
375 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncellreq"><?=gettext("Group Authentication"); ?></td>
376 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
377 bfbd2610 Carlos Eduardo Ramos
							<?=gettext("Source"); ?>:&nbsp;&nbsp;
378 3462a529 Matthew Grooms
							<select name="group_source" class="formselect" id="group_source">
379 bfbd2610 Carlos Eduardo Ramos
								<option value="system"><?=gettext("system"); ?></option>
380 3462a529 Matthew Grooms
							</select>
381
						</td>
382
					</tr>
383
					<tr>
384
						<td colspan="2" class="list" height="12"></td>
385
					</tr>
386
					<tr> 
387
						<td colspan="2" valign="top" class="listtopic">
388 bfbd2610 Carlos Eduardo Ramos
							<?=gettext("Client Configuration (mode-cfg)"); ?>
389 3462a529 Matthew Grooms
						</td>
390
					</tr>
391
					<tr> 
392 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("Virtual Address Pool"); ?></td>
393 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
394
							<table border="0" cellspacing="2" cellpadding="0">
395
								<tr>
396
									<td>
397
										<?php set_checked($pconfig['pool_enable'],$chk); ?>
398
										<input name="pool_enable" type="checkbox" id="pool_enable" value="yes" <?=$chk;?> onClick="pool_change()">
399 667725ce Matthew Grooms
									</td>
400
									<td>
401 214bd062 jim-p
										<?=gettext("Provide a virtual IP address to clients"); ?><br>
402 3462a529 Matthew Grooms
									</td>
403
								</tr>
404 667725ce Matthew Grooms
							</table>
405
							<table border="0" cellspacing="2" cellpadding="0">
406 3462a529 Matthew Grooms
								<tr>
407
									<td>
408 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Network"); ?>:&nbsp;
409 dd5bf424 Scott Ullrich
										<input name="pool_address" type="text" class="formfld unknown" id="pool_address" size="20" value="<?=htmlspecialchars($pconfig['pool_address']);?>">
410 3462a529 Matthew Grooms
										/
411
										<select name="pool_netbits" class="formselect" id="pool_netbits">
412
											<?php for ($i = 32; $i >= 0; $i--): ?>
413
											<option value="<?=$i;?>" <?php if ($i == $pconfig['pool_netbits']) echo "selected"; ?>>
414
												<?=$i;?>
415
											</option>
416
											<?php endfor; ?>
417
										</select>
418
									</td>
419
								</tr>
420
							</table>
421
						</td>
422
					</tr>
423
					<tr>
424 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("Network List"); ?></td>
425 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
426 667725ce Matthew Grooms
							<table border="0" cellspacing="2" cellpadding="0">
427
								<tr>
428
									<td>
429
										<?php set_checked($pconfig['net_list_enable'],$chk); ?>
430
										<input name="net_list_enable" type="checkbox" id="net_list_enable" value="yes" <?=$chk;?>>
431
									</td>
432
									<td>
433 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Provide a list of accessible networks to clients"); ?><br>
434 667725ce Matthew Grooms
									</td>
435
								</tr>
436
							</table>
437 3462a529 Matthew Grooms
						</td>
438
					</tr>
439 4178a1dd jim-p
					<tr>
440
						<td width="22%" valign="top" class="vncell"><?=gettext("Save Xauth Password"); ?></td>
441
						<td width="78%" class="vtable">
442
							<table border="0" cellspacing="2" cellpadding="0">
443
								<tr>
444
									<td>
445
										<?php set_checked($pconfig['save_passwd_enable'],$chk); ?>
446
										<input name="save_passwd_enable" type="checkbox" id="save_passwd_enable" value="yes" <?=$chk;?>>
447
									</td>
448
									<td>
449
										<?=gettext("Allow clients to save Xauth passwords (Cisco VPN client only)."); ?><br>
450
										<?=gettext("NOTE: With iPhone clients, this does not work when deployed via the iPhone configuration utility, only by manual entry."); ?><br>
451
									</td>
452
								</tr>
453
							</table>
454
						</td>
455
					</tr>
456 3462a529 Matthew Grooms
					<tr> 
457 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("DNS Default Domain"); ?></td>
458 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
459
							<table border="0" cellspacing="2" cellpadding="0">
460
								<tr>
461
									<td>
462
										<?php set_checked($pconfig['dns_domain_enable'],$chk); ?>
463
										<input name="dns_domain_enable" type="checkbox" id="dns_domain_enable" value="yes" <?=$chk;?> onClick="dns_domain_change()">
464 667725ce Matthew Grooms
									</td>
465
									<td>
466 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Provide a default domain name to clients"); ?><br>
467 3462a529 Matthew Grooms
									</td>
468
								</tr>
469 667725ce Matthew Grooms
							</table>
470
							<table border="0" cellspacing="2" cellpadding="0">
471 3462a529 Matthew Grooms
								<tr>
472
									<td>
473
										<input name="dns_domain" type="text" class="formfld unknown" id="dns_domain" size="30" value="<?=htmlspecialchars($pconfig['dns_domain']);?>">
474
									</td>
475
								</tr>
476
							</table>
477
						</td>
478
					</tr>
479
					<tr> 
480 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("DNS Servers"); ?></td>
481 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
482
							<table border="0" cellspacing="2" cellpadding="0">
483
								<tr>
484
									<td>
485
										<?php set_checked($pconfig['dns_server_enable'],$chk); ?>
486
										<input name="dns_server_enable" type="checkbox" id="dns_server_enable" value="yes" <?=$chk;?> onClick="dns_server_change()">
487 667725ce Matthew Grooms
									</td>
488
									<td>
489 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Provide a DNS server list to clients"); ?><br>
490 3462a529 Matthew Grooms
									</td>
491
								</tr>
492 667725ce Matthew Grooms
							</table>
493
							<table border="0" cellspacing="2" cellpadding="0">
494 3462a529 Matthew Grooms
								<tr>
495
									<td>
496 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Server"); ?> #1:&nbsp;
497 dd5bf424 Scott Ullrich
										<input name="dns_server1" type="text" class="formfld unknown" id="dns_server1" size="20" value="<?=htmlspecialchars($pconfig['dns_server1']);?>">
498 3462a529 Matthew Grooms
									</td>
499
								</tr>
500
								<tr>
501
									<td>
502 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Server"); ?> #2:&nbsp;
503 dd5bf424 Scott Ullrich
										<input name="dns_server2" type="text" class="formfld unknown" id="dns_server2" size="20" value="<?=htmlspecialchars($pconfig['dns_server2']);?>">
504 3462a529 Matthew Grooms
									</td>
505
								</tr>
506
								<tr>
507
									<td>
508 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Server"); ?> #3:&nbsp;
509 dd5bf424 Scott Ullrich
										<input name="dns_server3" type="text" class="formfld unknown" id="dns_server3" size="20" value="<?=htmlspecialchars($pconfig['dns_server3']);?>">
510 3462a529 Matthew Grooms
									</td>
511
								</tr>
512
								<tr>
513
									<td>
514 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Server"); ?> #4:&nbsp;
515 dd5bf424 Scott Ullrich
										<input name="dns_server4" type="text" class="formfld unknown" id="dns_server4" size="20" value="<?=htmlspecialchars($pconfig['dns_server4']);?>">
516 3462a529 Matthew Grooms
									</td>
517
								</tr>
518
							</table>
519
						</td>
520
					</tr>
521
					<tr> 
522 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("WINS Servers"); ?></td>
523 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
524
							<table border="0" cellspacing="2" cellpadding="0">
525
								<tr>
526
									<td>
527
										<?php set_checked($pconfig['wins_server_enable'],$chk); ?>
528
										<input name="wins_server_enable" type="checkbox" id="wins_server_enable" value="yes" <?=$chk;?> onClick="wins_server_change()">
529 667725ce Matthew Grooms
									</td>
530
									<td>
531 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Provide a WINS server list to clients"); ?><br>
532 3462a529 Matthew Grooms
									</td>
533
								</tr>
534 667725ce Matthew Grooms
							</table>
535
							<table border="0" cellspacing="2" cellpadding="0">
536 3462a529 Matthew Grooms
								<tr>
537
									<td>
538 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Server"); ?> #1:&nbsp;
539 dd5bf424 Scott Ullrich
										<input name="wins_server1" type="text" class="formfld unknown" id="wins_server1" size="20" value="<?=htmlspecialchars($pconfig['wins_server1']);?>">
540 3462a529 Matthew Grooms
									</td>
541
								</tr>
542
								<tr>
543
									<td>
544 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Server"); ?> #2:&nbsp;
545 dd5bf424 Scott Ullrich
										<input name="wins_server2" type="text" class="formfld unknown" id="wins_server2" size="20" value="<?=htmlspecialchars($pconfig['wins_server2']);?>">
546 3462a529 Matthew Grooms
									</td>
547
								</tr>
548
							</table>
549
						</td>
550
					</tr>
551
					<tr>
552 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("Phase2 PFS Group"); ?></td>
553 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
554
							<table border="0" cellspacing="2" cellpadding="0">
555
								<tr>
556
									<td>
557
										<?php set_checked($pconfig['pfs_group_enable'],$chk); ?>
558
										<input name="pfs_group_enable" type="checkbox" id="pfs_group_enable" value="yes" <?=$chk;?> onClick="pfs_group_change()">
559 667725ce Matthew Grooms
									</td>
560
									<td>
561 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Provide the Phase2 PFS group to clients ( overrides all mobile phase2 settings )"); ?><br>
562 3462a529 Matthew Grooms
									</td>
563
								</tr>
564 667725ce Matthew Grooms
							</table>
565
							<table border="0" cellspacing="2" cellpadding="0">
566 3462a529 Matthew Grooms
								<tr>
567
									<td>
568 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Group"); ?>:&nbsp;&nbsp;
569 3462a529 Matthew Grooms
										<select name="pfs_group" class="formselect" id="pfs_group">
570
										<?php foreach ($p2_pfskeygroups as $keygroup => $keygroupname): ?>
571
											<option value="<?=$keygroup;?>" <?php if ($pconfig['pfs_group'] == $keygroup) echo "selected"; ?>>
572
												<?=htmlspecialchars($keygroupname);?>
573
											</option>
574
										<?php endforeach; ?>
575
										</select>
576
									</td>
577
								</tr>
578
							</table>
579
						</td>
580
					</tr>
581
					<tr> 
582 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("Login Banner"); ?></td>
583 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
584
							<table border="0" cellspacing="2" cellpadding="0">
585
								<tr>
586
									<td>
587
										<?php set_checked($pconfig['login_banner_enable'],$chk); ?>
588
										<input name="login_banner_enable" type="checkbox" id="login_banner_enable" value="yes" <?=$chk;?> onClick="login_banner_change()">
589 667725ce Matthew Grooms
									</td>
590
									<td>
591 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Provide a login banner to clients"); ?><br>
592 3462a529 Matthew Grooms
									</td>
593
								</tr>
594 667725ce Matthew Grooms
							</table>
595
							<table border="0" cellspacing="2" cellpadding="0">
596 3462a529 Matthew Grooms
								<tr>
597
									<td>
598
										<?php $banner = htmlspecialchars($pconfig['login_banner']); ?>
599 dd5bf424 Scott Ullrich
										<textarea name="login_banner" cols="65" rows="7" id="login_banner" class="formpre"><?=htmlspecialchars($banner);?></textarea>
600 3462a529 Matthew Grooms
									</td>
601
								</tr>
602
							</table>
603
						</td>
604
					</tr>
605
					<tr>
606
						<td width="22%" valign="top">&nbsp;</td>
607
						<td width="78%">
608 bfbd2610 Carlos Eduardo Ramos
							<input name="submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>">
609 3462a529 Matthew Grooms
						</td>
610
					</tr>
611
				</table>
612
			</div>
613
		</td>
614 0f10aee4 Bill Marquette
	</tr>
615
</table>
616 5b237745 Scott Ullrich
</form>
617 e2411886 Scott Ullrich
<script language="JavaScript">
618 3462a529 Matthew Grooms
pool_change();
619
dns_domain_change();
620
dns_server_change();
621
wins_server_change();
622
pfs_group_change();
623
login_banner_change();
624 e2411886 Scott Ullrich
//-->
625
</script>
626 5b237745 Scott Ullrich
<?php include("fend.inc"); ?>
627 323d040b Scott Ullrich
</body>
628
</html>
629 3462a529 Matthew Grooms
630
<?php
631
632
/* local utility functions */
633
634
function set_checked($var,& $chk) {
635
	if($var)
636 135dad58 Matthew Grooms
		$chk = 'checked';
637 3462a529 Matthew Grooms
	else
638
		$chk = '';
639
}
640
641
?>