Project

General

Profile

Download (20.6 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/*
3
	vpn_l2tp.php
4
*/
5
/* ====================================================================
6
 *	Copyright (c)  2004-2015  Electric Sheep Fencing, LLC. All rights reserved.
7
 *
8
 *	Redistribution and use in source and binary forms, with or without modification,
9
 *	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
16
 *		the documentation and/or other materials provided with the
17
 *		distribution.
18
 *
19
 *	3. All advertising materials mentioning features or use of this software
20
 *		must display the following acknowledgment:
21
 *		"This product includes software developed by the pfSense Project
22
 *		 for use in the pfSense software distribution. (http://www.pfsense.org/).
23
 *
24
 *	4. The names "pfSense" and "pfSense Project" must not be used to
25
 *		 endorse or promote products derived from this software without
26
 *		 prior written permission. For written permission, please contact
27
 *		 coreteam@pfsense.org.
28
 *
29
 *	5. Products derived from this software may not be called "pfSense"
30
 *		nor may "pfSense" appear in their names without prior written
31
 *		permission of the Electric Sheep Fencing, LLC.
32
 *
33
 *	6. Redistributions of any form whatsoever must retain the following
34
 *		acknowledgment:
35
 *
36
 *	"This product includes software developed by the pfSense Project
37
 *	for use in the pfSense software distribution (http://www.pfsense.org/).
38
 *
39
 *	THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY
40
 *	EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41
 *	IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42
 *	PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR
43
 *	ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44
 *	SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45
 *	NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46
 *	LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47
 *	HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48
 *	STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49
 *	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50
 *	OF THE POSSIBILITY OF SUCH DAMAGE.
51
 *
52
 *	====================================================================
53
 *
54
 */
55

    
56
##|+PRIV
57
##|*IDENT=page-vpn-vpnl2tp
58
##|*NAME=VPN: VPN L2TP page
59
##|*DESCR=Allow access to the 'VPN: VPN L2TP' page.
60
##|*MATCH=vpn_l2tp.php*
61
##|-PRIV
62

    
63
$pgtitle = array(gettext("VPN"), gettext("L2TP"), gettext("L2TP"));
64
$shortcut_section = "l2tps";
65

    
66
require("guiconfig.inc");
67
require_once("vpn.inc");
68

    
69
if (!is_array($config['l2tp']['radius'])) {
70
	$config['l2tp']['radius'] = array();
71
}
72
$l2tpcfg = &$config['l2tp'];
73

    
74
$pconfig['remoteip'] = $l2tpcfg['remoteip'];
75
$pconfig['localip'] = $l2tpcfg['localip'];
76
$pconfig['l2tp_subnet'] = $l2tpcfg['l2tp_subnet'];
77
$pconfig['mode'] = $l2tpcfg['mode'];
78
$pconfig['interface'] = $l2tpcfg['interface'];
79
$pconfig['l2tp_dns1'] = $l2tpcfg['dns1'];
80
$pconfig['l2tp_dns2'] = $l2tpcfg['dns2'];
81
$pconfig['wins'] = $l2tpcfg['wins'];
82
$pconfig['radiusenable'] = isset($l2tpcfg['radius']['enable']);
83
$pconfig['radacct_enable'] = isset($l2tpcfg['radius']['accounting']);
84
$pconfig['radiusserver'] = $l2tpcfg['radius']['server'];
85
$pconfig['radiussecret'] = $l2tpcfg['radius']['secret'];
86
$pconfig['radiusissueips'] = $l2tpcfg['radius']['radiusissueips'];
87
$pconfig['n_l2tp_units'] = $l2tpcfg['n_l2tp_units'];
88
$pconfig['paporchap'] = $l2tpcfg['paporchap'];
89
$pconfig['secret'] = $l2tpcfg['secret'];
90

    
91
if ($_POST) {
92

    
93
	unset($input_errors);
94
	$pconfig = $_POST;
95

    
96
	/* input validation */
97
	if ($_POST['mode'] == "server") {
98
		$reqdfields = explode(" ", "localip remoteip");
99
		$reqdfieldsn = array(gettext("Server address"), gettext("Remote start address"));
100

    
101
		if ($_POST['radiusenable']) {
102
			$reqdfields = array_merge($reqdfields, explode(" ", "radiusserver radiussecret"));
103
			$reqdfieldsn = array_merge($reqdfieldsn,
104
				array(gettext("RADIUS server address"), gettext("RADIUS shared secret")));
105
		}
106

    
107
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
108

    
109
		if (($_POST['localip'] && !is_ipaddr($_POST['localip']))) {
110
			$input_errors[] = gettext("A valid server address must be specified.");
111
		}
112
		if (is_ipaddr_configured($_POST['localip'])) {
113
			$input_errors[] = gettext("'Server address' parameter should NOT be set to any IP address currently in use on this firewall.");
114
		}
115
		if (($_POST['l2tp_subnet'] && !is_ipaddr($_POST['remoteip']))) {
116
			$input_errors[] = gettext("A valid remote start address must be specified.");
117
		}
118
		if (($_POST['radiusserver'] && !is_ipaddr($_POST['radiusserver']))) {
119
			$input_errors[] = gettext("A valid RADIUS server address must be specified.");
120
		}
121

    
122
		/* if this is an AJAX caller then handle via JSON */
123
		if (isAjax() && is_array($input_errors)) {
124
			input_errors2Ajax($input_errors);
125
			exit;
126
		}
127

    
128
		if (!$input_errors) {
129
			$_POST['remoteip'] = $pconfig['remoteip'] = gen_subnet($_POST['remoteip'], $_POST['l2tp_subnet']);
130
			$subnet_start = ip2ulong($_POST['remoteip']);
131
			$subnet_end = ip2ulong($_POST['remoteip']) + $_POST['n_l2tp_units'] - 1;
132

    
133
			if ((ip2ulong($_POST['localip']) >= $subnet_start) &&
134
				(ip2ulong($_POST['localip']) <= $subnet_end)) {
135
				$input_errors[] = gettext("The specified server address lies in the remote subnet.");
136
			}
137
			if ($_POST['localip'] == get_interface_ip("lan")) {
138
				$input_errors[] = gettext("The specified server address is equal to the LAN interface address.");
139
			}
140
		}
141
	}
142

    
143
	/* if this is an AJAX caller then handle via JSON */
144
	if (isAjax() && is_array($input_errors)) {
145
		input_errors2Ajax($input_errors);
146
		exit;
147
	}
148

    
149
	if (!$input_errors) {
150
		$l2tpcfg['remoteip'] = $_POST['remoteip'];
151
		$l2tpcfg['localip'] = $_POST['localip'];
152
		$l2tpcfg['l2tp_subnet'] = $_POST['l2tp_subnet'];
153
		$l2tpcfg['mode'] = $_POST['mode'];
154
		$l2tpcfg['interface'] = $_POST['interface'];
155
		$l2tpcfg['n_l2tp_units'] = $_POST['n_l2tp_units'];
156

    
157
		$l2tpcfg['radius']['server'] = $_POST['radiusserver'];
158
		$l2tpcfg['radius']['secret'] = $_POST['radiussecret'];
159
		$l2tpcfg['secret'] = $_POST['secret'];
160

    
161
		if ($_POST['wins']) {
162
			$l2tpcfg['wins'] = $_POST['wins'];
163
		} else {
164
			unset($l2tpcfg['wins']);
165
		}
166

    
167
		$l2tpcfg['paporchap'] = $_POST['paporchap'];
168

    
169

    
170
		if ($_POST['l2tp_dns1'] == "") {
171
			if (isset($l2tpcfg['dns1'])) {
172
				unset($l2tpcfg['dns1']);
173
			}
174
		} else {
175
			$l2tpcfg['dns1'] = $_POST['l2tp_dns1'];
176
		}
177

    
178
		if ($_POST['l2tp_dns2'] == "") {
179
			if (isset($l2tpcfg['dns2'])) {
180
				unset($l2tpcfg['dns2']);
181
			}
182
		} else {
183
			$l2tpcfg['dns2'] = $_POST['l2tp_dns2'];
184
		}
185

    
186
		if ($_POST['radiusenable'] == "yes") {
187
			$l2tpcfg['radius']['enable'] = true;
188
		} else {
189
			unset($l2tpcfg['radius']['enable']);
190
		}
191

    
192
		if ($_POST['radacct_enable'] == "yes") {
193
			$l2tpcfg['radius']['accounting'] = true;
194
		} else {
195
			unset($l2tpcfg['radius']['accounting']);
196
		}
197

    
198
		if ($_POST['radiusissueips'] == "yes") {
199
			$l2tpcfg['radius']['radiusissueips'] = true;
200
		} else {
201
			unset($l2tpcfg['radius']['radiusissueips']);
202
		}
203

    
204
		write_config();
205

    
206
		$retval = 0;
207
		$retval = vpn_l2tp_configure();
208
		$savemsg = get_std_save_message($retval);
209

    
210
		/* if ajax is calling, give them an update message */
211
		if (isAjax()) {
212
			print_info_box_np($savemsg);
213
		}
214
	}
215
}
216

    
217
include("head.inc");
218
?>
219

    
220
<script type="text/javascript">
221
//<![CDATA[
222
function get_radio_value(obj) {
223
	for (i = 0; i < obj.length; i++) {
224
		if (obj[i].checked) {
225
			return obj[i].value;
226
		}
227
	}
228
	return null;
229
}
230

    
231
function enable_change(enable_over) {
232
	if ((get_radio_value(document.iform.mode) == "server") || enable_over) {
233
		document.iform.remoteip.disabled = 0;
234
		document.iform.localip.disabled = 0;
235
		document.iform.l2tp_subnet.disabled = 0;
236
		document.iform.radiusenable.disabled = 0;
237
		document.iform.radiusissueips.disabled = 0;
238
		document.iform.paporchap.disabled = 0;
239
		document.iform.interface.disabled = 0;
240
		document.iform.n_l2tp_units.disabled = 0;
241
		document.iform.secret.disabled = 0;
242
		document.iform.l2tp_dns1.disabled = 0;
243
		document.iform.l2tp_dns2.disabled = 0;
244
		/* fix colors */
245
		document.iform.remoteip.style.backgroundColor = '#FFFFFF';
246
		document.iform.localip.style.backgroundColor = '#FFFFFF';
247
		document.iform.l2tp_subnet.style.backgroundColor = '#FFFFFF';
248
		document.iform.radiusenable.style.backgroundColor = '#FFFFFF';
249
		document.iform.radiusissueips.style.backgroundColor = '#FFFFFF';
250
		document.iform.paporchap.style.backgroundColor = '#FFFFFF';
251
		document.iform.interface.style.backgroundColor = '#FFFFFF';
252
		document.iform.n_l2tp_units.style.backgroundColor = '#FFFFFF';
253
		document.iform.secret.style.backgroundColor = '#FFFFFF';
254
		if (document.iform.radiusenable.checked || enable_over) {
255
			document.iform.radacct_enable.disabled = 0;
256
			document.iform.radiusserver.disabled = 0;
257
			document.iform.radiussecret.disabled = 0;
258
			document.iform.radiusissueips.disabled = 0;
259
			/* fix colors */
260
			document.iform.radacct_enable.style.backgroundColor = '#FFFFFF';
261
			document.iform.radiusserver.style.backgroundColor = '#FFFFFF';
262
			document.iform.radiussecret.style.backgroundColor = '#FFFFFF';
263
			document.iform.radiusissueips.style.backgroundColor = '#FFFFFF';
264
		} else {
265
			document.iform.radacct_enable.disabled = 1;
266
			document.iform.radiusserver.disabled = 1;
267
			document.iform.radiussecret.disabled = 1;
268
			document.iform.radiusissueips.disabled = 1;
269
			/* fix colors */
270
			document.iform.radacct_enable.style.backgroundColor = '#D4D0C8';
271
			document.iform.radiusserver.style.backgroundColor = '#D4D0C8';
272
			document.iform.radiussecret.style.backgroundColor = '#D4D0C8';
273
			document.iform.radiusissueips.style.backgroundColor = '#D4D0C8';
274
		}
275
	} else {
276
		document.iform.interface.disabled = 1;
277
		document.iform.n_l2tp_units.disabled = 1;
278
		document.iform.l2tp_subnet.disabled = 1;
279
		document.iform.l2tp_dns1.disabled = 1;
280
		document.iform.l2tp_dns2.disabled = 1;
281
		document.iform.paporchap.disabled = 1;
282
		document.iform.remoteip.disabled = 1;
283
		document.iform.localip.disabled = 1;
284
		document.iform.radiusenable.disabled = 1;
285
		document.iform.radacct_enable.disabled = 1;
286
		document.iform.radiusserver.disabled = 1;
287
		document.iform.radiussecret.disabled = 1;
288
		document.iform.radiusissueips.disabled = 1;
289
		document.iform.secret.disabled = 1;
290
		/* fix colors */
291
		document.iform.interface.style.backgroundColor = '#D4D0C8';
292
		document.iform.n_l2tp_units.style.backgroundColor = '#D4D0C8';
293
		document.iform.l2tp_subnet.style.backgroundColor = '#D4D0C8';
294
		document.iform.paporchap.style.backgroundColor = '#D4D0C8';
295
		document.iform.remoteip.style.backgroundColor = '#D4D0C8';
296
		document.iform.localip.style.backgroundColor = '#D4D0C8';
297
		document.iform.radiusenable.style.backgroundColor = '#D4D0C8';
298
		document.iform.radacct_enable.style.backgroundColor = '#D4D0C8';
299
		document.iform.radiusserver.style.backgroundColor = '#D4D0C8';
300
		document.iform.radiussecret.style.backgroundColor = '#D4D0C8';
301
		document.iform.radiusissueips.style.backgroundColor = '#D4D0C8';
302
		document.iform.secret.style.backgroundColor = '#D4D0C8';
303
	}
304
}
305
//]]>
306
</script>
307

    
308
<form class="form-horizontal" action="vpn_l2tp.php" method="post" name="iform" id="iform">
309
<?php if ($input_errors) print_input_errors($input_errors)?>
310
<?php if ($savemsg) print_info_box($savemsg)?>
311

    
312
<?php
313
$tab_array = array();
314
$tab_array[0] = array(gettext("Configuration"), true, "vpn_l2tp.php");
315
$tab_array[1] = array(gettext("Users"), false, "vpn_l2tp_users.php");
316
display_top_tabs($tab_array);
317
?>
318

    
319
	<div class="panel panel-default">
320
		<div class="panel-heading">
321
			<h2 class="panel-title"><?=gettext('Enable L2TP'); ?></h2>
322
		</div>
323

    
324
		<div class="panel-body">
325
			<div class="form-group">
326
				<div class="col-sm-10">
327
					<label>
328
						<input name="mode" type="radio" onclick="enable_change(false)" value="off" <?php if (($pconfig['mode'] != "server") && ($pconfig['mode'] != "redir")) echo "checked=\"checked\""?> />
329
						<?=gettext("Off")?>
330
					</label>
331
					<label>
332
						<input type="radio" name="mode" value="server" onclick="enable_change(false)" <?php if ($pconfig['mode'] == "server") echo "checked=\"checked\""?> />
333
						<?=gettext("Enable L2TP server")?>
334
					</label>
335
				</div>
336
			</div>
337
		</div>
338
	</div>
339

    
340
	<div class="panel panel-default">
341
		<div class="panel-heading">
342
			<h2 class="panel-title"><?=gettext('Configuration'); ?></h2>
343
		</div>
344

    
345
		<div class="panel-body">
346
			<div class="form-group">
347
				<label for="interface" class="col-sm-2 control-label"><?=gettext("Interface")?></label>
348
				<div class="col-sm-2">
349
					<select class="form-control" name="interface" class="formselect" id="interface">
350
<?php
351
$interfaces = get_configured_interface_with_descr();
352
foreach ($interfaces as $iface => $ifacename): ?>
353
						<option value="<?=$iface?>" <?php if ($iface == $pconfig['interface']) echo "selected=\"selected\""?>>
354
							<?=htmlspecialchars($ifacename)?>
355
						</option>
356
<?php endforeach?>
357
					</select>
358
				</div>
359
			</div>
360
			<div class="form-group">
361
				<label for="localip" class="col-sm-2 control-label"><?=gettext("Server Address")?></label>
362
				<div class="col-sm-10">
363
					<?=$mandfldhtml?><input name="localip" type="text" class="form-control formfld unknown" id="localip" size="20" value="<?=htmlspecialchars($pconfig['localip'])?>" />
364

    
365
					<span class="help-block">
366
						<?=gettext("Enter the IP address the L2TP server should give to clients for use as their \"gateway\"")?>.
367
						<br />
368
						<?=gettext("Typically this is set to an unused IP just outside of the client range")?>.
369
						<br />
370
						<br />
371
						<?=gettext("NOTE: This should NOT be set to any IP address currently in use on this firewall")?>.
372
					</span>
373
				</div>
374
			</div>
375

    
376
			<div class="form-group">
377
				<label for="remoteip" class="col-sm-2 control-label"><?=gettext("Remote Address Range")?></label>
378
				<div class="col-sm-10">
379
					<?=$mandfldhtml?><input name="remoteip" type="text" class="form-control formfld unknown" id="remoteip" size="20" value="<?=htmlspecialchars($pconfig['remoteip'])?>" />
380
					<span class="help-block">
381
						<?=gettext("Specify the starting address for the client IP address subnet.")?>
382
					</span>
383
				</div>
384
			</div>
385

    
386
			<div class="form-group">
387
				<label for="l2tp_subnet" class="col-sm-2 control-label"><?=gettext("Subnet Mask")?></label>
388
				<div class="col-sm-2">
389
					<select id="l2tp_subnet" name="l2tp_subnet" class="form-control">
390
<?php
391
					for($x=0; $x<33; $x++) {
392
						if($x == $pconfig['l2tp_subnet'])
393
								$SELECTED = " selected=\"selected\"";
394
						else
395
								$SELECTED = "";
396
						echo "<option value=\"{$x}\"{$SELECTED}>{$x}</option>\n";
397
					}
398
?>
399
					</select>
400
					<span class="help-block">
401
						<?=gettext("Hint:")?> 24 <?=gettext("is")?> 255.255.255.0
402
					</span>
403
				</div>
404
			</div>
405

    
406
			<div class="form-group">
407
				<label for="n_l2tp_units" class="col-sm-2 control-label"><?=gettext("Number of L2TP users")?></label>
408
				<div class="col-sm-2">
409
					<select id="n_l2tp_units" name="n_l2tp_units" class="form-control">
410
<?php
411
					for($x=0; $x<255; $x++) {
412
						if($x == $pconfig['n_l2tp_units'])
413
								$SELECTED = " selected=\"selected\"";
414
						else
415
								$SELECTED = "";
416
						echo "<option value=\"{$x}\"{$SELECTED}>{$x}</option>\n";
417
					}
418
?>
419
					</select>
420
					<span class="help-block">
421
						<?=gettext("Hint:")?> 10 <?=gettext("is ten L2TP clients")?>
422
					</span>
423
				</div>
424
			</div>
425

    
426
			<div class="form-group">
427
				<label for="secret" class="col-sm-2 control-label"><?=gettext("Secret")?></label>
428
				<div class="col-sm-10">
429
					<input type="password" name="secret" id="secret" class="formfld pwd form-control" value="<?=htmlspecialchars($pconfig['secret'])?>" />
430
					<span class="help-block">
431
						<?=gettext("Specify optional secret shared between peers. Required on some devices/setups.")?>
432
					</span>
433
				</div>
434
			</div>
435

    
436
			<div class="form-group">
437
				<label for="paporchap" class="col-sm-2 control-label"><?=gettext("Authentication Type")?></label>
438
				<div class="col-sm-2">
439
					<?=$mandfldhtml?><select name="paporchap" id="paporchap" class="form-control">
440
						<option value='chap'<?php if($pconfig['paporchap'] == "chap") echo " selected=\"selected\""?>><?=gettext("CHAP")?></option>
441
						<option value='chap-msv2'<?php if ($pconfig['paporchap'] == "chap-msv2") echo " selected=\"selected\""?>><?=gettext("MS-CHAPv2")?></option>
442
						<option value='pap'<?php if($pconfig['paporchap'] == "pap") echo " selected=\"selected\""?>><?=gettext("PAP")?></option>
443
					</select>
444
					<span class="help-block">
445
						<?=gettext("Specifies which protocol to use for authentication.")?>
446
					</span>
447
				</div>
448
			</div>
449

    
450
			<div class="form-group">
451
				<label for="l2tp_dns1" class="col-sm-2 control-label"><?=gettext("L2TP DNS Servers")?></label>
452
				<div class="col-sm-10">
453
					<?=$mandfldhtml?><input name="l2tp_dns1" type="text" class="formfld unknown form-control" id="l2tp_dns1" size="20" value="<?=htmlspecialchars($pconfig['l2tp_dns1'])?>" />
454
					<input name="l2tp_dns2" type="text" class="formfld unknown form-control" id="l2tp_dns2" size="20" value="<?=htmlspecialchars($pconfig['l2tp_dns2'])?>" />
455
					<span class="help-block">
456
						<?=gettext("primary and secondary DNS servers assigned to L2TP clients")?>
457
					</span>
458
				</div>
459
			</div>
460

    
461
			<div class="form-group">
462
				<label for="wins" class="col-sm-2 control-label"><?=gettext("WINS Server")?></label>
463
				<div class="col-sm-10">
464
					<input name="wins" class="formfld unknown form-control" id="wins" size="20" value="<?=htmlspecialchars($pconfig['wins'])?>" />
465
			</div>
466
			</div>
467
		</div>
468
	</div>
469

    
470
	<div class="panel panel-default">
471
		<div class="panel-heading">
472
			<h2 class="panel-title"><?=gettext('RADIUS'); ?></h2>
473
		</div>
474

    
475
		<div class="panel-body">
476
			<div class="form-group">
477
				<label for="radiusenable" class="col-sm-2 control-label"><?=gettext('RADIUS Authentication')?></label>
478
				<div class="col-sm-10 checkbox">
479
					<label>
480
						<input name="radiusenable" type="checkbox" id="radiusenable" onclick="enable_change(false)" value="yes" <?php if ($pconfig['radiusenable']) echo "checked=\"checked\""?> />
481
						<?=gettext("Use a RADIUS server for authentication")?>
482
					</label>
483
					<span class="help-block">
484
						<?=gettext("When set, all users will be authenticated using the RADIUS server specified below. The local user database will not be used.")?>
485
					</span>
486
				</div>
487
			</div>
488
			<div class="form-group">
489
				<label for="radacct_enable" class="col-sm-2 control-label"><?=gettext('RADIUS Accounting')?></label>
490
				<div class="col-sm-10 checkbox">
491
					<label>
492
						<input name="radacct_enable" type="checkbox" id="radacct_enable" onclick="enable_change(false)" value="yes" <?php if ($pconfig['radacct_enable']) echo "checked=\"checked\""?> />
493
						<?=gettext("Enable RADIUS accounting")?>
494
					</label>
495
					<span class="help-block">
496
						<?=gettext("Sends accounting packets to the RADIUS server.")?>
497
					</span>
498
				</div>
499
			</div>
500

    
501
			<div class="form-group">
502
				<label for="radiusserver" class="col-sm-2 control-label"><?=gettext("RADIUS Server")?></label>
503
				<div class="col-sm-10">
504
					<input name="radiusserver" type="text" class="formfld unknown form-control" id="radiusserver" size="20" value="<?=htmlspecialchars($pconfig['radiusserver'])?>" />
505
					<span class="help-block">
506
						<?=gettext("Enter the IP address of the RADIUS server.")?>
507
					</span>
508
				</div>
509
			</div>
510
			<div class="form-group">
511
				<label for="radiussecret" class="col-sm-2 control-label"><?=gettext("RADIUS Shared Secret")?></label>
512
				<div class="col-sm-10">
513
					<input name="radiussecret" type="password" class="formfld pwd form-control" id="radiussecret" size="20" value="<?=htmlspecialchars($pconfig['radiussecret'])?>" />
514
					<span class="help-block">
515
						<?=gettext("Enter the shared secret that will be used to authenticate to the RADIUS server.")?>
516
					</span>
517
				</div>
518
			</div>
519

    
520
			<div class="form-group">
521
				<label for="radiusissueips" class="col-sm-2 control-label"><?=gettext("RADIUS Issued IPs")?></label>
522
				<div class="col-sm-10 checkbox">
523
					<label>
524
						<input name="radiusissueips" value="yes" type="checkbox" class="formfld" id="radiusissueips"<?php if(isset($pconfig['radiusissueips'])) echo " checked=\"checked\""?> />
525
						<?=gettext("Issue IP Addresses via RADIUS server.")?>
526
					</label>
527
				</div>
528
			</div>
529
		</div>
530
	</div>
531

    
532
<?php
533
	// TODO: Is it possible to detect available rules and only show warning if there are no (relevant) rules set?
534
?>
535
	<div class="alert alert-danger">
536
		<strong><?=gettext("Note:")?></strong> <?=gettext("Don't forget to add a firewall rule to permit traffic from L2TP clients!")?>
537
	</div>
538

    
539
	<div class="col-sm-10 col-sm-offset-2">
540
		<input id="submit" name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save")?>" onclick="enable_change(true)" />
541
	</div>
542
</form>
543

    
544
<script type="text/javascript">
545
//<![CDATA[
546
	enable_change(false);
547
//]]>
548
</script>
549

    
550
<?php include("foot.inc")?>
(224-224/233)