Project

General

Profile

Download (23 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 d7402222 jim-p
	$pconfig['dns_split'] = $a_client['dns_split'];
65 3462a529 Matthew Grooms
	$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 4178a1dd jim-p
	if (isset($pconfig['save_passwd']))
86
		$pconfig['save_passwd_enable'] = true;
87
88 3462a529 Matthew Grooms
	if ($pconfig['dns_domain'])
89
		$pconfig['dns_domain_enable'] = true;
90
91 d7402222 jim-p
	if ($pconfig['dns_split'])
92
		$pconfig['dns_split_enable'] = true;
93
94 3462a529 Matthew Grooms
	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 5b237745 Scott Ullrich
}
106 3462a529 Matthew Grooms
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 a368a026 Ermal Lu?i
		if (is_subsystem_dirty('ipsec'))
117
			clear_subsystem_dirty('ipsec');
118 5b237745 Scott Ullrich
}
119
120 3462a529 Matthew Grooms
if ($_POST['submit']) {
121
122 5b237745 Scott Ullrich
	unset($input_errors);
123
	$pconfig = $_POST;
124
125 3462a529 Matthew Grooms
	/* input consolidation */
126
127 e2411886 Scott Ullrich
	
128 3462a529 Matthew Grooms
129
	/* input validation */
130
131
	$reqdfields = explode(" ", "user_source group_source");
132 bfbd2610 Carlos Eduardo Ramos
	$reqdfieldsn =  array(gettext("User Authentication Source"),gettext("Group Authentication Source"));
133 3462a529 Matthew Grooms
134
    do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
135
136
	if ($pconfig['pool_enable'])
137
		if (!is_ipaddr($pconfig['pool_address']))
138 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid IP address for 'Virtual Address Pool Network' must be specified.");
139 3462a529 Matthew Grooms
140
	if ($pconfig['dns_domain_enable'])
141
		if (!is_domain($pconfig['dns_domain']))
142 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid value for 'DNS Default Domain' must be specified.");
143 3462a529 Matthew Grooms
144 d7402222 jim-p
	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 3462a529 Matthew Grooms
	if ($pconfig['dns_server_enable']) {
157
		if (!$pconfig['dns_server1'] && !$pconfig['dns_server2'] &&
158
			!$pconfig['dns_server3'] && !$pconfig['dns_server4'] )
159 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("At least one DNS server must be specified to enable the DNS Server option.");
160 3462a529 Matthew Grooms
		if ($pconfig['dns_server1'] && !is_ipaddr($pconfig['dns_server1']))
161 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid IP address for 'DNS Server #1' must be specified.");
162 3462a529 Matthew Grooms
		if ($pconfig['dns_server2'] && !is_ipaddr($pconfig['dns_server2']))
163 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid IP address for 'DNS Server #2' must be specified.");
164 3462a529 Matthew Grooms
		if ($pconfig['dns_server3'] && !is_ipaddr($pconfig['dns_server3']))
165 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid IP address for 'DNS Server #3' must be specified.");
166 3462a529 Matthew Grooms
		if ($pconfig['dns_server4'] && !is_ipaddr($pconfig['dns_server4']))
167 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid IP address for 'DNS Server #4' must be specified.");
168 5b237745 Scott Ullrich
	}
169 3462a529 Matthew Grooms
170
	if ($pconfig['wins_server_enable']) {
171
		if (!$pconfig['wins_server1'] && !$pconfig['wins_server2'])
172 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("At least one WINS server must be specified to enable the DNS Server option.");
173 3462a529 Matthew Grooms
		if ($pconfig['wins_server1'] && !is_ipaddr($pconfig['wins_server1']))
174 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid IP address for 'WINS Server #1' must be specified.");
175 3462a529 Matthew Grooms
		if ($pconfig['wins_server2'] && !is_ipaddr($pconfig['wins_server2']))
176 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid IP address for 'WINS Server #2' must be specified.");
177 5b237745 Scott Ullrich
	}
178 3462a529 Matthew Grooms
179
	if ($pconfig['login_banner_enable'])
180
		if (!strlen($pconfig['login_banner']))
181 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid value for 'Login Banner' must be specified.");
182 5b237745 Scott Ullrich
183
	if (!$input_errors) {
184 3462a529 Matthew Grooms
		$client = array();
185 5b237745 Scott Ullrich
		
186 3462a529 Matthew Grooms
		if ($pconfig['enable'])
187
			$client['enable'] = true;
188
189 52c9f9fa Ermal
		if (!empty($pconfig['user_source']))
190
			$client['user_source'] = implode(",", $pconfig['user_source']);
191 3462a529 Matthew Grooms
		$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 5b237745 Scott Ullrich
		}
197 3462a529 Matthew Grooms
198
		if ($pconfig['net_list_enable'])
199
			$client['net_list'] = true;
200
201 4178a1dd jim-p
		if ($pconfig['save_passwd_enable'])
202
			$client['save_passwd'] = true;
203
204 3462a529 Matthew Grooms
		if ($pconfig['dns_domain_enable'])
205
			$client['dns_domain'] = $pconfig['dns_domain'];
206
207 d7402222 jim-p
		if ($pconfig['dns_split_enable'])
208
			$client['dns_split'] = $pconfig['dns_split'];
209
210 3462a529 Matthew Grooms
		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 5b237745 Scott Ullrich
		
232
		write_config();
233 a368a026 Ermal Lu?i
		mark_subsystem_dirty('ipsec');
234 5b237745 Scott Ullrich
		
235
		header("Location: vpn_ipsec_mobile.php");
236
		exit;
237
	}
