1
|
<?php
|
2
|
/*
|
3
|
vpn_ipsec_mobile.php
|
4
|
|
5
|
Copyright (C) 2008 Shrew Soft Inc
|
6
|
Copyright (C) 2013-2015 Electric Sheep Fencing, LP
|
7
|
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
|
##|+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
|
require("functions.inc");
|
39
|
require("guiconfig.inc");
|
40
|
require_once("ipsec.inc");
|
41
|
require_once("vpn.inc");
|
42
|
require_once("filter.inc");
|
43
|
|
44
|
if (!is_array($config['ipsec']['phase1']))
|
45
|
$config['ipsec']['phase1'] = array();
|
46
|
|
47
|
$a_phase1 = &$config['ipsec']['phase1'];
|
48
|
|
49
|
if (!is_array($config['ipsec']['client']))
|
50
|
$config['ipsec']['client'] = array();
|
51
|
|
52
|
$a_client = &$config['ipsec']['client'];
|
53
|
|
54
|
if (count($a_client)) {
|
55
|
|
56
|
$pconfig['enable'] = $a_client['enable'];
|
57
|
|
58
|
$pconfig['user_source'] = $a_client['user_source'];
|
59
|
$pconfig['group_source'] = $a_client['group_source'];
|
60
|
|
61
|
$pconfig['pool_address'] = $a_client['pool_address'];
|
62
|
$pconfig['pool_netbits'] = $a_client['pool_netbits'];
|
63
|
$pconfig['pool_address_v6'] = $a_client['pool_address_v6'];
|
64
|
$pconfig['pool_netbits_v6'] = $a_client['pool_netbits_v6'];
|
65
|
$pconfig['net_list'] = $a_client['net_list'];
|
66
|
$pconfig['save_passwd'] = $a_client['save_passwd'];
|
67
|
$pconfig['dns_domain'] = $a_client['dns_domain'];
|
68
|
$pconfig['dns_split'] = $a_client['dns_split'];
|
69
|
$pconfig['dns_server1'] = $a_client['dns_server1'];
|
70
|
$pconfig['dns_server2'] = $a_client['dns_server2'];
|
71
|
$pconfig['dns_server3'] = $a_client['dns_server3'];
|
72
|
$pconfig['dns_server4'] = $a_client['dns_server4'];
|
73
|
$pconfig['wins_server1'] = $a_client['wins_server1'];
|
74
|
$pconfig['wins_server2'] = $a_client['wins_server2'];
|
75
|
$pconfig['pfs_group'] = $a_client['pfs_group'];
|
76
|
$pconfig['login_banner'] = $a_client['login_banner'];
|
77
|
|
78
|
if (isset($pconfig['enable']))
|
79
|
$pconfig['enable'] = true;
|
80
|
|
81
|
if ($pconfig['pool_address']&&$pconfig['pool_netbits'])
|
82
|
$pconfig['pool_enable'] = true;
|
83
|
else
|
84
|
$pconfig['pool_netbits'] = 24;
|
85
|
|
86
|
if ($pconfig['pool_address_v6'] && $pconfig['pool_netbits_v6'])
|
87
|
$pconfig['pool_enable_v6'] = true;
|
88
|
else
|
89
|
$pconfig['pool_netbits_v6'] = 120;
|
90
|
|
91
|
if (isset($pconfig['net_list']))
|
92
|
$pconfig['net_list_enable'] = true;
|
93
|
|
94
|
if (isset($pconfig['save_passwd']))
|
95
|
$pconfig['save_passwd_enable'] = true;
|
96
|
|
97
|
if ($pconfig['dns_domain'])
|
98
|
$pconfig['dns_domain_enable'] = true;
|
99
|
|
100
|
if ($pconfig['dns_split'])
|
101
|
$pconfig['dns_split_enable'] = true;
|
102
|
|
103
|
if ($pconfig['dns_server1']||$pconfig['dns_server2']||$pconfig['dns_server3']||$pconfig['dns_server4'])
|
104
|
$pconfig['dns_server_enable'] = true;
|
105
|
|
106
|
if ($pconfig['wins_server1']||$pconfig['wins_server2'])
|
107
|
$pconfig['wins_server_enable'] = true;
|
108
|
|
109
|
if (isset($pconfig['pfs_group']))
|
110
|
$pconfig['pfs_group_enable'] = true;
|
111
|
|
112
|
if ($pconfig['login_banner'])
|
113
|
$pconfig['login_banner_enable'] = true;
|
114
|
}
|
115
|
|
116
|
if ($_POST['create']) {
|
117
|
header("Location: vpn_ipsec_phase1.php?mobile=true");
|
118
|
}
|
119
|
|
120
|
if ($_POST['apply']) {
|
121
|
$retval = 0;
|
122
|
/* NOTE: #4353 Always restart ipsec when mobile clients settings change */
|
123
|
$retval = vpn_ipsec_configure(true);
|
124
|
$savemsg = get_std_save_message($retval);
|
125
|
if ($retval >= 0)
|
126
|
if (is_subsystem_dirty('ipsec'))
|
127
|
clear_subsystem_dirty('ipsec');
|
128
|
}
|
129
|
|
130
|
if ($_POST['submit']) {
|
131
|
|
132
|
unset($input_errors);
|
133
|
$pconfig = $_POST;
|
134
|
|
135
|
/* input consolidation */
|
136
|
|
137
|
|
138
|
|
139
|
/* input validation */
|
140
|
|
141
|
$reqdfields = explode(" ", "user_source group_source");
|
142
|
$reqdfieldsn = array(gettext("User Authentication Source"),gettext("Group Authentication Source"));
|
143
|
|
144
|
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
|
145
|
|
146
|
if ($pconfig['pool_enable'])
|
147
|
if (!is_ipaddr($pconfig['pool_address']))
|
148
|
$input_errors[] = gettext("A valid IP address for 'Virtual Address Pool Network' must be specified.");
|
149
|
|
150
|
if ($pconfig['pool_enable_v6'])
|
151
|
if (!is_ipaddrv6($pconfig['pool_address_v6']))
|
152
|
$input_errors[] = gettext("A valid IPv6 address for 'Virtual IPv6 Address Pool Network' must be specified.");
|
153
|
|
154
|
if ($pconfig['dns_domain_enable'])
|
155
|
if (!is_domain($pconfig['dns_domain']))
|
156
|
$input_errors[] = gettext("A valid value for 'DNS Default Domain' must be specified.");
|
157
|
|
158
|
if ($pconfig['dns_split_enable']) {
|
159
|
if (!empty($pconfig['dns_split'])) {
|
160
|
/* Replace multiple spaces by single */
|
161
|
$pconfig['dns_split'] = preg_replace('/\s+/', ' ', trim($pconfig['dns_split']));
|
162
|
$domain_array=explode(' ', $pconfig['dns_split']);
|
163
|
foreach ($domain_array as $curdomain) {
|
164
|
if (!is_domain($curdomain)) {
|
165
|
$input_errors[] = gettext("A valid split DNS domain list must be specified.");
|
166
|
break;
|
167
|
}
|
168
|
}
|
169
|
}
|
170
|
}
|
171
|
|
172
|
if ($pconfig['dns_server_enable']) {
|
173
|
if (!$pconfig['dns_server1'] && !$pconfig['dns_server2'] &&
|
174
|
!$pconfig['dns_server3'] && !$pconfig['dns_server4'] )
|
175
|
$input_errors[] = gettext("At least one DNS server must be specified to enable the DNS Server option.");
|
176
|
if ($pconfig['dns_server1'] && !is_ipaddr($pconfig['dns_server1']))
|
177
|
$input_errors[] = gettext("A valid IP address for 'DNS Server #1' must be specified.");
|
178
|
if ($pconfig['dns_server2'] && !is_ipaddr($pconfig['dns_server2']))
|
179
|
$input_errors[] = gettext("A valid IP address for 'DNS Server #2' must be specified.");
|
180
|
if ($pconfig['dns_server3'] && !is_ipaddr($pconfig['dns_server3']))
|
181
|
$input_errors[] = gettext("A valid IP address for 'DNS Server #3' must be specified.");
|
182
|
if ($pconfig['dns_server4'] && !is_ipaddr($pconfig['dns_server4']))
|
183
|
$input_errors[] = gettext("A valid IP address for 'DNS Server #4' must be specified.");
|
184
|
}
|
185
|
|
186
|
if ($pconfig['wins_server_enable']) {
|
187
|
if (!$pconfig['wins_server1'] && !$pconfig['wins_server2'])
|
188
|
$input_errors[] = gettext("At least one WINS server must be specified to enable the DNS Server option.");
|
189
|
if ($pconfig['wins_server1'] && !is_ipaddr($pconfig['wins_server1']))
|
190
|
$input_errors[] = gettext("A valid IP address for 'WINS Server #1' must be specified.");
|
191
|
if ($pconfig['wins_server2'] && !is_ipaddr($pconfig['wins_server2']))
|
192
|
$input_errors[] = gettext("A valid IP address for 'WINS Server #2' must be specified.");
|
193
|
}
|
194
|
|
195
|
if ($pconfig['login_banner_enable'])
|
196
|
if (!strlen($pconfig['login_banner']))
|
197
|
$input_errors[] = gettext("A valid value for 'Login Banner' must be specified.");
|
198
|
|
199
|
if (!$input_errors) {
|
200
|
$client = array();
|
201
|
|
202
|
if ($pconfig['enable'])
|
203
|
$client['enable'] = true;
|
204
|
|
205
|
if (!empty($pconfig['user_source']))
|
206
|
$client['user_source'] = implode(",", $pconfig['user_source']);
|
207
|
$client['group_source'] = $pconfig['group_source'];
|
208
|
|
209
|
if ($pconfig['pool_enable']) {
|
210
|
$client['pool_address'] = $pconfig['pool_address'];
|
211
|
$client['pool_netbits'] = $pconfig['pool_netbits'];
|
212
|
}
|
213
|
|
214
|
if ($pconfig['pool_enable_v6']) {
|
215
|
$client['pool_address_v6'] = $pconfig['pool_address_v6'];
|
216
|
$client['pool_netbits_v6'] = $pconfig['pool_netbits_v6'];
|
217
|
}
|
218
|
|
219
|
if ($pconfig['net_list_enable'])
|
220
|
$client['net_list'] = true;
|
221
|
|
222
|
if ($pconfig['save_passwd_enable'])
|
223
|
$client['save_passwd'] = true;
|
224
|
|
225
|
if ($pconfig['dns_domain_enable'])
|
226
|
$client['dns_domain'] = $pconfig['dns_domain'];
|
227
|
|
228
|
if ($pconfig['dns_split_enable'])
|
229
|
$client['dns_split'] = $pconfig['dns_split'];
|
230
|
|
231
|
if ($pconfig['dns_server_enable']) {
|
232
|
$client['dns_server1'] = $pconfig['dns_server1'];
|
233
|
$client['dns_server2'] = $pconfig['dns_server2'];
|
234
|
$client['dns_server3'] = $pconfig['dns_server3'];
|
235
|
$client['dns_server4'] = $pconfig['dns_server4'];
|
236
|
}
|
237
|
|
238
|
if ($pconfig['wins_server_enable']) {
|
239
|
$client['wins_server1'] = $pconfig['wins_server1'];
|
240
|
$client['wins_server2'] = $pconfig['wins_server2'];
|
241
|
}
|
242
|
|
243
|
if ($pconfig['pfs_group_enable'])
|
244
|
$client['pfs_group'] = $pconfig['pfs_group'];
|
245
|
|
246
|
if ($pconfig['login_banner_enable'])
|
247
|
$client['login_banner'] = $pconfig['login_banner'];
|
248
|
|
249
|
$a_client = $client;
|
250
|
|
251
|
write_config();
|
252
|
mark_subsystem_dirty('ipsec');
|
253
|
|
254
|
header("Location: vpn_ipsec_mobile.php");
|
255
|
exit;
|
256
|
}
|
257
|
}
|
258
|
|
259
|
$pgtitle = array(gettext("VPN"),gettext("IPsec"),gettext("Mobile"));
|
260
|
$shortcut_section = "ipsec";
|
261
|
|
262
|
include("head.inc");
|
263
|
?>
|
264
|
|
265
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
266
|
<?php include("fbegin.inc"); ?>
|
267
|
|
268
|
<script type="text/javascript">
|
269
|
//<![CDATA[
|
270
|
|
271
|
function pool_change() {
|
272
|
|
273
|
if (document.iform.pool_enable.checked) {
|
274
|
document.iform.pool_address.disabled = 0;
|
275
|
document.iform.pool_netbits.disabled = 0;
|
276
|
} else {
|
277
|
document.iform.pool_address.disabled = 1;
|
278
|
document.iform.pool_netbits.disabled = 1;
|
279
|
}
|
280
|
}
|
281
|
|
282
|
function pool_change_v6() {
|
283
|
if (document.iform.pool_enable_v6.checked) {
|
284
|
document.iform.pool_address_v6.disabled = 0;
|
285
|
document.iform.pool_netbits_v6.disabled = 0;
|
286
|
} else {
|
287
|
document.iform.pool_address_v6.disabled = 1;
|
288
|
document.iform.pool_netbits_v6.disabled = 1;
|
289
|
}
|
290
|
}
|
291
|
|
292
|
function dns_domain_change() {
|
293
|
|
294
|
if (document.iform.dns_domain_enable.checked)
|
295
|
document.iform.dns_domain.disabled = 0;
|
296
|
else
|
297
|
document.iform.dns_domain.disabled = 1;
|
298
|
}
|
299
|
|
300
|
function dns_split_change() {
|
301
|
|
302
|
if (document.iform.dns_split_enable.checked)
|
303
|
document.iform.dns_split.disabled = 0;
|
304
|
else
|
305
|
document.iform.dns_split.disabled = 1;
|
306
|
}
|
307
|
|
308
|
function dns_server_change() {
|
309
|
|
310
|
if (document.iform.dns_server_enable.checked) {
|
311
|
document.iform.dns_server1.disabled = 0;
|
312
|
document.iform.dns_server2.disabled = 0;
|
313
|
document.iform.dns_server3.disabled = 0;
|
314
|
document.iform.dns_server4.disabled = 0;
|
315
|
} else {
|
316
|
document.iform.dns_server1.disabled = 1;
|
317
|
document.iform.dns_server2.disabled = 1;
|
318
|
document.iform.dns_server3.disabled = 1;
|
319
|
document.iform.dns_server4.disabled = 1;
|
320
|
}
|
321
|
}
|
322
|
|
323
|
function wins_server_change() {
|
324
|
|
325
|
if (document.iform.wins_server_enable.checked) {
|
326
|
document.iform.wins_server1.disabled = 0;
|
327
|
document.iform.wins_server2.disabled = 0;
|
328
|
} else {
|
329
|
document.iform.wins_server1.disabled = 1;
|
330
|
document.iform.wins_server2.disabled = 1;
|
331
|
}
|
332
|
}
|
333
|
|
334
|
function pfs_group_change() {
|
335
|
|
336
|
if (document.iform.pfs_group_enable.checked)
|
337
|
document.iform.pfs_group.disabled = 0;
|
338
|
else
|
339
|
document.iform.pfs_group.disabled = 1;
|
340
|
}
|
341
|
|
342
|
function login_banner_change() {
|
343
|
|
344
|
if (document.iform.login_banner_enable.checked)
|
345
|
document.iform.login_banner.disabled = 0;
|
346
|
else
|
347
|
document.iform.login_banner.disabled = 1;
|
348
|
}
|
349
|
|
350
|
//]]>
|
351
|
</script>
|
352
|
|
353
|
<form action="vpn_ipsec_mobile.php" method="post" name="iform" id="iform">
|
354
|
|
355
|
<?php
|
356
|
if ($savemsg)
|
357
|
print_info_box($savemsg);
|
358
|
if (isset($config['ipsec']['enable']) && is_subsystem_dirty('ipsec'))
|
359
|
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."));
|
360
|
foreach ($a_phase1 as $ph1ent)
|
361
|
if (isset($ph1ent['mobile']))
|
362
|
$ph1found = true;
|
363
|
if ($pconfig['enable'] && !$ph1found)
|
364
|
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"));
|
365
|
if ($input_errors)
|
366
|
print_input_errors($input_errors);
|
367
|
?>
|
368
|
|
369
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="vpn ipsec mobile">
|
370
|
<tr>
|
371
|
<td class="tabnavtbl">
|
372
|
<?php
|
373
|
$tab_array = array();
|
374
|
$tab_array[0] = array(gettext("Tunnels"), false, "vpn_ipsec.php");
|
375
|
$tab_array[1] = array(gettext("Mobile clients"), true, "vpn_ipsec_mobile.php");
|
376
|
$tab_array[2] = array(gettext("Pre-Shared Key"), false, "vpn_ipsec_keys.php");
|
377
|
$tab_array[3] = array(gettext("Advanced Settings"), false, "vpn_ipsec_settings.php");
|
378
|
display_top_tabs($tab_array);
|
379
|
?>
|
380
|
</td>
|
381
|
</tr>
|
382
|
<tr>
|
383
|
<td id="mainarea">
|
384
|
<div class="tabcont">
|
385
|
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
|
386
|
<tr>
|
387
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("IKE Extensions"); ?></td>
|
388
|
<td width="78%" class="vtable">
|
389
|
<table border="0" cellspacing="2" cellpadding="0" summary="ike extensions">
|
390
|
<tr>
|
391
|
<td>
|
392
|
<?php set_checked($pconfig['enable'],$chk); ?>
|
393
|
<input name="enable" type="checkbox" id="enable" value="yes" <?=$chk;?> />
|
394
|
</td>
|
395
|
<td>
|
396
|
<strong><?=gettext("Enable IPsec Mobile Client Support"); ?></strong>
|
397
|
</td>
|
398
|
</tr>
|
399
|
</table>
|
400
|
</td>
|
401
|
</tr>
|
402
|
<tr>
|
403
|
<td colspan="2" class="list" height="12"></td>
|
404
|
</tr>
|
405
|
<tr>
|
406
|
<td colspan="2" valign="top" class="listtopic">
|
407
|
<?=gettext("Extended Authentication (Xauth)"); ?>
|
408
|
</td>
|
409
|
</tr>
|
410
|
<tr>
|
411
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("User Authentication"); ?></td>
|
412
|
<td width="78%" class="vtable">
|
413
|
<?=gettext("Source"); ?>:
|
414
|
<select name="user_source[]" class="formselect" id="user_source" multiple="multiple" size="3">
|
415
|
<?php
|
416
|
$authmodes = explode(",", $pconfig['user_source']);
|
417
|
$auth_servers = auth_get_authserver_list();
|
418
|
foreach ($auth_servers as $auth_server) {
|
419
|
$selected = "";
|
420
|
if (in_array($auth_server['name'], $authmodes))
|
421
|
$selected = "selected=\"selected\"";
|
422
|
echo "<option value=\"" . htmlspecialchars($auth_server['name']). "\" {$selected}>" . htmlspecialchars($auth_server['name']). "</option>\n";
|
423
|
}
|
424
|
?>
|
425
|
</select>
|
426
|
</td>
|
427
|
</tr>
|
428
|
<tr>
|
429
|
<td width="22%" valign="top" class="vncellreq"><?=gettext("Group Authentication"); ?></td>
|
430
|
<td width="78%" class="vtable">
|
431
|
<?=gettext("Source"); ?>:
|
432
|
<select name="group_source" class="formselect" id="group_source">
|
433
|
<option value="none"><?=gettext("none"); ?></option>
|
434
|
<option value="system" <?php if ($pconfig['group_source'] == "system") echo "selected=\"selected\""; ?> ><?=gettext("system"); ?></option>
|
435
|
</select>
|
436
|
</td>
|
437
|
</tr>
|
438
|
<tr>
|
439
|
<td colspan="2" class="list" height="12"></td>
|
440
|
</tr>
|
441
|
<tr>
|
442
|
<td colspan="2" valign="top" class="listtopic">
|
443
|
<?=gettext("Client Configuration (mode-cfg)"); ?>
|
444
|
</td>
|
445
|
</tr>
|
446
|
<tr>
|
447
|
<td width="22%" valign="top" class="vncell"><?=gettext("Virtual Address Pool"); ?></td>
|
448
|
<td width="78%" class="vtable">
|
449
|
<table border="0" cellspacing="2" cellpadding="0" summary="enable pool">
|
450
|
<tr>
|
451
|
<td>
|
452
|
<?php set_checked($pconfig['pool_enable'],$chk); ?>
|
453
|
<input name="pool_enable" type="checkbox" id="pool_enable" value="yes" <?=$chk;?> onclick="pool_change()" />
|
454
|
</td>
|
455
|
<td>
|
456
|
<?=gettext("Provide a virtual IP address to clients"); ?><br />
|
457
|
</td>
|
458
|
</tr>
|
459
|
</table>
|
460
|
<table border="0" cellspacing="2" cellpadding="0" summary="virtual address pool">
|
461
|
<tr>
|
462
|
<td>
|
463
|
<?=gettext("Network"); ?>:
|
464
|
<input name="pool_address" type="text" class="formfld unknown" id="pool_address" size="20" value="<?=htmlspecialchars($pconfig['pool_address']);?>" />
|
465
|
/
|
466
|
<select name="pool_netbits" class="formselect" id="pool_netbits">
|
467
|
<?php for ($i = 32; $i >= 0; $i--): ?>
|
468
|
<option value="<?=$i;?>" <?php if ($i == $pconfig['pool_netbits']) echo "selected=\"selected\""; ?>>
|
469
|
<?=$i;?>
|
470
|
</option>
|
471
|
<?php endfor; ?>
|
472
|
</select>
|
473
|
</td>
|
474
|
</tr>
|
475
|
</table>
|
476
|
</td>
|
477
|
</tr>
|
478
|
<tr>
|
479
|
<td width="22%" valign="top" class="vncell"><?=gettext("Virtual IPv6 Address Pool"); ?></td>
|
480
|
<td width="78%" class="vtable">
|
481
|
<table border="0" cellspacing="2" cellpadding="0" summary="enable v6 pool">
|
482
|
<tr>
|
483
|
<td>
|
484
|
<?php set_checked($pconfig['pool_enable_v6'],$chk); ?>
|
485
|
<input name="pool_enable_v6" type="checkbox" id="pool_enable_v6" value="yes" <?=$chk;?> onclick="pool_change_v6()" />
|
486
|
</td>
|
487
|
<td>
|
488
|
<?=gettext("Provide a virtual IPv6 address to clients"); ?><br />
|
489
|
</td>
|
490
|
</tr>
|
491
|
</table>
|
492
|
<table border="0" cellspacing="2" cellpadding="0" summary="virtual IPv6 address pool">
|
493
|
<tr>
|
494
|
<td>
|
495
|
<?=gettext("Network"); ?>:
|
496
|
<input name="pool_address_v6" type="text" class="formfld unknown" id="pool_address_v6" size="20" value="<?=htmlspecialchars($pconfig['pool_address_v6']);?>" />
|
497
|
/
|
498
|
<select name="pool_netbits_v6" class="formselect" id="pool_netbits_v6">
|
499
|
<?php for ($i = 128; $i >= 0; $i--): ?>
|
500
|
<option value="<?=$i;?>" <?php if ($i == $pconfig['pool_netbits_v6']) echo "selected=\"selected\""; ?>>
|
501
|
<?=$i;?>
|
502
|
</option>
|
503
|
<?php endfor; ?>
|
504
|
</select>
|
505
|
</td>
|
506
|
</tr>
|
507
|
</table>
|
508
|
</td>
|
509
|
</tr>
|
510
|
<tr>
|
511
|
<td width="22%" valign="top" class="vncell"><?=gettext("Network List"); ?></td>
|
512
|
<td width="78%" class="vtable">
|
513
|
<table border="0" cellspacing="2" cellpadding="0" summary="network list">
|
514
|
<tr>
|
515
|
<td>
|
516
|
<?php set_checked($pconfig['net_list_enable'],$chk); ?>
|
517
|
<input name="net_list_enable" type="checkbox" id="net_list_enable" value="yes" <?=$chk;?> />
|
518
|
</td>
|
519
|
<td>
|
520
|
<?=gettext("Provide a list of accessible networks to clients"); ?><br />
|
521
|
</td>
|
522
|
</tr>
|
523
|
</table>
|
524
|
</td>
|
525
|
</tr>
|
526
|
<tr>
|
527
|
<td width="22%" valign="top" class="vncell"><?=gettext("Save Xauth Password"); ?></td>
|
528
|
<td width="78%" class="vtable">
|
529
|
<table border="0" cellspacing="2" cellpadding="0" summary="password">
|
530
|
<tr>
|
531
|
<td>
|
532
|
<?php set_checked($pconfig['save_passwd_enable'],$chk); ?>
|
533
|
<input name="save_passwd_enable" type="checkbox" id="save_passwd_enable" value="yes" <?=$chk;?> />
|
534
|
</td>
|
535
|
<td>
|
536
|
<?=gettext("Allow clients to save Xauth passwords (Cisco VPN client only)."); ?><br />
|
537
|
<?=gettext("NOTE: With iPhone clients, this does not work when deployed via the iPhone configuration utility, only by manual entry."); ?><br />
|
538
|
</td>
|
539
|
</tr>
|
540
|
</table>
|
541
|
</td>
|
542
|
</tr>
|
543
|
<tr>
|
544
|
<td width="22%" valign="top" class="vncell"><?=gettext("DNS Default Domain"); ?></td>
|
545
|
<td width="78%" class="vtable">
|
546
|
<table border="0" cellspacing="2" cellpadding="0" summary="enable dns default domain">
|
547
|
<tr>
|
548
|
<td>
|
549
|
<?php set_checked($pconfig['dns_domain_enable'],$chk); ?>
|
550
|
<input name="dns_domain_enable" type="checkbox" id="dns_domain_enable" value="yes" <?=$chk;?> onclick="dns_domain_change()" />
|
551
|
</td>
|
552
|
<td>
|
553
|
<?=gettext("Provide a default domain name to clients"); ?><br />
|
554
|
</td>
|
555
|
</tr>
|
556
|
</table>
|
557
|
<table border="0" cellspacing="2" cellpadding="0" summary="dns default domain">
|
558
|
<tr>
|
559
|
<td>
|
560
|
<input name="dns_domain" type="text" class="formfld unknown" id="dns_domain" size="30" value="<?=htmlspecialchars($pconfig['dns_domain']);?>" />
|
561
|
</td>
|
562
|
</tr>
|
563
|
</table>
|
564
|
</td>
|
565
|
</tr>
|
566
|
<tr>
|
567
|
<td width="22%" valign="top" class="vncell"><?=gettext("Split DNS"); ?></td>
|
568
|
<td width="78%" class="vtable">
|
569
|
<table border="0" cellspacing="2" cellpadding="0" summary="enable split dns">
|
570
|
<tr>
|
571
|
<td>
|
572
|
<?php set_checked($pconfig['dns_split_enable'],$chk); ?>
|
573
|
<input name="dns_split_enable" type="checkbox" id="dns_split_enable" value="yes" <?=$chk;?> onclick="dns_split_change()" />
|
574
|
</td>
|
575
|
<td>
|
576
|
<?=gettext("Provide a list of split DNS domain names to clients. Enter a space separated list."); ?><br />
|
577
|
<?=gettext("NOTE: If left blank, and a default domain is set, it will be used for this value."); ?>
|
578
|
</td>
|
579
|
</tr>
|
580
|
</table>
|
581
|
<table border="0" cellspacing="2" cellpadding="0" summary="split dns">
|
582
|
<tr>
|
583
|
<td>
|
584
|
<input name="dns_split" type="text" class="formfld unknown" id="dns_split" size="30" value="<?=htmlspecialchars($pconfig['dns_split']);?>" />
|
585
|
</td>
|
586
|
</tr>
|
587
|
</table>
|
588
|
</td>
|
589
|
</tr>
|
590
|
<tr>
|
591
|
<td width="22%" valign="top" class="vncell"><?=gettext("DNS Servers"); ?></td>
|
592
|
<td width="78%" class="vtable">
|
593
|
<table border="0" cellspacing="2" cellpadding="0" summary="enable dns servers">
|
594
|
<tr>
|
595
|
<td>
|
596
|
<?php set_checked($pconfig['dns_server_enable'],$chk); ?>
|
597
|
<input name="dns_server_enable" type="checkbox" id="dns_server_enable" value="yes" <?=$chk;?> onclick="dns_server_change()" />
|
598
|
</td>
|
599
|
<td>
|
600
|
<?=gettext("Provide a DNS server list to clients"); ?><br />
|
601
|
</td>
|
602
|
</tr>
|
603
|
</table>
|
604
|
<table border="0" cellspacing="2" cellpadding="0" summary="dns servers">
|
605
|
<tr>
|
606
|
<td>
|
607
|
<?=gettext("Server"); ?> #1:
|
608
|
<input name="dns_server1" type="text" class="formfld unknown" id="dns_server1" size="20" value="<?=htmlspecialchars($pconfig['dns_server1']);?>" />
|
609
|
</td>
|
610
|
</tr>
|
611
|
<tr>
|
612
|
<td>
|
613
|
<?=gettext("Server"); ?> #2:
|
614
|
<input name="dns_server2" type="text" class="formfld unknown" id="dns_server2" size="20" value="<?=htmlspecialchars($pconfig['dns_server2']);?>" />
|
615
|
</td>
|
616
|
</tr>
|
617
|
<tr>
|
618
|
<td>
|
619
|
<?=gettext("Server"); ?> #3:
|
620
|
<input name="dns_server3" type="text" class="formfld unknown" id="dns_server3" size="20" value="<?=htmlspecialchars($pconfig['dns_server3']);?>" />
|
621
|
</td>
|
622
|
</tr>
|
623
|
<tr>
|
624
|
<td>
|
625
|
<?=gettext("Server"); ?> #4:
|
626
|
<input name="dns_server4" type="text" class="formfld unknown" id="dns_server4" size="20" value="<?=htmlspecialchars($pconfig['dns_server4']);?>" />
|
627
|
</td>
|
628
|
</tr>
|
629
|
</table>
|
630
|
</td>
|
631
|
</tr>
|
632
|
<tr>
|
633
|
<td width="22%" valign="top" class="vncell"><?=gettext("WINS Servers"); ?></td>
|
634
|
<td width="78%" class="vtable">
|
635
|
<table border="0" cellspacing="2" cellpadding="0" summary="enable wins servers">
|
636
|
<tr>
|
637
|
<td>
|
638
|
<?php set_checked($pconfig['wins_server_enable'],$chk); ?>
|
639
|
<input name="wins_server_enable" type="checkbox" id="wins_server_enable" value="yes" <?=$chk;?> onclick="wins_server_change()" />
|
640
|
</td>
|
641
|
<td>
|
642
|
<?=gettext("Provide a WINS server list to clients"); ?><br />
|
643
|
</td>
|
644
|
</tr>
|
645
|
</table>
|
646
|
<table border="0" cellspacing="2" cellpadding="0" summary="wins servers">
|
647
|
<tr>
|
648
|
<td>
|
649
|
<?=gettext("Server"); ?> #1:
|
650
|
<input name="wins_server1" type="text" class="formfld unknown" id="wins_server1" size="20" value="<?=htmlspecialchars($pconfig['wins_server1']);?>" />
|
651
|
</td>
|
652
|
</tr>
|
653
|
<tr>
|
654
|
<td>
|
655
|
<?=gettext("Server"); ?> #2:
|
656
|
<input name="wins_server2" type="text" class="formfld unknown" id="wins_server2" size="20" value="<?=htmlspecialchars($pconfig['wins_server2']);?>" />
|
657
|
</td>
|
658
|
</tr>
|
659
|
</table>
|
660
|
</td>
|
661
|
</tr>
|
662
|
<tr>
|
663
|
<td width="22%" valign="top" class="vncell"><?=gettext("Phase2 PFS Group"); ?></td>
|
664
|
<td width="78%" class="vtable">
|
665
|
<table border="0" cellspacing="2" cellpadding="0" summary="enable pfs group">
|
666
|
<tr>
|
667
|
<td>
|
668
|
<?php set_checked($pconfig['pfs_group_enable'],$chk); ?>
|
669
|
<input name="pfs_group_enable" type="checkbox" id="pfs_group_enable" value="yes" <?=$chk;?> onclick="pfs_group_change()" />
|
670
|
</td>
|
671
|
<td>
|
672
|
<?=gettext("Provide the Phase2 PFS group to clients ( overrides all mobile phase2 settings )"); ?><br />
|
673
|
</td>
|
674
|
</tr>
|
675
|
</table>
|
676
|
<table border="0" cellspacing="2" cellpadding="0" summary="phase-2 pfs group">
|
677
|
<tr>
|
678
|
<td>
|
679
|
<?=gettext("Group"); ?>:
|
680
|
<select name="pfs_group" class="formselect" id="pfs_group">
|
681
|
<?php foreach ($p2_pfskeygroups as $keygroup => $keygroupname): ?>
|
682
|
<option value="<?=$keygroup;?>" <?php if ($pconfig['pfs_group'] == $keygroup) echo "selected=\"selected\""; ?>>
|
683
|
<?=htmlspecialchars($keygroupname);?>
|
684
|
</option>
|
685
|
<?php endforeach; ?>
|
686
|
</select>
|
687
|
</td>
|
688
|
</tr>
|
689
|
</table>
|
690
|
</td>
|
691
|
</tr>
|
692
|
<tr>
|
693
|
<td width="22%" valign="top" class="vncell"><?=gettext("Login Banner"); ?></td>
|
694
|
<td width="78%" class="vtable">
|
695
|
<table border="0" cellspacing="2" cellpadding="0" summary="enable login banner">
|
696
|
<tr>
|
697
|
<td>
|
698
|
<?php set_checked($pconfig['login_banner_enable'],$chk); ?>
|
699
|
<input name="login_banner_enable" type="checkbox" id="login_banner_enable" value="yes" <?=$chk;?> onclick="login_banner_change()" />
|
700
|
</td>
|
701
|
<td>
|
702
|
<?=gettext("Provide a login banner to clients"); ?><br />
|
703
|
</td>
|
704
|
</tr>
|
705
|
</table>
|
706
|
<table border="0" cellspacing="2" cellpadding="0" summary="banner">
|
707
|
<tr>
|
708
|
<td>
|
709
|
<?php $banner = htmlspecialchars($pconfig['login_banner']); ?>
|
710
|
<textarea name="login_banner" cols="65" rows="7" id="login_banner" class="formpre"><?=htmlspecialchars($banner);?></textarea>
|
711
|
</td>
|
712
|
</tr>
|
713
|
</table>
|
714
|
</td>
|
715
|
</tr>
|
716
|
<tr>
|
717
|
<td width="22%" valign="top"> </td>
|
718
|
<td width="78%">
|
719
|
<input name="submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
|
720
|
</td>
|
721
|
</tr>
|
722
|
</table>
|
723
|
</div>
|
724
|
</td>
|
725
|
</tr>
|
726
|
</table>
|
727
|
</form>
|
728
|
<script type="text/javascript">
|
729
|
//<![CDATA[
|
730
|
pool_change();
|
731
|
dns_domain_change();
|
732
|
dns_split_change();
|
733
|
dns_server_change();
|
734
|
wins_server_change();
|
735
|
pfs_group_change();
|
736
|
login_banner_change();
|
737
|
//]]>
|
738
|
</script>
|
739
|
<?php include("fend.inc"); ?>
|
740
|
</body>
|
741
|
</html>
|
742
|
|
743
|
<?php
|
744
|
|
745
|
/* local utility functions */
|
746
|
|
747
|
function set_checked($var,& $chk) {
|
748
|
if($var)
|
749
|
$chk = "checked=\"checked\"";
|
750
|
else
|
751
|
$chk = "";
|
752
|
}
|
753
|
|
754
|
?>
|