Project

General

Profile

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