238
}
239 422f27c0 Scott Ullrich
240 bfbd2610 Carlos Eduardo Ramos
$pgtitle = array(gettext("VPN"),gettext("IPsec"),gettext("Mobile"));
241 b32dd0a6 jim-p
$shortcut_section = "ipsec";
242 6deedfde jim-p
243 4df96eff Scott Ullrich
include("head.inc");
244
?>
245 3462a529 Matthew Grooms
246 422f27c0 Scott Ullrich
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
247 5b237745 Scott Ullrich
<?php include("fbegin.inc"); ?>
248 3462a529 Matthew Grooms
249 e2411886 Scott Ullrich
<script language="JavaScript">
250
<!--
251 3462a529 Matthew Grooms
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 d7402222 jim-p
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 3462a529 Matthew Grooms
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 e2411886 Scott Ullrich
	}
303
}
304 3462a529 Matthew Grooms
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 e2411886 Scott Ullrich
//-->
322
</script>
323 3462a529 Matthew Grooms
324 5b237745 Scott Ullrich
<form action="vpn_ipsec_mobile.php" method="post" name="iform" id="iform">
325 5a3b0d3b mgrooms
326 323d040b Scott Ullrich
<?php
327 3462a529 Matthew Grooms
	if ($savemsg)
328
		print_info_box($savemsg);
329 a368a026 Ermal Lu?i
	if (isset($config['ipsec']['enable']) && is_subsystem_dirty('ipsec'))
330 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."));
331 3462a529 Matthew Grooms
	foreach ($a_phase1 as $ph1ent)
332
		if (isset($ph1ent['mobile']))
333
			$ph1found = true;
334
	if ($pconfig['enable'] && !$ph1found)
335 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"));
336 5a3b0d3b mgrooms
	if ($input_errors)
337
		print_input_errors($input_errors);
338 323d040b Scott Ullrich
?>
339 5a3b0d3b mgrooms
340 3462a529 Matthew Grooms
<table width="100%" border="0" cellpadding="0" cellspacing="0">
341
	<tr>
342
		<td class="tabnavtbl">
343
			<?php
344
				$tab_array = array();
345 bfbd2610 Carlos Eduardo Ramos
				$tab_array[0] = array(gettext("Tunnels"), false, "vpn_ipsec.php");
346
				$tab_array[1] = array(gettext("Mobile clients"), true, "vpn_ipsec_mobile.php");
347 2a2b247b jim-p
				$tab_array[2] = array(gettext("Pre-Shared Key"), false, "vpn_ipsec_keys.php");
348 3462a529 Matthew Grooms
				display_top_tabs($tab_array);
349
			?>
350
		</td>
351
	</tr>
352
	<tr> 
353 5a3b0d3b mgrooms
		<td id="mainarea">
354
			<div class="tabcont">
355
				<table width="100%" border="0" cellpadding="6" cellspacing="0">
356 3462a529 Matthew Grooms
					<tr>
357 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncellreq"><?=gettext("IKE Extensions"); ?></td>
358 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
359 667725ce Matthew Grooms
							<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 bfbd2610 Carlos Eduardo Ramos
										<strong><?=gettext("Enable IPsec Mobile Client Support"); ?></strong>
367 667725ce Matthew Grooms
									</td>
368
								</tr>
369
							</table>
370 3462a529 Matthew Grooms
						</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 bfbd2610 Carlos Eduardo Ramos
							<?=gettext("Extended Authentication (Xauth)"); ?>
378 3462a529 Matthew Grooms
						</td>
379
					</tr>
380
					<tr>
381 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncellreq"><?=gettext("User Authentication"); ?></td>
382 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
383 bfbd2610 Carlos Eduardo Ramos
							<?=gettext("Source"); ?>:&nbsp;&nbsp;
384 52c9f9fa Ermal
							<select name="user_source[]" class="formselect" id="user_source"  multiple="true" 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";
392
									echo "<option value='{$auth_server['name']}' {$selected}>{$auth_server['name']}</option>\n";
