Project

General

Profile

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