Project

General

Profile

Download (23.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 29aef6c4 Jim Thompson
        Copyright (C) 2013-2014 Electric Sheep Fencing, LP
7 5b237745 Scott Ullrich
	All rights reserved.
8
	
9
	Redistribution and use in source and binary forms, with or without
10
	modification, are permitted provided that the following conditions are met:
11
	
12
	1. Redistributions of source code must retain the above copyright notice,
13
	   this list of conditions and the following disclaimer.
14
	
15
	2. Redistributions in binary form must reproduce the above copyright
16
	   notice, this list of conditions and the following disclaimer in the
17
	   documentation and/or other materials provided with the distribution.
18
	
19
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
20
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
23
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28
	POSSIBILITY OF SUCH DAMAGE.
29
*/
30
31 6b07c15a Matthew Grooms
##|+PRIV
32
##|*IDENT=page-vpn-ipsec-mobile
33
##|*NAME=VPN: IPsec: Mobile page
34
##|*DESCR=Allow access to the 'VPN: IPsec: Mobile' page.
35
##|*MATCH=vpn_ipsec_mobile.php*
36
##|-PRIV
37
38 0f84b741 Scott Ullrich
require("functions.inc");
39 5b237745 Scott Ullrich
require("guiconfig.inc");
40 483e6de8 Scott Ullrich
require_once("ipsec.inc");
41
require_once("vpn.inc");
42 5b237745 Scott Ullrich
43 3462a529 Matthew Grooms
if (!is_array($config['ipsec']['phase1']))
44
	$config['ipsec']['phase1'] = array();
45
46
$a_phase1 = &$config['ipsec']['phase1'];
47
48
if (!is_array($config['ipsec']['client']))
49
	$config['ipsec']['client'] = array();
50
51
$a_client = &$config['ipsec']['client'];
52
53
if (count($a_client)) {
54
55
	$pconfig['enable'] = $a_client['enable'];
56
57
	$pconfig['user_source'] = $a_client['user_source'];
58
	$pconfig['group_source'] = $a_client['group_source'];
59
60
	$pconfig['pool_address'] = $a_client['pool_address'];
61
	$pconfig['pool_netbits'] = $a_client['pool_netbits'];
62
	$pconfig['net_list'] = $a_client['net_list'];
63 4178a1dd jim-p
	$pconfig['save_passwd'] = $a_client['save_passwd'];
64 3462a529 Matthew Grooms
	$pconfig['dns_domain'] = $a_client['dns_domain'];
65 d7402222 jim-p
	$pconfig['dns_split'] = $a_client['dns_split'];
66 3462a529 Matthew Grooms
	$pconfig['dns_server1'] = $a_client['dns_server1'];
67
	$pconfig['dns_server2'] = $a_client['dns_server2'];
68
	$pconfig['dns_server3'] = $a_client['dns_server3'];
69
	$pconfig['dns_server4'] = $a_client['dns_server4'];
70
	$pconfig['wins_server1'] = $a_client['wins_server1'];
71
	$pconfig['wins_server2'] = $a_client['wins_server2'];
72
	$pconfig['pfs_group'] = $a_client['pfs_group'];
73
	$pconfig['login_banner'] = $a_client['login_banner'];
74
75
	if (isset($pconfig['enable']))
76
		$pconfig['enable'] = true;
77
78
	if ($pconfig['pool_address']&&$pconfig['pool_netbits'])
79
		$pconfig['pool_enable'] = true;
80
	else
81
		$pconfig['pool_netbits'] = 24;
82
83
	if (isset($pconfig['net_list']))
84
		$pconfig['net_list_enable'] = true;
85
86 4178a1dd jim-p
	if (isset($pconfig['save_passwd']))
87
		$pconfig['save_passwd_enable'] = true;
88
89 3462a529 Matthew Grooms
	if ($pconfig['dns_domain'])
90
		$pconfig['dns_domain_enable'] = true;
91
92 d7402222 jim-p
	if ($pconfig['dns_split'])
93
		$pconfig['dns_split_enable'] = true;
94
95 3462a529 Matthew Grooms
	if ($pconfig['dns_server1']||$pconfig['dns_server2']||$pconfig['dns_server3']||$pconfig['dns_server4'])
96
		$pconfig['dns_server_enable'] = true;
97
98
	if ($pconfig['wins_server1']||$pconfig['wins_server2'])
99
		$pconfig['wins_server_enable'] = true;
100
101
	if (isset($pconfig['pfs_group']))
102
		$pconfig['pfs_group_enable'] = true;
103
104
	if ($pconfig['login_banner'])
105
		$pconfig['login_banner_enable'] = true;
106 5b237745 Scott Ullrich
}
107 3462a529 Matthew Grooms
108
if ($_POST['create']) {
109
	header("Location: vpn_ipsec_phase1.php?mobile=true");
110
}
111
112
if ($_POST['apply']) {
113
	$retval = 0;
114
	$retval = vpn_ipsec_configure();
115
	$savemsg = get_std_save_message($retval);
116 d17c7b79 jim-p
	if ($retval >= 0)
117 a368a026 Ermal Lu?i
		if (is_subsystem_dirty('ipsec'))
118
			clear_subsystem_dirty('ipsec');
119 5b237745 Scott Ullrich
}
120
121 3462a529 Matthew Grooms
if ($_POST['submit']) {
122
123 5b237745 Scott Ullrich
	unset($input_errors);
124
	$pconfig = $_POST;
125
126 3462a529 Matthew Grooms
	/* input consolidation */
127
128 e2411886 Scott Ullrich
	
129 3462a529 Matthew Grooms
130
	/* input validation */
131
132
	$reqdfields = explode(" ", "user_source group_source");
133 bfbd2610 Carlos Eduardo Ramos
	$reqdfieldsn =  array(gettext("User Authentication Source"),gettext("Group Authentication Source"));
134 3462a529 Matthew Grooms
135 1e9b4611 Renato Botelho
    do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
136 3462a529 Matthew Grooms
137
	if ($pconfig['pool_enable'])
138
		if (!is_ipaddr($pconfig['pool_address']))
139 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid IP address for 'Virtual Address Pool Network' must be specified.");
140 3462a529 Matthew Grooms
141
	if ($pconfig['dns_domain_enable'])
142
		if (!is_domain($pconfig['dns_domain']))
143 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid value for 'DNS Default Domain' must be specified.");
144 3462a529 Matthew Grooms
145 d7402222 jim-p
	if ($pconfig['dns_split_enable']) {
146
		if (!empty($pconfig['dns_split'])) {
147
			$domain_array=preg_split("/[ ,]+/",$pconfig['dns_split']);
148
			foreach ($domain_array as $curdomain) {
149
				if (!is_domain($curdomain)) {
150
					$input_errors[] = gettext("A valid split DNS domain list must be specified.");
151
					break;
152
				}
153
			}
154
		}
155
	}
156
157 3462a529 Matthew Grooms
	if ($pconfig['dns_server_enable']) {
158
		if (!$pconfig['dns_server1'] && !$pconfig['dns_server2'] &&
159
			!$pconfig['dns_server3'] && !$pconfig['dns_server4'] )
160 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("At least one DNS server must be specified to enable the DNS Server option.");
161 3462a529 Matthew Grooms
		if ($pconfig['dns_server1'] && !is_ipaddr($pconfig['dns_server1']))
162 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid IP address for 'DNS Server #1' must be specified.");
163 3462a529 Matthew Grooms
		if ($pconfig['dns_server2'] && !is_ipaddr($pconfig['dns_server2']))
164 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid IP address for 'DNS Server #2' must be specified.");
165 3462a529 Matthew Grooms
		if ($pconfig['dns_server3'] && !is_ipaddr($pconfig['dns_server3']))
166 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid IP address for 'DNS Server #3' must be specified.");
167 3462a529 Matthew Grooms
		if ($pconfig['dns_server4'] && !is_ipaddr($pconfig['dns_server4']))
168 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid IP address for 'DNS Server #4' must be specified.");
169 5b237745 Scott Ullrich
	}
170 3462a529 Matthew Grooms
171
	if ($pconfig['wins_server_enable']) {
172
		if (!$pconfig['wins_server1'] && !$pconfig['wins_server2'])
173 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("At least one WINS server must be specified to enable the DNS Server option.");
174 3462a529 Matthew Grooms
		if ($pconfig['wins_server1'] && !is_ipaddr($pconfig['wins_server1']))
175 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid IP address for 'WINS Server #1' must be specified.");
176 3462a529 Matthew Grooms
		if ($pconfig['wins_server2'] && !is_ipaddr($pconfig['wins_server2']))
177 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid IP address for 'WINS Server #2' must be specified.");
178 5b237745 Scott Ullrich
	}
179 3462a529 Matthew Grooms
180
	if ($pconfig['login_banner_enable'])
181
		if (!strlen($pconfig['login_banner']))
182 bfbd2610 Carlos Eduardo Ramos
			$input_errors[] = gettext("A valid value for 'Login Banner' must be specified.");
183 5b237745 Scott Ullrich
184
	if (!$input_errors) {
185 3462a529 Matthew Grooms
		$client = array();
186 5b237745 Scott Ullrich
		
187 3462a529 Matthew Grooms
		if ($pconfig['enable'])
188
			$client['enable'] = true;
189
190 52c9f9fa Ermal
		if (!empty($pconfig['user_source']))
191
			$client['user_source'] = implode(",", $pconfig['user_source']);
192 3462a529 Matthew Grooms
		$client['group_source'] = $pconfig['group_source'];
193
194
		if ($pconfig['pool_enable']) {
195
			$client['pool_address'] = $pconfig['pool_address'];
196
			$client['pool_netbits'] = $pconfig['pool_netbits'];
197 5b237745 Scott Ullrich
		}
198 3462a529 Matthew Grooms
199
		if ($pconfig['net_list_enable'])
200
			$client['net_list'] = true;
201
202 4178a1dd jim-p
		if ($pconfig['save_passwd_enable'])
203
			$client['save_passwd'] = true;
204
205 3462a529 Matthew Grooms
		if ($pconfig['dns_domain_enable'])
206
			$client['dns_domain'] = $pconfig['dns_domain'];
207
208 d7402222 jim-p
		if ($pconfig['dns_split_enable'])
209
			$client['dns_split'] = $pconfig['dns_split'];
210
211 3462a529 Matthew Grooms
		if ($pconfig['dns_server_enable']) {
212
			$client['dns_server1'] = $pconfig['dns_server1'];
213
			$client['dns_server2'] = $pconfig['dns_server2'];
214
			$client['dns_server3'] = $pconfig['dns_server3'];
215
			$client['dns_server4'] = $pconfig['dns_server4'];
216
		}
217
218
		if ($pconfig['wins_server_enable']) {
219
			$client['wins_server1'] = $pconfig['wins_server1'];
220
			$client['wins_server2'] = $pconfig['wins_server2'];
221
		}
222
223
		if ($pconfig['pfs_group_enable'])
224
			$client['pfs_group'] = $pconfig['pfs_group'];
225
226
		if ($pconfig['login_banner_enable'])
227
			$client['login_banner'] = $pconfig['login_banner'];
228
229
//		$echo "login banner = {$pconfig['login_banner']}";
230
231
		$a_client = $client;
232 5b237745 Scott Ullrich
		
233
		write_config();
234 a368a026 Ermal Lu?i
		mark_subsystem_dirty('ipsec');
235 5b237745 Scott Ullrich
		
236
		header("Location: vpn_ipsec_mobile.php");
237
		exit;
238
	}
239
}
240 422f27c0 Scott Ullrich
241 bfbd2610 Carlos Eduardo Ramos
$pgtitle = array(gettext("VPN"),gettext("IPsec"),gettext("Mobile"));
242 b32dd0a6 jim-p
$shortcut_section = "ipsec";
243 6deedfde jim-p
244 4df96eff Scott Ullrich
include("head.inc");
245
?>
246 3462a529 Matthew Grooms
247 422f27c0 Scott Ullrich
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
248 5b237745 Scott Ullrich
<?php include("fbegin.inc"); ?>
249 3462a529 Matthew Grooms
250 91f026b0 ayvis
<script type="text/javascript">
251 9bfbd73b Colin Fleming
//<![CDATA[
252 3462a529 Matthew Grooms
253
function pool_change() {
254
255
	if (document.iform.pool_enable.checked) {
256
		document.iform.pool_address.disabled = 0;
257
		document.iform.pool_netbits.disabled = 0;
258
	} else {
259
		document.iform.pool_address.disabled = 1;
260
		document.iform.pool_netbits.disabled = 1;
261
	}
262
}
263
264
function dns_domain_change() {
265
266
	if (document.iform.dns_domain_enable.checked)
267
		document.iform.dns_domain.disabled = 0;
268
	else
269
		document.iform.dns_domain.disabled = 1;
270
}
271
272 d7402222 jim-p
function dns_split_change() {
273
274
	if (document.iform.dns_split_enable.checked)
275
		document.iform.dns_split.disabled = 0;
276
	else
277
		document.iform.dns_split.disabled = 1;
278
}
279
280 3462a529 Matthew Grooms
function dns_server_change() {
281
282
	if (document.iform.dns_server_enable.checked) {
283
		document.iform.dns_server1.disabled = 0;
284
		document.iform.dns_server2.disabled = 0;
285
		document.iform.dns_server3.disabled = 0;
286
		document.iform.dns_server4.disabled = 0;
287
	} else {
288
		document.iform.dns_server1.disabled = 1;
289
		document.iform.dns_server2.disabled = 1;
290
		document.iform.dns_server3.disabled = 1;
291
		document.iform.dns_server4.disabled = 1;
292
	}
293
}
294
295
function wins_server_change() {
296
297
	if (document.iform.wins_server_enable.checked) {
298
		document.iform.wins_server1.disabled = 0;
299
		document.iform.wins_server2.disabled = 0;
300
	} else {
301
		document.iform.wins_server1.disabled = 1;
302
		document.iform.wins_server2.disabled = 1;
303 e2411886 Scott Ullrich
	}
304
}
305 3462a529 Matthew Grooms
306
function pfs_group_change() {
307
308
	if (document.iform.pfs_group_enable.checked)
309
		document.iform.pfs_group.disabled = 0;
310
	else
311
		document.iform.pfs_group.disabled = 1;
312
}
313
314
function login_banner_change() {
315
316
	if (document.iform.login_banner_enable.checked)
317
		document.iform.login_banner.disabled = 0;
318
	else
319
		document.iform.login_banner.disabled = 1;
320
}
321
322 9bfbd73b Colin Fleming
//]]>
323 e2411886 Scott Ullrich
</script>
324 3462a529 Matthew Grooms
325 5b237745 Scott Ullrich
<form action="vpn_ipsec_mobile.php" method="post" name="iform" id="iform">
326 5a3b0d3b mgrooms
327 323d040b Scott Ullrich
<?php
328 3462a529 Matthew Grooms
	if ($savemsg)
329
		print_info_box($savemsg);
330 a368a026 Ermal Lu?i
	if (isset($config['ipsec']['enable']) && is_subsystem_dirty('ipsec'))
331 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."));
332 3462a529 Matthew Grooms
	foreach ($a_phase1 as $ph1ent)
333
		if (isset($ph1ent['mobile']))
334
			$ph1found = true;
335
	if ($pconfig['enable'] && !$ph1found)
336 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"));
337 5a3b0d3b mgrooms
	if ($input_errors)
338
		print_input_errors($input_errors);
339 323d040b Scott Ullrich
?>
340 5a3b0d3b mgrooms
341 9bfbd73b Colin Fleming
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="vpn ipsec mobile">
342 3462a529 Matthew Grooms
	<tr>
343
		<td class="tabnavtbl">
344
			<?php
345
				$tab_array = array();
346 bfbd2610 Carlos Eduardo Ramos
				$tab_array[0] = array(gettext("Tunnels"), false, "vpn_ipsec.php");
347
				$tab_array[1] = array(gettext("Mobile clients"), true, "vpn_ipsec_mobile.php");
348 2a2b247b jim-p
				$tab_array[2] = array(gettext("Pre-Shared Key"), false, "vpn_ipsec_keys.php");
349 71172088 jim-p
				$tab_array[3] = array(gettext("Advanced Settings"), false, "vpn_ipsec_settings.php");
350 3462a529 Matthew Grooms
				display_top_tabs($tab_array);
351
			?>
352
		</td>
353
	</tr>
354
	<tr> 
355 5a3b0d3b mgrooms
		<td id="mainarea">
356
			<div class="tabcont">
357 9bfbd73b Colin Fleming
				<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
358 3462a529 Matthew Grooms
					<tr>
359 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncellreq"><?=gettext("IKE Extensions"); ?></td>
360 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
361 9bfbd73b Colin Fleming
							<table border="0" cellspacing="2" cellpadding="0" summary="ike extensions">
362 667725ce Matthew Grooms
								<tr>
363
									<td>
364
										<?php set_checked($pconfig['enable'],$chk); ?>
365 9bfbd73b Colin Fleming
										<input name="enable" type="checkbox" id="enable" value="yes" <?=$chk;?> />
366 667725ce Matthew Grooms
									</td>
367
									<td>
368 bfbd2610 Carlos Eduardo Ramos
										<strong><?=gettext("Enable IPsec Mobile Client Support"); ?></strong>
369 667725ce Matthew Grooms
									</td>
370
								</tr>
371
							</table>
372 3462a529 Matthew Grooms
						</td>
373
					</tr>
374
					<tr>
375
						<td colspan="2" class="list" height="12"></td>
376
					</tr>
377
					<tr>
378
						<td colspan="2" valign="top" class="listtopic">
379 bfbd2610 Carlos Eduardo Ramos
							<?=gettext("Extended Authentication (Xauth)"); ?>
380 3462a529 Matthew Grooms
						</td>
381
					</tr>
382
					<tr>
383 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncellreq"><?=gettext("User Authentication"); ?></td>
384 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
385 bfbd2610 Carlos Eduardo Ramos
							<?=gettext("Source"); ?>:&nbsp;&nbsp;
386 9bfbd73b Colin Fleming
							<select name="user_source[]" class="formselect" id="user_source" multiple="multiple" size="3">
387 52c9f9fa Ermal
							<?php
388
								$authmodes = explode(",", $pconfig['user_source']);
389
								$auth_servers = auth_get_authserver_list();
390
								foreach ($auth_servers as $auth_server) {
391
									$selected = "";
392
									if (in_array($auth_server['name'], $authmodes))
393 9bfbd73b Colin Fleming
										$selected = "selected=\"selected\"";
394 52c9f9fa Ermal
									echo "<option value='{$auth_server['name']}' {$selected}>{$auth_server['name']}</option>\n";
395
								}
396
							?>
397 3462a529 Matthew Grooms
							</select>
398
						</td>
399
					</tr>
400
					<tr>
401 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncellreq"><?=gettext("Group Authentication"); ?></td>
402 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
403 bfbd2610 Carlos Eduardo Ramos
							<?=gettext("Source"); ?>:&nbsp;&nbsp;
404 3462a529 Matthew Grooms
							<select name="group_source" class="formselect" id="group_source">
405 bfd4a79e Ermal
								<option value="none"><?=gettext("none"); ?></option>
406 9bfbd73b Colin Fleming
								<option value="system" <?php if ($pconfig['group_source'] == "system") echo "selected=\"selected\""; ?> ><?=gettext("system"); ?></option>
407 3462a529 Matthew Grooms
							</select>
408
						</td>
409
					</tr>
410
					<tr>
411
						<td colspan="2" class="list" height="12"></td>
412
					</tr>
413
					<tr> 
414
						<td colspan="2" valign="top" class="listtopic">
415 bfbd2610 Carlos Eduardo Ramos
							<?=gettext("Client Configuration (mode-cfg)"); ?>
416 3462a529 Matthew Grooms
						</td>
417
					</tr>
418
					<tr> 
419 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("Virtual Address Pool"); ?></td>
420 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
421 9bfbd73b Colin Fleming
							<table border="0" cellspacing="2" cellpadding="0" summary="enable pool">
422 3462a529 Matthew Grooms
								<tr>
423
									<td>
424
										<?php set_checked($pconfig['pool_enable'],$chk); ?>
425 9bfbd73b Colin Fleming
										<input name="pool_enable" type="checkbox" id="pool_enable" value="yes" <?=$chk;?> onclick="pool_change()" />
426 667725ce Matthew Grooms
									</td>
427
									<td>
428 8cd558b6 ayvis
										<?=gettext("Provide a virtual IP address to clients"); ?><br />
429 3462a529 Matthew Grooms
									</td>
430
								</tr>
431 667725ce Matthew Grooms
							</table>
432 9bfbd73b Colin Fleming
							<table border="0" cellspacing="2" cellpadding="0" summary="virtual address pool">
433 3462a529 Matthew Grooms
								<tr>
434
									<td>
435 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Network"); ?>:&nbsp;
436 9bfbd73b Colin Fleming
										<input name="pool_address" type="text" class="formfld unknown" id="pool_address" size="20" value="<?=htmlspecialchars($pconfig['pool_address']);?>" />
437 3462a529 Matthew Grooms
										/
438
										<select name="pool_netbits" class="formselect" id="pool_netbits">
439
											<?php for ($i = 32; $i >= 0; $i--): ?>
440 9bfbd73b Colin Fleming
											<option value="<?=$i;?>" <?php if ($i == $pconfig['pool_netbits']) echo "selected=\"selected\""; ?>>
441 3462a529 Matthew Grooms
												<?=$i;?>
442
											</option>
443
											<?php endfor; ?>
444
										</select>
445
									</td>
446
								</tr>
447
							</table>
448
						</td>
449
					</tr>
450
					<tr>
451 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("Network List"); ?></td>
452 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
453 9bfbd73b Colin Fleming
							<table border="0" cellspacing="2" cellpadding="0" summary="network list">
454 667725ce Matthew Grooms
								<tr>
455
									<td>
456
										<?php set_checked($pconfig['net_list_enable'],$chk); ?>
457 9bfbd73b Colin Fleming
										<input name="net_list_enable" type="checkbox" id="net_list_enable" value="yes" <?=$chk;?> />
458 667725ce Matthew Grooms
									</td>
459
									<td>
460 8cd558b6 ayvis
										<?=gettext("Provide a list of accessible networks to clients"); ?><br />
461 667725ce Matthew Grooms
									</td>
462
								</tr>
463
							</table>
464 3462a529 Matthew Grooms
						</td>
465
					</tr>
466 4178a1dd jim-p
					<tr>
467
						<td width="22%" valign="top" class="vncell"><?=gettext("Save Xauth Password"); ?></td>
468
						<td width="78%" class="vtable">
469 9bfbd73b Colin Fleming
							<table border="0" cellspacing="2" cellpadding="0" summary="password">
470 4178a1dd jim-p
								<tr>
471
									<td>
472
										<?php set_checked($pconfig['save_passwd_enable'],$chk); ?>
473 9bfbd73b Colin Fleming
										<input name="save_passwd_enable" type="checkbox" id="save_passwd_enable" value="yes" <?=$chk;?> />
474 4178a1dd jim-p
									</td>
475
									<td>
476 8cd558b6 ayvis
										<?=gettext("Allow clients to save Xauth passwords (Cisco VPN client only)."); ?><br />
477
										<?=gettext("NOTE: With iPhone clients, this does not work when deployed via the iPhone configuration utility, only by manual entry."); ?><br />
478 4178a1dd jim-p
									</td>
479
								</tr>
480
							</table>
481
						</td>
482
					</tr>
483 3462a529 Matthew Grooms
					<tr> 
484 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("DNS Default Domain"); ?></td>
485 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
486 9bfbd73b Colin Fleming
							<table border="0" cellspacing="2" cellpadding="0" summary="enable dns default domain">
487 3462a529 Matthew Grooms
								<tr>
488
									<td>
489
										<?php set_checked($pconfig['dns_domain_enable'],$chk); ?>
490 9bfbd73b Colin Fleming
										<input name="dns_domain_enable" type="checkbox" id="dns_domain_enable" value="yes" <?=$chk;?> onclick="dns_domain_change()" />
491 667725ce Matthew Grooms
									</td>
492
									<td>
493 8cd558b6 ayvis
										<?=gettext("Provide a default domain name to clients"); ?><br />
494 3462a529 Matthew Grooms
									</td>
495
								</tr>
496 667725ce Matthew Grooms
							</table>
497 9bfbd73b Colin Fleming
							<table border="0" cellspacing="2" cellpadding="0" summary="dns default domain">
498 3462a529 Matthew Grooms
								<tr>
499
									<td>
500 9bfbd73b Colin Fleming
										<input name="dns_domain" type="text" class="formfld unknown" id="dns_domain" size="30" value="<?=htmlspecialchars($pconfig['dns_domain']);?>" />
501 3462a529 Matthew Grooms
									</td>
502
								</tr>
503
							</table>
504
						</td>
505
					</tr>
506 d7402222 jim-p
					<tr>
507
						<td width="22%" valign="top" class="vncell"><?=gettext("Split DNS"); ?></td>
508
						<td width="78%" class="vtable">
509 9bfbd73b Colin Fleming
							<table border="0" cellspacing="2" cellpadding="0" summary="enable split dns">
510 d7402222 jim-p
								<tr>
511
									<td>
512
										<?php set_checked($pconfig['dns_split_enable'],$chk); ?>
513 9bfbd73b Colin Fleming
										<input name="dns_split_enable" type="checkbox" id="dns_split_enable" value="yes" <?=$chk;?> onclick="dns_split_change()" />
514 d7402222 jim-p
									</td>
515
									<td>
516 8cd558b6 ayvis
										<?=gettext("Provide a list of split DNS domain names to clients. Enter a comma separated list."); ?><br />
517 d7402222 jim-p
										<?=gettext("NOTE: If left blank, and a default domain is set, it will be used for this value."); ?>
518
									</td>
519
								</tr>
520
							</table>
521 9bfbd73b Colin Fleming
							<table border="0" cellspacing="2" cellpadding="0" summary="split dns">
522 d7402222 jim-p
								<tr>
523
									<td>
524 9bfbd73b Colin Fleming
										<input name="dns_split" type="text" class="formfld unknown" id="dns_split" size="30" value="<?=htmlspecialchars($pconfig['dns_split']);?>" />
525 d7402222 jim-p
									</td>
526
								</tr>
527
							</table>
528
						</td>
529
					</tr>
530 3462a529 Matthew Grooms
					<tr> 
531 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("DNS Servers"); ?></td>
532 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
533 9bfbd73b Colin Fleming
							<table border="0" cellspacing="2" cellpadding="0" summary="enable dns servers">
534 3462a529 Matthew Grooms
								<tr>
535
									<td>
536
										<?php set_checked($pconfig['dns_server_enable'],$chk); ?>
537 9bfbd73b Colin Fleming
										<input name="dns_server_enable" type="checkbox" id="dns_server_enable" value="yes" <?=$chk;?> onclick="dns_server_change()" />
538 667725ce Matthew Grooms
									</td>
539
									<td>
540 8cd558b6 ayvis
										<?=gettext("Provide a DNS server list to clients"); ?><br />
541 3462a529 Matthew Grooms
									</td>
542
								</tr>
543 667725ce Matthew Grooms
							</table>
544 9bfbd73b Colin Fleming
							<table border="0" cellspacing="2" cellpadding="0" summary="dns servers">
545 3462a529 Matthew Grooms
								<tr>
546
									<td>
547 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Server"); ?> #1:&nbsp;
548 9bfbd73b Colin Fleming
										<input name="dns_server1" type="text" class="formfld unknown" id="dns_server1" size="20" value="<?=htmlspecialchars($pconfig['dns_server1']);?>" />
549 3462a529 Matthew Grooms
									</td>
550
								</tr>
551
								<tr>
552
									<td>
553 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Server"); ?> #2:&nbsp;
554 9bfbd73b Colin Fleming
										<input name="dns_server2" type="text" class="formfld unknown" id="dns_server2" size="20" value="<?=htmlspecialchars($pconfig['dns_server2']);?>" />
555 3462a529 Matthew Grooms
									</td>
556
								</tr>
557
								<tr>
558
									<td>
559 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Server"); ?> #3:&nbsp;
560 9bfbd73b Colin Fleming
										<input name="dns_server3" type="text" class="formfld unknown" id="dns_server3" size="20" value="<?=htmlspecialchars($pconfig['dns_server3']);?>" />
561 3462a529 Matthew Grooms
									</td>
562
								</tr>
563
								<tr>
564
									<td>
565 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Server"); ?> #4:&nbsp;
566 9bfbd73b Colin Fleming
										<input name="dns_server4" type="text" class="formfld unknown" id="dns_server4" size="20" value="<?=htmlspecialchars($pconfig['dns_server4']);?>" />
567 3462a529 Matthew Grooms
									</td>
568
								</tr>
569
							</table>
570
						</td>
571
					</tr>
572
					<tr> 
573 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("WINS Servers"); ?></td>
574 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
575 9bfbd73b Colin Fleming
							<table border="0" cellspacing="2" cellpadding="0" summary="enable wins servers">
576 3462a529 Matthew Grooms
								<tr>
577
									<td>
578
										<?php set_checked($pconfig['wins_server_enable'],$chk); ?>
579 9bfbd73b Colin Fleming
										<input name="wins_server_enable" type="checkbox" id="wins_server_enable" value="yes" <?=$chk;?> onclick="wins_server_change()" />
580 667725ce Matthew Grooms
									</td>
581
									<td>
582 8cd558b6 ayvis
										<?=gettext("Provide a WINS server list to clients"); ?><br />
583 3462a529 Matthew Grooms
									</td>
584
								</tr>
585 667725ce Matthew Grooms
							</table>
586 9bfbd73b Colin Fleming
							<table border="0" cellspacing="2" cellpadding="0" summary="wins servers">
587 3462a529 Matthew Grooms
								<tr>
588
									<td>
589 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Server"); ?> #1:&nbsp;
590 9bfbd73b Colin Fleming
										<input name="wins_server1" type="text" class="formfld unknown" id="wins_server1" size="20" value="<?=htmlspecialchars($pconfig['wins_server1']);?>" />
591 3462a529 Matthew Grooms
									</td>
592
								</tr>
593
								<tr>
594
									<td>
595 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Server"); ?> #2:&nbsp;
596 9bfbd73b Colin Fleming
										<input name="wins_server2" type="text" class="formfld unknown" id="wins_server2" size="20" value="<?=htmlspecialchars($pconfig['wins_server2']);?>" />
597 3462a529 Matthew Grooms
									</td>
598
								</tr>
599
							</table>
600
						</td>
601
					</tr>
602
					<tr>
603 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("Phase2 PFS Group"); ?></td>
604 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
605 9bfbd73b Colin Fleming
							<table border="0" cellspacing="2" cellpadding="0" summary="enable pfs group">
606 3462a529 Matthew Grooms
								<tr>
607
									<td>
608
										<?php set_checked($pconfig['pfs_group_enable'],$chk); ?>
609 9bfbd73b Colin Fleming
										<input name="pfs_group_enable" type="checkbox" id="pfs_group_enable" value="yes" <?=$chk;?> onclick="pfs_group_change()" />
610 667725ce Matthew Grooms
									</td>
611
									<td>
612 8cd558b6 ayvis
										<?=gettext("Provide the Phase2 PFS group to clients ( overrides all mobile phase2 settings )"); ?><br />
613 3462a529 Matthew Grooms
									</td>
614
								</tr>
615 667725ce Matthew Grooms
							</table>
616 9bfbd73b Colin Fleming
							<table border="0" cellspacing="2" cellpadding="0" summary="phase-2 pfs group">
617 3462a529 Matthew Grooms
								<tr>
618
									<td>
619 bfbd2610 Carlos Eduardo Ramos
										<?=gettext("Group"); ?>:&nbsp;&nbsp;
620 3462a529 Matthew Grooms
										<select name="pfs_group" class="formselect" id="pfs_group">
621
										<?php foreach ($p2_pfskeygroups as $keygroup => $keygroupname): ?>
622 9bfbd73b Colin Fleming
											<option value="<?=$keygroup;?>" <?php if ($pconfig['pfs_group'] == $keygroup) echo "selected=\"selected\""; ?>>
623 3462a529 Matthew Grooms
												<?=htmlspecialchars($keygroupname);?>
624
											</option>
625
										<?php endforeach; ?>
626
										</select>
627
									</td>
628
								</tr>
629
							</table>
630
						</td>
631
					</tr>
632
					<tr> 
633 bfbd2610 Carlos Eduardo Ramos
						<td width="22%" valign="top" class="vncell"><?=gettext("Login Banner"); ?></td>
634 3462a529 Matthew Grooms
						<td width="78%" class="vtable">
635 9bfbd73b Colin Fleming
							<table border="0" cellspacing="2" cellpadding="0" summary="enable login banner">
636 3462a529 Matthew Grooms
								<tr>
637
									<td>
638
										<?php set_checked($pconfig['login_banner_enable'],$chk); ?>
639 9bfbd73b Colin Fleming
										<input name="login_banner_enable" type="checkbox" id="login_banner_enable" value="yes" <?=$chk;?> onclick="login_banner_change()" />
640 667725ce Matthew Grooms
									</td>
641
									<td>
642 8cd558b6 ayvis
										<?=gettext("Provide a login banner to clients"); ?><br />
643 3462a529 Matthew Grooms
									</td>
644
								</tr>
645 667725ce Matthew Grooms
							</table>
646 9bfbd73b Colin Fleming
							<table border="0" cellspacing="2" cellpadding="0" summary="banner">
647 3462a529 Matthew Grooms
								<tr>
648
									<td>
649
										<?php $banner = htmlspecialchars($pconfig['login_banner']); ?>
650 dd5bf424 Scott Ullrich
										<textarea name="login_banner" cols="65" rows="7" id="login_banner" class="formpre"><?=htmlspecialchars($banner);?></textarea>
651 3462a529 Matthew Grooms
									</td>
652
								</tr>
653
							</table>
654
						</td>
655
					</tr>
656
					<tr>
657
						<td width="22%" valign="top">&nbsp;</td>
658
						<td width="78%">
659 9bfbd73b Colin Fleming
							<input name="submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
660 3462a529 Matthew Grooms
						</td>
661
					</tr>
662
				</table>
663
			</div>
664
		</td>
665 0f10aee4 Bill Marquette
	</tr>
666
</table>
667 5b237745 Scott Ullrich
</form>
668 91f026b0 ayvis
<script type="text/javascript">
669 9bfbd73b Colin Fleming
//<![CDATA[
670 3462a529 Matthew Grooms
pool_change();
671
dns_domain_change();
672 d7402222 jim-p
dns_split_change();
673 3462a529 Matthew Grooms
dns_server_change();
674
wins_server_change();
675
pfs_group_change();
676
login_banner_change();
677 9bfbd73b Colin Fleming
//]]>
678 e2411886 Scott Ullrich
</script>
679 5b237745 Scott Ullrich
<?php include("fend.inc"); ?>
680 323d040b Scott Ullrich
</body>
681
</html>
682 3462a529 Matthew Grooms
683
<?php
684
685
/* local utility functions */
686
687
function set_checked($var,& $chk) {
688
	if($var)
689 9bfbd73b Colin Fleming
		$chk = "checked=\"checked\"";
690 3462a529 Matthew Grooms
	else
691 9bfbd73b Colin Fleming
		$chk = "";
692 3462a529 Matthew Grooms
}
693
694
?>