393
								}
394
							?>
395 3462a529 Matthew Grooms
							</select>
396
						</td>
397
					</tr>
398
					<tr>
399 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncellreq"><?=gettext("Group Authentication"); ?></td>
400 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
401 bfbd2610 Carlos Eduardo Ramos
							<?=gettext("Source"); ?>:&nbsp;&nbsp;
402 3462a529 Matthew Grooms
							<select name="group_source" class="formselect" id="group_source">
403 bfd4a79e Ermal
								<option value="none"><?=gettext("none"); ?></option>
404
								<option value="system" <?php if ($pconfig['group_source'] == "system") echo "selected"; ?> ><?=gettext("system"); ?></option>
405 3462a529 Matthew Grooms
							</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 bfbd2610 Carlos Eduardo Ramos
							<?=gettext("Client Configuration (mode-cfg)"); ?>
414 3462a529 Matthew Grooms
						</td>
415
					</tr>
416
					<tr> 
417 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("Virtual Address Pool"); ?></td>
418 3462a529 Matthew Grooms
						<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 667725ce Matthew Grooms
									</td>
425
									<td>
426 214bd062 jim-p
										<?=gettext("Provide a virtual IP address to clients"); ?><br>
427 3462a529 Matthew Grooms
									</td>
428
								</tr>
429 667725ce Matthew Grooms
							</table>
430
							<table border="0" cellspacing="2" cellpadding="0">
431 3462a529 Matthew Grooms
								<tr>
432
									<td>
433 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Network"); ?>:&nbsp;
434 dd5bf424 Scott Ullrich
										<input name="pool_address" type="text" class="formfld unknown" id="pool_address" size="20" value="<?=htmlspecialchars($pconfig['pool_address']);?>">
435 3462a529 Matthew Grooms
										/
436
										<select name="pool_netbits" class="formselect" id="pool_netbits">
437
											<?php for ($i = 32; $i >= 0; $i--): ?>
438
											<option value="<?=$i;?>" <?php if ($i == $pconfig['pool_netbits']) echo "selected"; ?>>
439
												<?=$i;?>
440
											</option>
441
											<?php endfor; ?>
442
										</select>
443
									</td>
444
								</tr>
445
							</table>
446
						</td>
447
					</tr>
448
					<tr>
449 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("Network List"); ?></td>
450 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
451 667725ce Matthew Grooms
							<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 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Provide a list of accessible networks to clients"); ?><br>
459 667725ce Matthew Grooms
									</td>
460
								</tr>
461
							</table>
462 3462a529 Matthew Grooms
						</td>
463
					</tr>
464 4178a1dd jim-p
					<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 3462a529 Matthew Grooms
					<tr> 
482 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("DNS Default Domain"); ?></td>
483 3462a529 Matthew Grooms
						<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 667725ce Matthew Grooms
									</td>
490
									<td>
491 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Provide a default domain name to clients"); ?><br>
492 3462a529 Matthew Grooms
									</td>
493
								</tr>
494 667725ce Matthew Grooms
							</table>
495
							<table border="0" cellspacing="2" cellpadding="0">
496 3462a529 Matthew Grooms
								<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 d7402222 jim-p
					<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 3462a529 Matthew Grooms
					<tr> 
529 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("DNS Servers"); ?></td>
530 3462a529 Matthew Grooms
						<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 667725ce Matthew Grooms
									</td>
537
									<td>
538 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Provide a DNS server list to clients"); ?><br>
539 3462a529 Matthew Grooms
									</td>
540
								</tr>
541 667725ce Matthew Grooms
							</table>
542
							<table border="0" cellspacing="2" cellpadding="0">
543 3462a529 Matthew Grooms
								<tr>
544
									<td>
545 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Server"); ?> #1:&nbsp;
546 dd5bf424 Scott Ullrich
										<input name="dns_server1" type="text" class="formfld unknown" id="dns_server1" size="20" value="<?=htmlspecialchars($pconfig['dns_server1']);?>">
547 3462a529 Matthew Grooms
									</td>
548
								</tr>
549
								<tr>
550
									<td>
551 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Server"); ?> #2:&nbsp;
552 dd5bf424 Scott Ullrich
										<input name="dns_server2" type="text" class="formfld unknown" id="dns_server2" size="20" value="<?=htmlspecialchars($pconfig['dns_server2']);?>">
553 3462a529 Matthew Grooms
									</td>
554
								</tr>
555
								<tr>
556
									<td>
557 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Server"); ?> #3:&nbsp;
558 dd5bf424 Scott Ullrich
										<input name="dns_server3" type="text" class="formfld unknown" id="dns_server3" size="20" value="<?=htmlspecialchars($pconfig['dns_server3']);?>">
559 3462a529 Matthew Grooms
									</td>
560
								</tr>
561
								<tr>
562
									<td>
563 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Server"); ?> #4:&nbsp;
564 dd5bf424 Scott Ullrich
										<input name="dns_server4" type="text" class="formfld unknown" id="dns_server4" size="20" value="<?=htmlspecialchars($pconfig['dns_server4']);?>">
565 3462a529 Matthew Grooms
									</td>
566
								</tr>
567
							</table>
568
						</td>
569
					</tr>
570
					<tr> 
571 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("WINS Servers"); ?></td>
572 3462a529 Matthew Grooms
						<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 667725ce Matthew Grooms
									</td>
579
									<td>
580 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Provide a WINS server list to clients"); ?><br>
581 3462a529 Matthew Grooms
									</td>
582
								</tr>
583 667725ce Matthew Grooms
							</table>
584
							<table border="0" cellspacing="2" cellpadding="0">
585 3462a529 Matthew Grooms
								<tr>
586
									<td>
587 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Server"); ?> #1:&nbsp;
588 dd5bf424 Scott Ullrich
										<input name="wins_server1" type="text" class="formfld unknown" id="wins_server1" size="20" value="<?=htmlspecialchars($pconfig['wins_server1']);?>">
589 3462a529 Matthew Grooms
									</td>
590
								</tr>
591
								<tr>
592
									<td>
593 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Server"); ?> #2:&nbsp;
594 dd5bf424 Scott Ullrich
										<input name="wins_server2" type="text" class="formfld unknown" id="wins_server2" size="20" value="<?=htmlspecialchars($pconfig['wins_server2']);?>">
595 3462a529 Matthew Grooms
									</td>
596
								</tr>
597
							</table>
598
						</td>
599
					</tr>
600
					<tr>
601 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("Phase2 PFS Group"); ?></td>
602 3462a529 Matthew Grooms
						<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 667725ce Matthew Grooms
									</td>
609
									<td>
610 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Provide the Phase2 PFS group to clients ( overrides all mobile phase2 settings )"); ?><br>
611 3462a529 Matthew Grooms
									</td>
612
								</tr>
613 667725ce Matthew Grooms
							</table>
614
							<table border="0" cellspacing="2" cellpadding="0">
615 3462a529 Matthew Grooms
								<tr>
616
									<td>
617 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Group"); ?>:&nbsp;&nbsp;
618 3462a529 Matthew Grooms
										<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"; ?>>
621
												<?=htmlspecialchars($keygroupname);?>
622
											</option>
623
										<?php endforeach; ?>
624
										</select>
625
									</td>
626
								</tr>
627
							</table>
628
						</td>
629
					</tr>
630
					<tr> 
631 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("Login Banner"); ?></td>
632 3462a529 Matthew Grooms
						<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 667725ce Matthew Grooms
									</td>
639
									<td>
640 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Provide a login banner to clients"); ?><br>
641 3462a529 Matthew Grooms
									</td>
642
								</tr>
643 667725ce Matthew Grooms
							</table>
644
							<table border="0" cellspacing="2" cellpadding="0">
645 3462a529 Matthew Grooms
								<tr>
646
									<td>
647
										<?php $banner = htmlspecialchars($pconfig['login_banner']); ?>
648 dd5bf424 Scott Ullrich
										<textarea name="login_banner" cols="65" rows="7" id="login_banner" class="formpre"><?=htmlspecialchars($banner);?></textarea>
649 3462a529 Matthew Grooms
									</td>
650
								</tr>
651
							</table>
652
						</td>
653
					</tr>
654
					<tr>
655
						<td width="22%" valign="top">&nbsp;</td>
656
						<td width="78%">
657 bfbd2610 Carlos Eduardo Ramos
							<input name="submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>">
658 3462a529 Matthew Grooms
						</td>
659
					</tr>
660
				</table>
661
			</div>
662
		</td>
663 0f10aee4 Bill Marquette
	</tr>
664
</table>
665 5b237745 Scott Ullrich
</form>
666 e2411886 Scott Ullrich
<script language="JavaScript">
667 3462a529 Matthew Grooms
pool_change();
668
dns_domain_change();
669 d7402222 jim-p
dns_split_change();
670 3462a529 Matthew Grooms
dns_server_change();
671
wins_server_change();
672
pfs_group_change();
673
login_banner_change();
674 e2411886 Scott Ullrich
//-->
675
</script>
676 5b237745 Scott Ullrich
<?php include("fend.inc"); ?>
677 323d040b Scott Ullrich
</body>
678
</html>
679 3462a529 Matthew Grooms
680
<?php
681
682
/* local utility functions */
683
684
function set_checked($var,& $chk) {
685
	if($var)
686 135dad58 Matthew Grooms
		$chk = 'checked';
687 3462a529 Matthew Grooms
	else
688
		$chk = '';
689
}
690
691
?>