Project

General

Profile

Download (59.3 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/*
3
	services_captiveportal.php
4
	part of m0n0wall (http://m0n0.ch/wall)
5

    
6
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
7
	Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
8
	All rights reserved.
9

    
10
	Redistribution and use in source and binary forms, with or without
11
	modification, are permitted provided that the following conditions are met:
12

    
13
	1. Redistributions of source code must retain the above copyright notice,
14
	   this list of conditions and the following disclaimer.
15

    
16
	2. Redistributions in binary form must reproduce the above copyright
17
	   notice, this list of conditions and the following disclaimer in the
18
	   documentation and/or other materials provided with the distribution.
19

    
20
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
21
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
24
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
	POSSIBILITY OF SUCH DAMAGE.
30
*/
31
/*
32
	pfSense_MODULE:	captiveportal
33
*/
34

    
35
##|+PRIV
36
##|*IDENT=page-services-captiveportal
37
##|*NAME=Services: Captive portal page
38
##|*DESCR=Allow access to the 'Services: Captive portal' page.
39
##|*MATCH=services_captiveportal.php*
40
##|-PRIV
41

    
42
require_once("functions.inc");
43
require_once("filter.inc");
44
require_once("shaper.inc");
45
require_once("captiveportal.inc");
46

    
47
if (substr($_GET['act'], 0, 3) == "get")
48
	$nocsrf = true;
49

    
50
require_once("guiconfig.inc");
51

    
52
global $cpzone;
53
global $cpzoneid;
54

    
55
$cpzoneid = 1; /* Just a default */
56
$cpzone = $_GET['zone'];
57
if (isset($_POST['zone']))
58
	$cpzone = $_POST['zone'];
59

    
60
if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) {
61
	header("Location: services_captiveportal_zones.php");
62
	exit;
63
}
64

    
65
if (!is_array($config['captiveportal']))
66
	$config['captiveportal'] = array();
67
$a_cp =& $config['captiveportal'];
68

    
69
$pgtitle = array(gettext("Services"),gettext("Captive portal"), $a_cp[$cpzone]['zone']);
70
$shortcut_section = "captiveportal";
71

    
72
if ($_GET['act'] == "viewhtml") {
73
	if ($a_cp[$cpzone] && $a_cp[$cpzone]['page']['htmltext'])
74
		echo base64_decode($a_cp[$cpzone]['page']['htmltext']);
75
	exit;
76
} else if ($_GET['act'] == "gethtmlhtml" && $a_cp[$cpzone] && $a_cp[$cpzone]['page']['htmltext']) {
77
	$file_data = base64_decode($a_cp[$cpzone]['page']['htmltext']);
78
	$file_size = strlen($file_data);
79

    
80
	header("Content-Type: text/html");
81
	header("Content-Disposition: attachment; filename=portal.html");
82
	header("Content-Length: $file_size");
83
	echo $file_data;
84

    
85
	exit;
86
} else if ($_GET['act'] == "delhtmlhtml" && $a_cp[$cpzone] && $a_cp[$cpzone]['page']['htmltext']) {
87
	unset($a_cp[$cpzone]['page']['htmltext']);
88
	write_config(sprintf(gettext("Captive Portal: zone %s: Restore default portal page"), $cpzone));
89
	header("Location: services_captiveportal.php?zone={$cpzone}");
90
	exit;
91
} else if ($_GET['act'] == "viewerrhtml") {
92
	if ($a_cp[$cpzone] && $a_cp[$cpzone]['page']['errtext'])
93
		echo base64_decode($a_cp[$cpzone]['page']['errtext']);
94
	exit;
95
} else if ($_GET['act'] == "geterrhtml" && $a_cp[$cpzone] && $a_cp[$cpzone]['page']['errtext']) {
96
	$file_data = base64_decode($a_cp[$cpzone]['page']['errtext']);
97
	$file_size = strlen($file_data);
98

    
99
	header("Content-Type: text/html");
100
	header("Content-Disposition: attachment; filename=err.html");
101
	header("Content-Length: $file_size");
102
	echo $file_data;
103

    
104
	exit;
105
} else if ($_GET['act'] == "delerrhtml" && $a_cp[$cpzone] && $a_cp[$cpzone]['page']['errtext']) {
106
	unset($a_cp[$cpzone]['page']['errtext']);
107
	write_config(sprintf(gettext("Captive Portal: zone %s: Restore default error page"), $cpzone));
108
	header("Location: services_captiveportal.php?zone={$cpzone}");
109
	exit;
110
} else if ($_GET['act'] == "viewlogouthtml") {
111
	if ($a_cp[$cpzone] && $a_cp[$cpzone]['page']['logouttext'])
112
		echo base64_decode($a_cp[$cpzone]['page']['logouttext']);
113
	exit;
114
} else if ($_GET['act'] == "getlogouthtml" && $a_cp[$cpzone] && $a_cp[$cpzone]['page']['logouttext']) {
115
	$file_data = base64_decode($a_cp[$cpzone]['page']['logouttext']);
116
	$file_size = strlen($file_data);
117

    
118
	header("Content-Type: text/html");
119
	header("Content-Disposition: attachment; filename=logout.html");
120
	header("Content-Length: $file_size");
121
	echo $file_data;
122

    
123
	exit;
124
} else if ($_GET['act'] == "dellogouthtml" && $a_cp[$cpzone] && $a_cp[$cpzone]['page']['logouttext']) {
125
	unset($a_cp[$cpzone]['page']['logouttext']);
126
	write_config(sprintf(gettext("Captive Portal: zone %s: Restore default logout page"), $cpzone));
127
	header("Location: services_captiveportal.php?zone={$cpzone}");
128
	exit;
129
}
130

    
131
if (!is_array($config['ca']))
132
	$config['ca'] = array();
133

    
134
$a_ca =& $config['ca'];
135

    
136
if (!is_array($config['cert']))
137
	$config['cert'] = array();
138

    
139
$a_cert =& $config['cert'];
140

    
141
if ($a_cp[$cpzone]) {
142
	$cpzoneid = $pconfig['zoneid'] = $a_cp[$cpzone]['zoneid'];
143
	$pconfig['cinterface'] = $a_cp[$cpzone]['interface'];
144
	$pconfig['maxproc'] = $a_cp[$cpzone]['maxproc'];
145
	$pconfig['maxprocperip'] = $a_cp[$cpzone]['maxprocperip'];
146
	$pconfig['timeout'] = $a_cp[$cpzone]['timeout'];
147
	$pconfig['idletimeout'] = $a_cp[$cpzone]['idletimeout'];
148
	$pconfig['freelogins_count'] = $a_cp[$cpzone]['freelogins_count'];
149
	$pconfig['freelogins_resettimeout'] = $a_cp[$cpzone]['freelogins_resettimeout'];
150
	$pconfig['freelogins_updatetimeouts'] = isset($a_cp[$cpzone]['freelogins_updatetimeouts']);
151
	$pconfig['enable'] = isset($a_cp[$cpzone]['enable']);
152
	$pconfig['auth_method'] = $a_cp[$cpzone]['auth_method'];
153
	$pconfig['localauth_priv'] = isset($a_cp[$cpzone]['localauth_priv']);
154
	$pconfig['radacct_enable'] = isset($a_cp[$cpzone]['radacct_enable']);
155
	$pconfig['radmac_enable'] = isset($a_cp[$cpzone]['radmac_enable']);
156
	$pconfig['radmac_secret'] = $a_cp[$cpzone]['radmac_secret'];
157
	$pconfig['reauthenticate'] = isset($a_cp[$cpzone]['reauthenticate']);
158
	$pconfig['reauthenticateacct'] = $a_cp[$cpzone]['reauthenticateacct'];
159
	$pconfig['httpslogin_enable'] = isset($a_cp[$cpzone]['httpslogin']);
160
	$pconfig['httpsname'] = $a_cp[$cpzone]['httpsname'];
161
	$pconfig['preauthurl'] = strtolower($a_cp[$cpzone]['preauthurl']);
162
	$pconfig['blockedmacsurl'] = strtolower($a_cp[$cpzone]['blockedmacsurl']);
163
	$pconfig['certref'] = $a_cp[$cpzone]['certref'];
164
	$pconfig['nohttpsforwards'] = isset($a_cp[$cpzone]['nohttpsforwards']);
165
	$pconfig['logoutwin_enable'] = isset($a_cp[$cpzone]['logoutwin_enable']);
166
	$pconfig['peruserbw'] = isset($a_cp[$cpzone]['peruserbw']);
167
	$pconfig['bwdefaultdn'] = $a_cp[$cpzone]['bwdefaultdn'];
168
	$pconfig['bwdefaultup'] = $a_cp[$cpzone]['bwdefaultup'];
169
	$pconfig['nomacfilter'] = isset($a_cp[$cpzone]['nomacfilter']);
170
	$pconfig['noconcurrentlogins'] = isset($a_cp[$cpzone]['noconcurrentlogins']);
171
	$pconfig['radius_protocol'] = $a_cp[$cpzone]['radius_protocol'];
172
	$pconfig['redirurl'] = $a_cp[$cpzone]['redirurl'];
173
	$pconfig['radiusip'] = $a_cp[$cpzone]['radiusip'];
174
	$pconfig['radiusip2'] = $a_cp[$cpzone]['radiusip2'];
175
	$pconfig['radiusip3'] = $a_cp[$cpzone]['radiusip3'];
176
	$pconfig['radiusip4'] = $a_cp[$cpzone]['radiusip4'];
177
	$pconfig['radiusport'] = $a_cp[$cpzone]['radiusport'];
178
	$pconfig['radiusport2'] = $a_cp[$cpzone]['radiusport2'];
179
	$pconfig['radiusport3'] = $a_cp[$cpzone]['radiusport3'];
180
	$pconfig['radiusport4'] = $a_cp[$cpzone]['radiusport4'];
181
	$pconfig['radiusacctport'] = $a_cp[$cpzone]['radiusacctport'];
182
	$pconfig['radiuskey'] = $a_cp[$cpzone]['radiuskey'];
183
	$pconfig['radiuskey2'] = $a_cp[$cpzone]['radiuskey2'];
184
	$pconfig['radiuskey3'] = $a_cp[$cpzone]['radiuskey3'];
185
	$pconfig['radiuskey4'] = $a_cp[$cpzone]['radiuskey4'];
186
	$pconfig['radiusvendor'] = $a_cp[$cpzone]['radiusvendor'];
187
	$pconfig['radiussession_timeout'] = isset($a_cp[$cpzone]['radiussession_timeout']);
188
	$pconfig['radiussrcip_attribute'] = $a_cp[$cpzone]['radiussrcip_attribute'];
189
	$pconfig['passthrumacadd'] = isset($a_cp[$cpzone]['passthrumacadd']);
190
	$pconfig['passthrumacaddusername'] = isset($a_cp[$cpzone]['passthrumacaddusername']);
191
	$pconfig['radmac_format'] = $a_cp[$cpzone]['radmac_format'];
192
	$pconfig['reverseacct'] = isset($a_cp[$cpzone]['reverseacct']);
193
	$pconfig['radiusnasid'] = $a_cp[$cpzone]['radiusnasid'];
194
	$pconfig['page'] = array();
195
	if ($a_cp[$cpzone]['page']['htmltext'])
196
		$pconfig['page']['htmltext'] = $a_cp[$cpzone]['page']['htmltext'];
197
	if ($a_cp[$cpzone]['page']['errtext'])
198
		$pconfig['page']['errtext'] = $a_cp[$cpzone]['page']['errtext'];
199
	if ($a_cp[$cpzone]['page']['logouttext'])
200
		$pconfig['page']['logouttext'] = $a_cp[$cpzone]['page']['logouttext'];
201
}
202

    
203
if ($_POST) {
204

    
205
	unset($input_errors);
206
	$pconfig = $_POST;
207

    
208
	/* input validation */
209
	if ($_POST['enable']) {
210
		$reqdfields = explode(" ", "zone cinterface");
211
		$reqdfieldsn = array(gettext("Zone name"), gettext("Interface"));
212

    
213
		if (isset($_POST['auth_method']) && $_POST['auth_method'] == "radius") {
214
			$reqdfields[] = "radius_protocol";
215
			$reqdfieldsn[] = gettext("RADIUS Protocol");
216
			$reqdfields[] = "radiusip";
217
			$reqdfieldsn[] = gettext("Primary RADIUS server IP address");
218
		}
219

    
220
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
221

    
222
		/* make sure no interfaces are bridged or used on other zones */
223
		if (is_array($_POST['cinterface'])) {
224
			foreach ($pconfig['cinterface'] as $cpbrif) {
225
				if (link_interface_to_bridge($cpbrif))
226
					$input_errors[] = sprintf(gettext("The captive portal cannot be used on interface %s since it is part of a bridge."), $cpbrif);
227
				foreach ($a_cp as $cpkey => $cp) {
228
					if ($cpkey != $cpzone || empty($cpzone)) {
229
						if (in_array($cpbrif, explode(",", $cp['interface'])))
230
							$input_errors[] = sprintf(gettext("The captive portal cannot be used on interface %s since it is used already on %s instance."), $cpbrif, $cp['zone']);
231
					}
232
				}
233
			}
234
		}
235

    
236
		if ($_POST['httpslogin_enable']) {
237
			if (!$_POST['certref']) {
238
				$input_errors[] = gettext("Certificate must be specified for HTTPS login.");
239
			}
240
			if (!$_POST['httpsname'] || !is_domain($_POST['httpsname'])) {
241
				$input_errors[] = gettext("The HTTPS server name must be specified for HTTPS login.");
242
			}
243
		}
244
	}
245

    
246
	if ($_POST['timeout']) {
247
		if (!is_numeric($_POST['timeout']) || ($_POST['timeout'] < 1))
248
			$input_errors[] = gettext("The timeout must be at least 1 minute.");
249
		else if (isset($config['dhcpd']) && is_array($config['dhcpd'])) {
250
			foreach ($config['dhcpd'] as $dhcpd_if => $dhcpd_data) {
251
				if (!isset($dhcpd_data['enable']))
252
					continue;
253
				if (!is_array($_POST['cinterface']) || !in_array($dhcpd_if, $_POST['cinterface']))
254
					continue;
255

    
256
				$deftime = 7200; // Default lease time
257
				if (isset($dhcpd_data['defaultleasetime']) && is_numeric($dhcpd_data['defaultleasetime']))
258
					$deftime = $dhcpd_data['defaultleasetime'];
259

    
260
				if ($_POST['timeout'] > $deftime)
261
					$input_errors[] = gettext("Hard timeout must be less or equal Default lease time set on DHCP Server");
262
			}
263
		}
264
	}
265
	if ($_POST['idletimeout'] && (!is_numeric($_POST['idletimeout']) || ($_POST['idletimeout'] < 1))) {
266
		$input_errors[] = gettext("The idle timeout must be at least 1 minute.");
267
	}
268
	if ($_POST['freelogins_count'] && (!is_numeric($_POST['freelogins_count']))) {
269
		$input_errors[] = gettext("The pass-through credit count must be a number or left blank.");
270
	} else if ($_POST['freelogins_count'] && is_numeric($_POST['freelogins_count']) && ($_POST['freelogins_count'] >= 1)) {
271
		if (empty($_POST['freelogins_resettimeout']) || !is_numeric($_POST['freelogins_resettimeout']) || ($_POST['freelogins_resettimeout'] <= 0)) {
272
			$input_errors[] = gettext("The waiting period to restore pass-through credits must be above 0 hours.");
273
		}
274
	}
275
	if (($_POST['radiusip'] && !is_ipaddr($_POST['radiusip']))) {
276
		$input_errors[] = sprintf(gettext("A valid IP address must be specified. [%s]"), $_POST['radiusip']);
277
	}
278
	if (($_POST['radiusip2'] && !is_ipaddr($_POST['radiusip2']))) {
279
		$input_errors[] = sprintf(gettext("A valid IP address must be specified. [%s]"), $_POST['radiusip2']);
280
	}
281
	if (($_POST['radiusip3'] && !is_ipaddr($_POST['radiusip3']))) {
282
		$input_errors[] = sprintf(gettext("A valid IP address must be specified. [%s]"), $_POST['radiusip3']);
283
	}
284
	if (($_POST['radiusip4'] && !is_ipaddr($_POST['radiusip4']))) {
285
		$input_errors[] = sprintf(gettext("A valid IP address must be specified. [%s]"), $_POST['radiusip4']);
286
	}
287
	if (($_POST['radiusport'] && !is_port($_POST['radiusport']))) {
288
		$input_errors[] = sprintf(gettext("A valid port number must be specified. [%s]"), $_POST['radiusport']);
289
	}
290
	if (($_POST['radiusport2'] && !is_port($_POST['radiusport2']))) {
291
		$input_errors[] = sprintf(gettext("A valid port number must be specified. [%s]"), $_POST['radiusport2']);
292
	}
293
	if (($_POST['radiusport3'] && !is_port($_POST['radiusport3']))) {
294
		$input_errors[] = sprintf(gettext("A valid port number must be specified. [%s]"), $_POST['radiusport3']);
295
	}
296
	if (($_POST['radiusport4'] && !is_port($_POST['radiusport4']))) {
297
		$input_errors[] = sprintf(gettext("A valid port number must be specified. [%s]"), $_POST['radiusport4']);
298
	}
299
	if (($_POST['radiusacctport'] && !is_port($_POST['radiusacctport']))) {
300
		$input_errors[] = sprintf(gettext("A valid port number must be specified. [%s]"), $_POST['radiusacctport']);
301
	}
302
	if ($_POST['maxproc'] && (!is_numeric($_POST['maxproc']) || ($_POST['maxproc'] < 4) || ($_POST['maxproc'] > 100))) {
303
		$input_errors[] = gettext("The maximum number of concurrent connections per client IP address may not be larger than the global maximum.");
304
	}
305
	if (trim($_POST['radiusnasid']) !== "" && !preg_match("/^[\x21-\x7e]{3,253}$/i", trim($_POST['radiusnasid']))) {
306
		$input_errors[] = gettext("The NAS-Identifier must be 3-253 characters long and should only contain ASCII characters.");
307
	}
308

    
309
	if (!$input_errors) {
310
		$newcp =& $a_cp[$cpzone];
311
		//$newcp['zoneid'] = $a_cp[$cpzone]['zoneid'];
312
		if (empty($newcp['zoneid'])) {
313
			$newcp['zoneid'] = 2;
314
			foreach ($a_cp as $keycpzone => $cp) {
315
				if ($cp['zoneid'] == $newcp['zoneid'] && $keycpzone != $cpzone)
316
					$newcp['zoneid'] += 2; /* Resreve space for SSL config if needed */
317
			}
318
			$cpzoneid = $newcp['zoneid'];
319
		}
320
		$oldifaces = explode(",", $newcp['interface']);
321
		if (is_array($_POST['cinterface']))
322
			$newcp['interface'] = implode(",", $_POST['cinterface']);
323
		$newcp['maxproc'] = $_POST['maxproc'];
324
		$newcp['maxprocperip'] = $_POST['maxprocperip'] ? $_POST['maxprocperip'] : false;
325
		$newcp['timeout'] = $_POST['timeout'];
326
		$newcp['idletimeout'] = $_POST['idletimeout'];
327
		$newcp['freelogins_count'] = $_POST['freelogins_count'];
328
		$newcp['freelogins_resettimeout'] = $_POST['freelogins_resettimeout'];
329
		$newcp['freelogins_updatetimeouts'] = $_POST['freelogins_updatetimeouts'] ? true : false;
330
		if ($_POST['enable'])
331
			$newcp['enable'] = true;
332
		else
333
			unset($newcp['enable']);
334
		$newcp['auth_method'] = $_POST['auth_method'];
335
		$newcp['localauth_priv'] = isset($_POST['localauth_priv']);
336
		$newcp['radacct_enable'] = $_POST['radacct_enable'] ? true : false;
337
		$newcp['reauthenticate'] = $_POST['reauthenticate'] ? true : false;
338
		$newcp['radmac_enable'] = $_POST['radmac_enable'] ? true : false;
339
		$newcp['radmac_secret'] = $_POST['radmac_secret'] ? $_POST['radmac_secret'] : false;
340
		$newcp['reauthenticateacct'] = $_POST['reauthenticateacct'];
341
		if ($_POST['httpslogin_enable'])
342
			$newcp['httpslogin'] = true;
343
		else
344
			unset($newcp['httpslogin']);
345
		$newcp['httpsname'] = $_POST['httpsname'];
346
		$newcp['preauthurl'] = $_POST['preauthurl'];
347
		$newcp['blockedmacsurl'] = $_POST['blockedmacsurl'];
348
		$newcp['peruserbw'] = $_POST['peruserbw'] ? true : false;
349
		if (isset($_POST['bwdefaultdn']))
350
			$newcp['bwdefaultdn'] = $_POST['bwdefaultdn'];
351
		else
352
			unset($newcp['bwdefaultdn']);
353
		if (isset($_POST['bwdefaultup']))
354
			$newcp['bwdefaultup'] = $_POST['bwdefaultup'];
355
		else
356
			unset($newcp['bwdefaultup']);
357
		$newcp['certref'] = $_POST['certref'];
358
		$newcp['nohttpsforwards'] = $_POST['nohttpsforwards'] ? true : false;
359
		$newcp['logoutwin_enable'] = $_POST['logoutwin_enable'] ? true : false;
360
		$newcp['nomacfilter'] = $_POST['nomacfilter'] ? true : false;
361
		$newcp['noconcurrentlogins'] = $_POST['noconcurrentlogins'] ? true : false;
362
		$newcp['radius_protocol'] = $_POST['radius_protocol'];
363
		$newcp['redirurl'] = $_POST['redirurl'];
364
		if (isset($_POST['radiusip']))
365
			$newcp['radiusip'] = $_POST['radiusip'];
366
		else
367
			unset($newcp['radiusip']);
368
		if (isset($_POST['radiusip2']))
369
			$newcp['radiusip2'] = $_POST['radiusip2'];
370
		else
371
			unset($newcp['radiusip2']);
372
		if (isset($_POST['radiusip3']))
373
			$newcp['radiusip3'] = $_POST['radiusip3'];
374
		else
375
			unset($newcp['radiusip3']);
376
		if (isset($_POST['radiusip4']))
377
			$newcp['radiusip4'] = $_POST['radiusip4'];
378
		else
379
			unset($newcp['radiusip4']);
380
		$newcp['radiusport'] = $_POST['radiusport'];
381
		$newcp['radiusport2'] = $_POST['radiusport2'];
382
		if (isset($_POST['radiusport3']))
383
			$newcp['radiusport3'] = $_POST['radiusport3'];
384
		if (isset($_POST['radiusport4']))
385
			$newcp['radiusport4'] = $_POST['radiusport4'];
386
		$newcp['radiusacctport'] = $_POST['radiusacctport'];
387
		$newcp['radiuskey'] = $_POST['radiuskey'];
388
		$newcp['radiuskey2'] = $_POST['radiuskey2'];
389
		$newcp['radiuskey3'] = $_POST['radiuskey3'];
390
		$newcp['radiuskey4'] = $_POST['radiuskey4'];
391
		$newcp['radiusvendor'] = $_POST['radiusvendor'] ? $_POST['radiusvendor'] : false;
392
		$newcp['radiussession_timeout'] = $_POST['radiussession_timeout'] ? true : false;
393
		$newcp['radiussrcip_attribute'] = $_POST['radiussrcip_attribute'];
394
		$newcp['passthrumacadd'] = $_POST['passthrumacadd'] ? true : false;
395
		$newcp['passthrumacaddusername'] = $_POST['passthrumacaddusername'] ? true : false;
396
		$newcp['radmac_format'] = $_POST['radmac_format'] ? $_POST['radmac_format'] : false;
397
		$newcp['reverseacct'] = $_POST['reverseacct'] ? true : false;
398
		$newcp['radiusnasid'] = trim($_POST['radiusnasid']);
399
		if (!is_array($newcp['page']))
400
			$newcp['page'] = array();
401

    
402
		/* file upload? */
403
		if (is_uploaded_file($_FILES['htmlfile']['tmp_name']))
404
			$newcp['page']['htmltext'] = base64_encode(file_get_contents($_FILES['htmlfile']['tmp_name']));
405
		if (is_uploaded_file($_FILES['errfile']['tmp_name']))
406
			$newcp['page']['errtext'] = base64_encode(file_get_contents($_FILES['errfile']['tmp_name']));
407
		if (is_uploaded_file($_FILES['logoutfile']['tmp_name']))
408
			$newcp['page']['logouttext'] = base64_encode(file_get_contents($_FILES['logoutfile']['tmp_name']));
409

    
410
		write_config();
411

    
412
		/* Clear up unselected interfaces */
413
		$newifaces = explode(",", $newcp['interface']);
414
		$toremove = array_diff($oldifaces, $newifaces);
415
		if (!empty($toremove)) {
416
			foreach ($toremove as $removeif) {
417
				$removeif = get_real_interface($removeif);
418
				mwexec("/sbin/ipfw zone {$cpzoneid} mdel {$removeif}");
419
			}
420
		}
421
		captiveportal_configure_zone($newcp);
422
		unset($newcp, $newifaces, $toremove);
423
		filter_configure();
424
		header("Location: services_captiveportal_zones.php");
425
		exit;
426
	} else {
427
		if (is_array($_POST['cinterface']))
428
			$pconfig['cinterface'] = implode(",", $_POST['cinterface']);
429
	}
430
}
431
$closehead = false;
432
include("head.inc");
433
?>
434
<script type="text/javascript">
435
//<![CDATA[
436
function enable_change(enable_change) {
437
	var endis, radius_endis;
438
	endis = !(document.iform.enable.checked || enable_change);
439
	localauth_endis = !((!endis && document.iform.auth_method[1].checked) || enable_change);
440
	radius_endis = !((!endis && document.iform.auth_method[2].checked) || enable_change);
441
	https_endis = !((!endis && document.iform.httpslogin_enable.checked) || enable_change);
442

    
443
	document.iform.cinterface.disabled = endis;
444
	//document.iform.maxproc.disabled = endis;
445
	document.iform.maxprocperip.disabled = endis;
446
	document.iform.idletimeout.disabled = endis;
447
	document.iform.freelogins_count.disabled = endis;
448
	document.iform.freelogins_resettimeout.disabled = endis;
449
	document.iform.freelogins_updatetimeouts.disabled = endis;
450
	document.iform.timeout.disabled = endis;
451
	document.iform.preauthurl.disabled = endis;
452
	document.iform.blockedmacsurl.disabled = endis;
453
	document.iform.redirurl.disabled = endis;
454
	document.iform.localauth_priv.disabled = localauth_endis;
455
	document.iform.radiusip.disabled = radius_endis;
456
	document.iform.radiusip2.disabled = radius_endis;
457
	document.iform.radiusip3.disabled = radius_endis;
458
	document.iform.radiusip4.disabled = radius_endis;
459
	document.iform.radiusport.disabled = radius_endis;
460
	document.iform.radiusport3.disabled = radius_endis;
461
	document.iform.radiusport4.disabled = radius_endis;
462
	document.iform.radiusport2.disabled = radius_endis;
463
	document.iform.radiuskey.disabled = radius_endis;
464
	document.iform.radiuskey2.disabled = radius_endis;
465
	document.iform.radiuskey3.disabled = radius_endis;
466
	document.iform.radiuskey4.disabled = radius_endis;
467
	document.iform.radacct_enable.disabled = radius_endis;
468
	document.iform.peruserbw.disabled = endis;
469
	document.iform.bwdefaultdn.disabled = endis;
470
	document.iform.bwdefaultup.disabled = endis;
471
	document.iform.reauthenticate.disabled = radius_endis;
472
	document.iform.auth_method[0].disabled = endis;
473
	document.iform.auth_method[1].disabled = endis;
474
	document.iform.auth_method[2].disabled = endis;
475
	document.iform.radius_protocol[0].disabled = radius_endis;
476
	document.iform.radius_protocol[1].disabled = radius_endis;
477
	document.iform.radius_protocol[2].disabled = radius_endis;
478
	document.iform.radius_protocol[3].disabled = radius_endis;
479
	document.iform.radmac_enable.disabled = radius_endis;
480
	document.iform.httpslogin_enable.disabled = endis;
481
	document.iform.radmac_format.disabled = radius_endis;
482
	document.iform.httpsname.disabled = https_endis;
483
	document.iform.certref.disabled = https_endis;
484
	document.iform.nohttpsforwards.disabled = https_endis;
485
	document.iform.logoutwin_enable.disabled = endis;
486
	document.iform.nomacfilter.disabled = endis;
487
	document.iform.noconcurrentlogins.disabled = endis;
488
	document.iform.radiusvendor.disabled = radius_endis;
489
	document.iform.radiussession_timeout.disabled = radius_endis;
490
	document.iform.radiussrcip_attribute.disabled = radius_endis;
491
	document.iform.htmlfile.disabled = endis;
492
	document.iform.errfile.disabled = endis;
493
	document.iform.logoutfile.disabled = endis;
494

    
495
	document.iform.radiusacctport.disabled = (radius_endis || !document.iform.radacct_enable.checked) && !enable_change;
496

    
497
	document.iform.radmac_secret.disabled = (radius_endis || !document.iform.radmac_enable.checked) && !enable_change;
498

    
499
	var radacct_dis = (radius_endis || !document.iform.radacct_enable.checked) && !enable_change;
500
	document.iform.reauthenticateacct[0].disabled = radacct_dis;
501
	document.iform.reauthenticateacct[1].disabled = radacct_dis;
502
	document.iform.reauthenticateacct[2].disabled = radacct_dis;
503
	document.iform.reverseacct.disabled = (radius_endis || !document.iform.radacct_enable.checked) && !enable_change;
504
	document.iform.radiusnasid.disabled = radius_endis;
505
}
506
//]]>
507
</script>
508
</head>
509
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
510
<?php include("fbegin.inc"); ?>
511
<?php if ($input_errors) print_input_errors($input_errors); ?>
512
<?php if ($savemsg) print_info_box($savemsg); ?>
513
<form action="services_captiveportal.php" method="post" enctype="multipart/form-data" name="iform" id="iform">
514
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="captive portal">
515
  <tr><td class="tabnavtbl">
516
<?php
517
	$tab_array = array();
518
	$tab_array[] = array(gettext("Captive portal(s)"), true, "services_captiveportal.php?zone={$cpzone}");
519
	$tab_array[] = array(gettext("MAC"), false, "services_captiveportal_mac.php?zone={$cpzone}");
520
	$tab_array[] = array(gettext("Allowed IP addresses"), false, "services_captiveportal_ip.php?zone={$cpzone}");
521
	$tab_array[] = array(gettext("Allowed Hostnames"), false, "services_captiveportal_hostname.php?zone={$cpzone}");
522
	$tab_array[] = array(gettext("Vouchers"), false, "services_captiveportal_vouchers.php?zone={$cpzone}");
523
	$tab_array[] = array(gettext("File Manager"), false, "services_captiveportal_filemanager.php?zone={$cpzone}");
524
	display_top_tabs($tab_array, true);
525
?>    </td></tr>
526
  <tr>
527
  <td class="tabcont">
528
  <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main">
529
	<tr>
530
	  <td width="22%" valign="top" class="vtable">&nbsp;</td>
531
	  <td width="78%" class="vtable">
532
		<input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked=\"checked\""; ?> onclick="enable_change(false)" />
533
		<strong><?=gettext("Enable captive portal"); ?> </strong></td>
534
	</tr>
535
	<tr>
536
	  <td width="22%" valign="top" class="vncellreq"><?=gettext("Interfaces"); ?></td>
537
	  <td width="78%" class="vtable">
538
		<select name="cinterface[]" multiple="multiple" size="<?php echo count($config['interfaces']); ?>" class="formselect" id="cinterface">
539
		  <?php
540
		  $interfaces = get_configured_interface_with_descr();
541
		  $cselected = explode(",", $pconfig['cinterface']);
542
		  foreach ($interfaces as $iface => $ifacename): ?>
543
			  <option value="<?=$iface;?>" <?php if (in_array($iface, $cselected)) echo "selected=\"selected\""; ?>>
544
			  <?=htmlspecialchars($ifacename);?>
545
			  </option>
546
		  <?php endforeach; ?>
547
		</select> <br />
548
		<span class="vexpl"><?=gettext("Select the interface(s) to enable for captive portal."); ?></span></td>
549
	</tr>
550
	<tr>
551
	  <td valign="top" class="vncell"><?=gettext("Maximum concurrent connections"); ?></td>
552
	  <td class="vtable">
553
		<table cellpadding="0" cellspacing="0" summary="connections">
554
                 <tr>
555
           			<td><input name="maxprocperip" type="text" class="formfld unknown" id="maxprocperip" size="5" value="<?=htmlspecialchars($pconfig['maxprocperip']);?>" /> <?=gettext("per client IP address (0 = no limit)"); ?></td>
556
                 </tr>
557
               </table>
558
<?=gettext("This setting limits the number of concurrent connections to the captive portal HTTP(S) server. This does not set how many users can be logged in " .
559
"to the captive portal, but rather how many users can load the portal page or authenticate at the same time! " .
560
"Possible setting allowed is: minimum 4 connections per client IP address, with a total maximum of 100 connections."); ?></td>
561
	</tr>
562
	<tr>
563
	  <td valign="top" class="vncell"><?=gettext("Idle timeout"); ?></td>
564
	  <td class="vtable">
565
		<input name="idletimeout" type="text" class="formfld unknown" id="idletimeout" size="6" value="<?=htmlspecialchars($pconfig['idletimeout']);?>" />
566
<?=gettext("minutes"); ?><br />
567
<?=gettext("Clients will be disconnected after this amount of inactivity. They may log in again immediately, though. Leave this field blank for no idle timeout."); ?></td>
568
	</tr>
569
	<tr>
570
	  <td width="22%" valign="top" class="vncell"><?=gettext("Hard timeout"); ?></td>
571
	  <td width="78%" class="vtable">
572
		<input name="timeout" type="text" class="formfld unknown" id="timeout" size="6" value="<?=htmlspecialchars($pconfig['timeout']);?>" />
573
		<?=gettext("minutes"); ?><br />
574
	  <?=gettext("Clients will be disconnected after this amount of time, regardless of activity. They may log in again immediately, though. Leave this field blank for no hard timeout (not recommended unless an idle timeout is set)."); ?></td>
575
	</tr>
576
	<tr>
577
	  <td width="22%" valign="top" class="vncell"><?=gettext("Pass-through credits allowed per MAC address"); ?></td>
578
	  <td width="78%" class="vtable">
579
		<input name="freelogins_count" type="text" class="formfld unknown" id="freelogins_count" size="6" value="<?=htmlspecialchars($pconfig['freelogins_count']);?>" />
580
		<?=gettext("per client MAC address (0 or blank = none)"); ?><br />
581
		<?=gettext("This setting allows passing through the captive portal without authentication a limited number of times per MAC address. Once used up, the client can only log in with valid credentials until the waiting period specified below has expired. Recommended to set a hard timeout and/or idle timeout when using this for it to be effective."); ?></td>
582
	</tr>
583
	<tr>
584
	  <td width="22%" valign="top" class="vncell"><?=gettext("Waiting period to restore pass-through credits"); ?></td>
585
	  <td width="78%" class="vtable">
586
		<input name="freelogins_resettimeout" type="text" class="formfld unknown" id="freelogins_resettimeout" size="6" value="<?=htmlspecialchars($pconfig['freelogins_resettimeout']);?>" />
587
		<?=gettext("hours"); ?><br />
588
		<?=gettext("Clients will have their available pass-through credits restored to the original count after this amount of time since using the first one. This must be above 0 hours if pass-through credits are enabled."); ?></td>
589
	</tr>
590
	<tr>
591
	  <td width="22%" valign="top" class="vncell"><?=gettext("Reset waiting period on attempted access"); ?></td>
592
	  <td width="78%" class="vtable">
593
		<input name="freelogins_updatetimeouts" type="checkbox" class="formfld" id="freelogins_updatetimeouts" value="yes" <?php if($pconfig['freelogins_updatetimeouts']) echo "checked=\"checked\""; ?> />
594
		<strong><?=gettext("Enable waiting period reset on attempted access"); ?></strong><br />
595
		<?=gettext("If enabled, the waiting period is reset to the original duration if access is attempted when all pass-through credits have already been exhausted."); ?></td>
596
	</tr>
597
	<tr>
598
	  <td width="22%" valign="top" class="vncell"><?=gettext("Logout popup window"); ?></td>
599
	  <td width="78%" class="vtable">
600
		<input name="logoutwin_enable" type="checkbox" class="formfld" id="logoutwin_enable" value="yes" <?php if($pconfig['logoutwin_enable']) echo "checked=\"checked\""; ?> />
601
		<strong><?=gettext("Enable logout popup window"); ?></strong><br />
602
	  <?=gettext("If enabled, a popup window will appear when clients are allowed through the captive portal. This allows clients to explicitly disconnect themselves before the idle or hard timeout occurs."); ?></td>
603
	</tr>
604
	<tr>
605
      <td valign="top" class="vncell"><?=gettext("Pre-authentication redirect URL"); ?> </td>
606
      <td class="vtable">
607
        <input name="preauthurl" type="text" class="formfld url" id="preauthurl" size="60" value="<?=htmlspecialchars($pconfig['preauthurl']);?>" /><br />
608
		<?php printf(gettext("Use this field to set \$PORTAL_REDIRURL\$ variable which can be accessed using your custom captive portal index.php page or error pages."));?>
609
	  </td>
610
	</tr>
611
	<tr>
612
	  <td valign="top" class="vncell"><?=gettext("After authentication Redirection URL"); ?></td>
613
	  <td class="vtable">
614
		<input name="redirurl" type="text" class="formfld url" id="redirurl" size="60" value="<?=htmlspecialchars($pconfig['redirurl']);?>" />
615
		<br />
616
<?=gettext("If you provide a URL here, clients will be redirected to that URL instead of the one they initially tried " .
617
"to access after they've authenticated."); ?></td>
618
	</tr>
619
	<tr>
620
		<td valign="top" class="vncell"><?=gettext("Blocked MAC address redirect URL"); ?> </td>
621
		<td class="vtable">
622
			<input name="blockedmacsurl" type="text" class="formfld url" id="blockedmacsurl" size="60" value="<?=htmlspecialchars($pconfig['blockedmacsurl']);?>" /><br />
623
			<?php printf(gettext("If you provide a URL here, MAC addresses set to be blocked will be redirect to that URL when attempt to access anything."));?>
624
		</td>
625
	</tr>
626
	<tr>
627
      <td valign="top" class="vncell"><?=gettext("Concurrent user logins"); ?></td>
628
      <td class="vtable">
629
	<input name="noconcurrentlogins" type="checkbox" class="formfld" id="noconcurrentlogins" value="yes" <?php if ($pconfig['noconcurrentlogins']) echo "checked=\"checked\""; ?> />
630
	<strong><?=gettext("Disable concurrent logins"); ?></strong><br />
631
	<?=gettext("If this option is set, only the most recent login per username will be active. Subsequent logins will cause machines previously logged in with the same username to be disconnected."); ?></td>
632
	</tr>
633
	<tr>
634
      <td valign="top" class="vncell"><?=gettext("MAC filtering"); ?> </td>
635
      <td class="vtable">
636
        <input name="nomacfilter" type="checkbox" class="formfld" id="nomacfilter" value="yes" <?php if ($pconfig['nomacfilter']) echo "checked=\"checked\""; ?> />
637
        <strong><?=gettext("Disable MAC filtering"); ?></strong><br />
638
    <?=gettext("If this option is set, no attempts will be made to ensure that the MAC address of clients stays the same while they're logged in." .
639
    "This is required when the MAC address of the client cannot be determined (usually because there are routers between"); ?> <?php echo $g['product_name'] ?> <?=gettext("and the clients)."); ?>
640
    <?=gettext("If this is enabled, RADIUS MAC authentication cannot be used."); ?></td>
641
	</tr>
642
	<tr>
643
      <td valign="top" class="vncell"><?=gettext("Pass-through MAC Auto Entry"); ?></td>
644
      <td class="vtable">
645
        <input name="passthrumacadd" type="checkbox" class="formfld" id="passthrumacadd" value="yes" <?php if ($pconfig['passthrumacadd']) echo "checked=\"checked\""; ?> />
646
        <strong><?=gettext("Enable Pass-through MAC automatic additions"); ?></strong><br />
647
    <?=gettext("If this option is set, a MAC passthrough entry is automatically added after the user has successfully authenticated. Users of that MAC address will never have to authenticate again."); ?>
648
    <?=gettext("To remove the passthrough MAC entry you either have to log in and remove it manually from the"); ?> <a href="services_captiveportal_mac.php"><?=gettext("MAC tab"); ?></a> <?=gettext("or send a POST from another system to remove it."); ?>
649
    <?=gettext("If this is enabled, RADIUS MAC authentication cannot be used. Also, the logout window will not be shown."); ?>
650
	<br /><br />
651
        <input name="passthrumacaddusername" type="checkbox" class="formfld" id="passthrumacaddusername" value="yes" <?php if ($pconfig['passthrumacaddusername']) echo "checked=\"checked\""; ?> />
652
        <strong><?=gettext("Enable Pass-through MAC automatic addition with username"); ?></strong><br />
653
    <?=gettext("If this option is set, with the automatically MAC passthrough entry created the username, used during authentication, will be saved."); ?>
654
    <?=gettext("To remove the passthrough MAC entry you either have to log in and remove it manually from the"); ?> <a href="services_captiveportal_mac.php"><?=gettext("MAC tab"); ?></a> <?=gettext("or send a POST from another system to remove it."); ?>
655
	</td>
656
	</tr>
657
	<tr>
658
      <td valign="top" class="vncell"><?=gettext("Per-user bandwidth restriction"); ?></td>
659
      <td class="vtable">
660
        <input name="peruserbw" type="checkbox" class="formfld" id="peruserbw" value="yes" <?php if ($pconfig['peruserbw']) echo "checked=\"checked\""; ?> />
661
        <strong><?=gettext("Enable per-user bandwidth restriction"); ?></strong><br /><br />
662
        <table cellpadding="0" cellspacing="0" summary="bandwidth">
663
        <tr>
664
        <td><?=gettext("Default download"); ?></td>
665
        <td><input type="text" class="formfld unknown" name="bwdefaultdn" id="bwdefaultdn" size="10" value="<?=htmlspecialchars($pconfig['bwdefaultdn']);?>" /> <?=gettext("Kbit/s"); ?></td>
666
        </tr>
667
        <tr>
668
        <td><?=gettext("Default upload"); ?></td>
669
        <td><input type="text" class="formfld unknown" name="bwdefaultup" id="bwdefaultup" size="10" value="<?=htmlspecialchars($pconfig['bwdefaultup']);?>" /> <?=gettext("Kbit/s"); ?></td>
670
        </tr></table>
671
        <br />
672
        <?=gettext("If this option is set, the captive portal will restrict each user who logs in to the specified default bandwidth. RADIUS can override the default settings. Leave empty or set to 0 for no limit."); ?> </td>
673
	</tr>
674
	<tr>
675
	  <td width="22%" valign="top" class="vncell"><?=gettext("Authentication"); ?></td>
676
	  <td width="78%" class="vtable">
677
		<table cellpadding="0" cellspacing="0" summary="authentication">
678
		<tr>
679
		  <td colspan="2"><input name="auth_method" type="radio" id="auth_method" value="none" onclick="enable_change(false)" <?php if($pconfig['auth_method']!="local" && $pconfig['auth_method']!="radius") echo "checked=\"checked\""; ?> />
680
  <?=gettext("No Authentication"); ?></td>
681
		</tr>
682
		<tr>
683
		  <td colspan="2"><input name="auth_method" type="radio" id="auth_method" value="local" onclick="enable_change(false)" <?php if($pconfig['auth_method']=="local") echo "checked=\"checked\""; ?> />
684
  <?=gettext("Local"); ?> <a href="system_usermanager.php"><?=gettext("User Manager"); ?></a> / <?=gettext("Vouchers"); ?></td>
685
		</tr>
686
		<tr>
687
		  <td>&nbsp;</td>
688
		  <td>&nbsp;</td>
689
		</tr>
690
		<tr>
691
		  <td>&nbsp;</td>
692
		  <td><input name="localauth_priv" type="checkbox" id="localauth_priv" value="yes" onclick="enable_change(false)" <?php if($pconfig['localauth_priv']=="yes") echo "checked=\"checked\""; ?> />
693
  <?=gettext("Allow only users/groups with 'Captive portal login' privilege set"); ?></td>
694
		</tr><tr>
695
		  <td colspan="2"><input name="auth_method" type="radio" id="auth_method" value="radius" onclick="enable_change(false)" <?php if($pconfig['auth_method']=="radius") echo "checked=\"checked\""; ?> />
696
  <?=gettext("RADIUS Authentication"); ?></td>
697
		</tr><tr>
698
		  <td>&nbsp;</td>
699
		  <td>&nbsp;</td>
700
                </tr>
701
<tr>
702
                  <td width="22%" valign="top" class="vncell"><?=gettext("RADIUS Protocol"); ?></td>
703
                  <td width="78%" class="vtable">
704
                    <table cellpadding="0" cellspacing="0" summary="radius">
705
                    <tr>
706
                      <td colspan="2"><input name="radius_protocol" type="radio" id="radius_protocol" value="PAP" onclick="enable_change(false)" <?php if($pconfig['auth_method']=="radius" && $pconfig['radius_protocol']!="CHAP_MD5" && $pconfig['radius_protocol']!="MSCHAPv1" && $pconfig['radius_protocol']!="MSCHAPv2") echo "checked=\"checked\""; ?> />
707
      <?=gettext("PAP"); ?></td>
708
                      </tr>
709
                    <tr>
710
                      <td colspan="2"><input name="radius_protocol" type="radio" id="radius_protocol" value="CHAP_MD5" onclick="enable_change(false)" <?php if($pconfig['auth_method']=="radius" && $pconfig['radius_protocol']=="CHAP_MD5") echo "checked=\"checked\""; ?> />
711
      <?=gettext("CHAP_MD5"); ?></td>
712
                      </tr>
713
                    <tr>
714
                      <td colspan="2"><input name="radius_protocol" type="radio" id="radius_protocol" value="MSCHAPv1" onclick="enable_change(false)" <?php if($pconfig['auth_method']=="radius" && $pconfig['radius_protocol']=="MSCHAPv1") echo "checked=\"checked\""; ?> />
715
      <?=gettext("MSCHAPv1"); ?></td>
716
                      </tr>
717
                    <tr>
718
                      <td colspan="2"><input name="radius_protocol" type="radio" id="radius_protocol" value="MSCHAPv2" onclick="enable_change(false)" <?php if($pconfig['auth_method']=="radius" && $pconfig['radius_protocol']=="MSCHAPv2") echo "checked=\"checked\""; ?> />
719
      <?=gettext("MSCHAPv2"); ?></td>
720
                      </tr><tr>
721
                      <td>&nbsp;</td>
722
                      <td>&nbsp;</td>
723
                      </tr>
724
                    </table>
725
                  </td>
726
                  </tr><tr>
727
                  <td>&nbsp;</td>
728
                  <td>&nbsp;</td>
729
                  </tr>
730
                </table>
731
		<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="primary athentication">
732
			<tr>
733
				<td colspan="2" valign="top" class="listtopic">Primary Authentication Source</td>
734
			</tr>
735
			<tr>
736
				<td colspan="2" valign="top" class="optsect_t2"><?=gettext("Primary RADIUS server"); ?></td>
737
			</tr>
738
			<tr>
739
				<td class="vncell" valign="top"><?=gettext("IP address"); ?></td>
740
				<td class="vtable"><input name="radiusip" type="text" class="formfld unknown" id="radiusip" size="20" value="<?=htmlspecialchars($pconfig['radiusip']);?>" /><br />
741
				<?=gettext("Enter the IP address of the RADIUS server which users of the captive portal have to authenticate against."); ?></td>
742
			</tr>
743
			<tr>
744
				<td class="vncell" valign="top"><?=gettext("Port"); ?></td>
745
				<td class="vtable"><input name="radiusport" type="text" class="formfld unknown" id="radiusport" size="5" value="<?=htmlspecialchars($pconfig['radiusport']);?>" /><br />
746
				 <?=gettext("Leave this field blank to use the default port (1812)."); ?></td>
747
			</tr>
748
			<tr>
749
				<td class="vncell" valign="top"><?=gettext("Shared secret"); ?>&nbsp;&nbsp;</td>
750
				<td class="vtable"><input name="radiuskey" type="text" class="formfld unknown" id="radiuskey" size="16" value="<?=htmlspecialchars($pconfig['radiuskey']);?>" /><br />
751
				<?=gettext("Leave this field blank to not use a RADIUS shared secret (not recommended)."); ?></td>
752
			</tr>
753
			<tr>
754
			  <td colspan="2" class="list" height="12"></td>
755
			</tr>
756
			<tr>
757
				<td colspan="2" valign="top" class="optsect_t2"><?=gettext("Secondary RADIUS server"); ?></td>
758
			</tr>
759
			<tr>
760
				<td class="vncell" valign="top"><?=gettext("IP address"); ?></td>
761
				<td class="vtable"><input name="radiusip2" type="text" class="formfld unknown" id="radiusip2" size="20" value="<?=htmlspecialchars($pconfig['radiusip2']);?>" /><br />
762
				<?=gettext("If you have a second RADIUS server, you can activate it by entering its IP address here."); ?></td>
763
			</tr>
764
			<tr>
765
				<td class="vncell" valign="top"><?=gettext("Port"); ?></td>
766
				<td class="vtable"><input name="radiusport2" type="text" class="formfld unknown" id="radiusport2" size="5" value="<?=htmlspecialchars($pconfig['radiusport2']);?>" /></td>
767
			</tr>
768
			<tr>
769
				<td class="vncell" valign="top"><?=gettext("Shared secret"); ?>&nbsp;&nbsp;</td>
770
				<td class="vtable"><input name="radiuskey2" type="text" class="formfld unknown" id="radiuskey2" size="16" value="<?=htmlspecialchars($pconfig['radiuskey2']);?>" /></td>
771
			</tr>
772
			<tr>
773
			  <td colspan="2" class="list" height="12"></td>
774
			</tr>
775
			<tr>
776
				<td colspan="2" valign="top" class="listtopic">Secondary Authentication Source</td>
777
			</tr>
778
			<tr>
779
				<td colspan="2" valign="top" class="optsect_t2"><?=gettext("Primary RADIUS server"); ?></td>
780
			</tr>
781
			<tr>
782
				<td class="vncell" valign="top"><?=gettext("IP address"); ?></td>
783
				<td class="vtable"><input name="radiusip3" type="text" class="formfld unknown" id="radiusip3" size="20" value="<?=htmlspecialchars($pconfig['radiusip3']);?>" /><br />
784
				<?=gettext("If you have a third RADIUS server, you can activate it by entering its IP address here."); ?></td>
785
			</tr>
786
			<tr>
787
				<td class="vncell" valign="top"><?=gettext("Port"); ?></td>
788
				<td class="vtable"><input name="radiusport3" type="text" class="formfld unknown" id="radiusport3" size="5" value="<?=htmlspecialchars($pconfig['radiusport3']);?>" /></td>
789
			</tr>
790
			<tr>
791
				<td class="vncell" valign="top"><?=gettext("Shared secret"); ?>&nbsp;&nbsp;</td>
792
				<td class="vtable"><input name="radiuskey3" type="text" class="formfld unknown" id="radiuskey3" size="16" value="<?=htmlspecialchars($pconfig['radiuskey3']);?>" /></td>
793
			</tr>
794
			<tr>
795
			  <td colspan="2" class="list" height="12"></td>
796
			</tr>
797
			<tr>
798
				<td colspan="2" valign="top" class="optsect_t2"><?=gettext("Secondary RADIUS server"); ?></td>
799
			</tr>
800
			<tr>
801
				<td class="vncell" valign="top"><?=gettext("IP address"); ?></td>
802
				<td class="vtable"><input name="radiusip4" type="text" class="formfld unknown" id="radiusip4" size="20" value="<?=htmlspecialchars($pconfig['radiusip4']);?>" /><br />
803
				<?=gettext("If you have a fourth RADIUS server, you can activate it by entering its IP address here."); ?></td>
804
			</tr>
805
			<tr>
806
				<td class="vncell" valign="top"><?=gettext("Port"); ?></td>
807
				<td class="vtable"><input name="radiusport4" type="text" class="formfld unknown" id="radiusport4" size="5" value="<?=htmlspecialchars($pconfig['radiusport4']);?>" /></td>
808
			</tr>
809
			<tr>
810
				<td class="vncell" valign="top"><?=gettext("Shared secret"); ?>&nbsp;&nbsp;</td>
811
				<td class="vtable"><input name="radiuskey4" type="text" class="formfld unknown" id="radiuskey4" size="16" value="<?=htmlspecialchars($pconfig['radiuskey4']);?>" /></td>
812
			</tr>
813
			<tr>
814
			  <td colspan="2" class="list" height="12"></td>
815
			</tr>
816
			<tr>
817
				<td colspan="2" valign="top" class="listtopic"><?=gettext("Accounting"); ?></td>
818
			</tr>
819
			<tr>
820
				<td class="vncell">&nbsp;</td>
821
				<td class="vtable"><input name="radacct_enable" type="checkbox" id="radacct_enable" value="yes" onclick="enable_change(false)" <?php if($pconfig['radacct_enable']) echo "checked=\"checked\""; ?> />
822
				<strong><?=gettext("send RADIUS accounting packets"); ?></strong><br />
823
				<?=gettext("If this is enabled, RADIUS accounting packets will be sent to the primary RADIUS server."); ?></td>
824
			</tr>
825
			<tr>
826
			  <td class="vncell" valign="top"><?=gettext("Accounting port"); ?></td>
827
			  <td class="vtable"><input name="radiusacctport" type="text" class="formfld unknown" id="radiusacctport" size="5" value="<?=htmlspecialchars($pconfig['radiusacctport']);?>" /><br />
828
			  <?=gettext("Leave blank to use the default port (1813)."); ?></td>
829
			  </tr>
830
			<tr>
831
			  <td colspan="2" class="list" height="12"></td>
832
			</tr>
833
			<tr>
834
			  <td class="vncell" valign="top"><?=gettext("Accounting updates"); ?></td>
835
			  <td class="vtable">
836
			  <input name="reauthenticateacct" type="radio" value="" <?php if(!$pconfig['reauthenticateacct']) echo "checked=\"checked\""; ?> /> <?=gettext("no accounting updates"); ?><br />
837
			  <input name="reauthenticateacct" type="radio" value="stopstart" <?php if($pconfig['reauthenticateacct'] == "stopstart") echo "checked=\"checked\""; ?> /> <?=gettext("stop/start accounting"); ?><br />
838
			  <input name="reauthenticateacct" type="radio" value="interimupdate" <?php if($pconfig['reauthenticateacct'] == "interimupdate") echo "checked=\"checked\""; ?> /> <?=gettext("interim update"); ?>
839
			  </td>
840
			</tr>
841
			<tr>
842
			  <td colspan="2" class="list" height="12"></td>
843
			</tr>
844
			<tr>
845
				<td colspan="2" valign="top" class="listtopic"><?=gettext("RADIUS options"); ?></td>
846
			</tr>
847
			<tr>
848
				<td class="vncell"><?=gettext("Reauthentication"); ?></td>
849
				<td class="vtable"><input name="reauthenticate" type="checkbox" id="reauthenticate" value="yes" onclick="enable_change(false)" <?php if($pconfig['reauthenticate']) echo "checked=\"checked\""; ?> />
850
				<strong><?=gettext("Reauthenticate connected users every minute"); ?></strong><br />
851
				<?=gettext("If reauthentication is enabled, Access-Requests will be sent to the RADIUS server for each user that is " .
852
				"logged in every minute. If an Access-Reject is received for a user, that user is disconnected from the captive portal immediately."); ?></td>
853
			</tr>
854
			<tr>
855
				<td class=""><?=gettext("RADIUS MAC authentication"); ?></td>
856
				<td class="">
857
				<input name="radmac_enable" type="checkbox" id="radmac_enable" value="yes" onclick="enable_change(false)" <?php if ($pconfig['radmac_enable']) echo "checked=\"checked\""; ?> /><strong><?=gettext("Enable RADIUS MAC authentication"); ?></strong><br />
858
				<?=gettext("If this option is enabled, the captive portal will try to authenticate users by sending their MAC address as the username and the password " .
859
				"entered below to the RADIUS server."); ?></td>
860
			</tr>
861
			<tr>
862
				<td class="vncell"><?=gettext("MAC authentication secret"); ?></td>
863
				<td class="vtable"><input name="radmac_secret" type="text" class="formfld unknown" id="radmac_secret" size="16" value="<?=htmlspecialchars($pconfig['radmac_secret']);?>" /></td>
864
			</tr>
865
			<tr>
866
				<td class="vncell" valign="top"><?=gettext("RADIUS NAS IP attribute"); ?></td>
867
				<td class="vtable">
868
				<select name="radiussrcip_attribute" id="radiussrcip_attribute">
869
				<?php $iflist = get_configured_interface_with_descr();
870
					foreach ($iflist as $ifdesc => $ifdescr) {
871
						$ipaddr = get_interface_ip($ifdesc);
872
						if (is_ipaddr($ipaddr)) {
873
							$selected = "";
874
							if ($ifdesc == $pconfig['radiussrcip_attribute'])
875
								$selected= "selected=\"selected\"";
876
							echo "<option value='{$ifdesc}' {$selected}>{$ifdescr} - {$ipaddr}</option>\n";
877
						}
878
					}
879
					if (is_array($config['virtualip']['vip'])) {
880
						foreach ($config['virtualip']['vip'] as $sn) {
881
							if ($sn['mode'] == "proxyarp" && $sn['type'] == "network") {
882
								$start = ip2long32(gen_subnet($sn['subnet'], $sn['subnet_bits']));
883
								$end = ip2long32(gen_subnet_max($sn['subnet'], $sn['subnet_bits']));
884
								$len = $end - $start;
885

    
886
								for ($i = 0; $i <= $len; $i++) {
887
									$snip = long2ip32($start+$i);
888
									echo "<option value='{$snip}' {$selected}>" . htmlspecialchars("{$sn['descr']} - {$snip}") . "></option>\n";
889
								}
890
							} else
891
								echo "<option value='{$sn['subnet']}' {$selected}>" . htmlspecialchars("{$sn['descr']} - {$sn['subnet']}") . "></option>\n";
892
						}
893
					}
894
				?>
895
				</select><br />
896
				<?=gettext("Choose the IP to use for calling station attribute."); ?>
897
				</td>
898
			</tr>
899

    
900
			<tr>
901
				<td class="vncell" valign="top"><?=gettext("Session-Timeout"); ?></td>
902
				<td class="vtable"><input name="radiussession_timeout" type="checkbox" id="radiussession_timeout" value="yes" <?php if ($pconfig['radiussession_timeout']) echo "checked=\"checked\""; ?> /><strong><?=gettext("Use RADIUS Session-Timeout attributes"); ?></strong><br />
903
				<?=gettext("When this is enabled, clients will be disconnected after the amount of time retrieved from the RADIUS Session-Timeout attribute."); ?></td>
904
			</tr>
905

    
906
			<tr>
907
				<td class="vncell" valign="top"><?=gettext("Type"); ?></td>
908
				<td class="vtable"><select name="radiusvendor" id="radiusvendor">
909
				<option value="default"><?php echo gettext("default"); ?></option>
910
				<?php
911
				$radiusvendors = array("cisco");
912
				foreach ($radiusvendors as $radiusvendor){
913
					if ($pconfig['radiusvendor'] == $radiusvendor)
914
						echo "<option selected=\"selected\" value=\"$radiusvendor\">$radiusvendor</option>\n";
915
					else
916
						echo "<option value=\"$radiusvendor\">$radiusvendor</option>\n";
917
				}
918
				?></select><br />
919
				<?php printf(gettext("If RADIUS type is set to Cisco, in Access-Requests the value of Calling-Station-Id will be set to the client's IP address and " .
920
				"the Called-Station-Id to the client's MAC address. Default behavior is Calling-Station-Id = client's MAC address and Called-Station-Id = %s's WAN IP address."),
921
					$g['product_name']);?></td>
922
			</tr>
923

    
924
			<tr>
925
				<td class="vncell" valign="top"><?=gettext("Accounting Style"); ?></td>
926
				<td class="vtable"><input name="reverseacct" type="checkbox" id="reverseacct" value="yes" <?php if ($pconfig['reverseacct']) echo "checked=\"checked\""; ?> /><strong><?=gettext("Invert Acct-Input-Octets and Acct-Output-Octets"); ?></strong><br />
927
				<?=gettext("When this is enabled, data counts for RADIUS accounting packets will be taken from the client perspective, not the NAS. Acct-Input-Octets will represent download, and Acct-Output-Octets will represent upload."); ?></td>
928
			</tr>
929

    
930
			<tr>
931
				<td class="vncell" valign="top"><?=gettext("NAS Identifier"); ?></td>
932
				<td class="vtable"><input name="radiusnasid" type="text" maxlength="253" class="formfld unknown" id="radiusnasid" value="<?=htmlspecialchars($pconfig['radiusnasid']);?>" /><br />
933
					<?=gettext("Specify a NAS identifier to override the default value") . " (" . php_uname("n") . ")"; ?></td>
934
			</tr>
935
			<tr>
936
				<td class="vncell" valign="top"><?=gettext("MAC address format"); ?></td>
937
				<td class="vtable">
938
					<select name="radmac_format" id="radmac_format">
939
						<option value="default"><?php echo gettext("default"); ?></option>
940
						<?php
941
						$macformats = array("singledash","ietf","cisco","unformatted");
942
						foreach ($macformats as $macformat) {
943
							if ($pconfig['radmac_format'] == $macformat) {
944
								echo "<option selected=\"selected\" value=\"$macformat\">",gettext($macformat),"</option>\n";
945
							} else {
946
								echo "<option value=\"$macformat\">",gettext($macformat),"</option>\n";
947
							}
948
						}
949
						?>
950
					</select><br />
951
					<?=gettext("This option changes the MAC address format used in the whole RADIUS system. Change this if you also"); ?>
952
					<?=gettext("need to change the username format for RADIUS MAC authentication."); ?><br />
953
					<?=gettext("default:"); ?> 00:11:22:33:44:55<br />
954
					<?=gettext("singledash:"); ?> 001122-334455<br />
955
					<?=gettext("ietf:"); ?> 00-11-22-33-44-55<br />
956
					<?=gettext("cisco:"); ?> 0011.2233.4455<br />
957
					<?=gettext("unformatted:"); ?> 001122334455
958
				</td>
959
			</tr>
960
		</table>
961
		</td>
962
	</tr>
963
	<tr>
964
		<td valign="top" class="vncell"><?=gettext("HTTPS login"); ?></td>
965
		<td class="vtable">
966
			<input name="httpslogin_enable" type="checkbox" class="formfld" id="httpslogin_enable" value="yes" onclick="enable_change(false)" <?php if($pconfig['httpslogin_enable']) echo "checked=\"checked\""; ?> />
967
			<strong><?=gettext("Enable HTTPS login"); ?></strong><br />
968
			<?=gettext("If enabled, the username and password will be transmitted over an HTTPS connection to protect against eavesdroppers. A server name and certificate must also be specified below."); ?></td>
969
	</tr>
970
	<tr>
971
		<td valign="top" class="vncell"><?=gettext("HTTPS server name"); ?> </td>
972
		<td class="vtable">
973
			<input name="httpsname" type="text" class="formfld unknown" id="httpsname" size="30" value="<?=htmlspecialchars($pconfig['httpsname']);?>" /><br />
974
			<?php printf(gettext("This name will be used in the form action for the HTTPS POST and should match the Common Name (CN) in your certificate (otherwise, the client browser will most likely display a security warning). Make sure captive portal clients can resolve this name in DNS and verify on the client that the IP resolves to the correct interface IP on %s."), $g['product_name']);?> </td>
975
	</tr>
976
	<tr id="ssl_opts">
977
		<td width="22%" valign="top" class="vncell"><?=gettext("SSL Certificate"); ?></td>
978
		<td width="78%" class="vtable">
979
			<?php if (count($a_cert)): ?>
980
			<select name="certref" id="certref" class="formselect">
981
				<?php
982
					foreach($a_cert as $cert):
983
						$selected = "";
984
						if ($pconfig['certref'] == $cert['refid'])
985
							$selected = " selected=\"selected\"";
986
				?>
987
				<option value="<?=$cert['refid'];?>"<?=$selected;?>><?=$cert['descr'];?></option>
988
			<?php endforeach; ?>
989
			</select>
990
			<?php else: ?>
991
				<b><?=gettext("No Certificates defined."); ?></b> <br />Create one under <a href="system_certmanager.php">System &gt; Cert Manager</a>.
992
			<?php endif; ?>
993
		</td>
994
	</tr>
995
	<tr>
996
		<td valign="top" class="vncell"><?=gettext("Disable HTTPS forwards"); ?></td>
997
		<td class="vtable">
998
			<input name="nohttpsforwards" type="checkbox" class="formfld" id="nohttpsforwards" value="yes" <?php if ($pconfig['nohttpsforwards']) echo "checked=\"checked\""; ?> />
999
			<strong><?=gettext("Disable HTTPS forwards"); ?></strong><br/>
1000
			<?=gettext("If this option is set, attempts to connect to SSL/HTTPS (Port 443) sites will not be forwarded to the captive portal.  This prevents certificate errors from being presented to the user even if HTTPS logins are enabled.  Users must attempt a connecton to an HTTP (Port 80) site to get forwarded to the captive portal. If HTTPS logins are enabled, the user will be redirected to the HTTPS login page."); ?></td>
1001
	</tr>
1002
	<tr>
1003
		<td width="22%" valign="top" class="vncell"><?=gettext("Portal page contents"); ?></td>
1004
		<td width="78%" class="vtable">
1005
		<?=$mandfldhtml;?><input type="file" name="htmlfile" class="formfld file" id="htmlfile" /><br />
1006
		<?php
1007
			list($host) = explode(":", $_SERVER['HTTP_HOST']);
1008
			$zoneid = $pconfig['zoneid'] ? $pconfig['zoneid'] : 8000;
1009
			if ($pconfig['httpslogin_enable']) {
1010
				$port = $pconfig['listenporthttps'] ? $pconfig['listenporthttps'] : ($zoneid + 8001);
1011
				$href = "https://{$host}:{$port}";
1012
			} else {
1013
				$port = $pconfig['listenporthttp']  ? $pconfig['listenporthttp']  : ($zoneid + 8000);
1014
				$href = "http://{$host}:{$port}";
1015
			}
1016
		?>
1017
		<?php if ($pconfig['page']['htmltext']): ?>
1018
		<a href="<?=$href?>" target="_blank"><?=gettext("View current page"); ?></a>
1019
		<br />
1020
		<a href="?zone=<?=$cpzone?>&amp;act=gethtmlhtml" target="_blank"><?=gettext("Download current page"); ?></a>
1021
		<br />
1022
		<a href="?zone=<?=$cpzone?>&amp;act=delhtmlhtml" onclick="return confirm('Do you really want to restore default page?')" target="_blank">
1023
			<?=gettext("Restore default portal page"); ?>
1024
		</a>
1025
		  <br />
1026
		  <br />
1027
		<?php endif; ?>
1028
			<?php
1029
				printf(
1030
					gettext('Upload an HTML/PHP file for the portal page here (leave blank to keep the current one). ' .
1031
							'Make sure to include a form (POST to %1$s) with a submit button (%2$s) and a hidden field with %3$s and %4$s. ' .
1032
							'Include the %5$s and %6$s and/or %7$s input fields if authentication is enabled, otherwise it will always fail.'),
1033
					'&quot;$PORTAL_ACTION$&quot;',
1034
					"name=&quot;accept&quot;",
1035
					"name=&quot;redirurl&quot;",
1036
					'value=&quot;$PORTAL_REDIRURL$&quot;',
1037
					"&quot;auth_user&quot;",
1038
					"&quot;auth_pass&quot;",
1039
					"&quot;auth_voucher&quot;");
1040
			?>
1041
			<?=gettext("Example code for the form:"); ?><br />
1042
		  <br />
1043
		  <tt>&lt;form method=&quot;post&quot; action=&quot;$PORTAL_ACTION$&quot;&gt;<br />
1044
		  &nbsp;&nbsp;&nbsp;&lt;input name=&quot;auth_user&quot; type=&quot;text&quot;&gt;<br />
1045
		  &nbsp;&nbsp;&nbsp;&lt;input name=&quot;auth_pass&quot; type=&quot;password&quot;&gt;<br />
1046
		  &nbsp;&nbsp;&nbsp;&lt;input name=&quot;auth_voucher&quot; type=&quot;text&quot;&gt;<br />
1047
		  &nbsp;&nbsp;&nbsp;&lt;input name=&quot;redirurl&quot; type=&quot;hidden&quot; value=&quot;$PORTAL_REDIRURL$&quot;&gt;<br />
1048
&nbsp;&nbsp;&nbsp;&lt;input name=&quot;accept&quot; type=&quot;submit&quot; value=&quot;Continue&quot;&gt;<br />
1049
		  &lt;/form&gt;</tt></td>
1050
	</tr>
1051
	<tr>
1052
	  <td width="22%" valign="top" class="vncell"><?=gettext("Authentication"); ?><br />
1053
		<?=gettext("error page"); ?><br />
1054
		<?=gettext("contents"); ?></td>
1055
	  <td class="vtable">
1056
		<input name="errfile" type="file" class="formfld file" id="errfile" /><br />
1057
		<?php if ($pconfig['page']['errtext']): ?>
1058
		<a href="?zone=<?=$cpzone?>&amp;act=viewerrhtml" target="_blank"><?=gettext("View current page"); ?></a>
1059
		<br />
1060
		<a href="?zone=<?=$cpzone?>&amp;act=geterrhtml" target="_blank"><?=gettext("Download current page"); ?></a>
1061
		<br />
1062
		<a href="?zone=<?=$cpzone?>&amp;act=delerrhtml" onclick="return confirm('Do you really want to restore default page?')" target="_blank">
1063
			<?=gettext("Restore default error page"); ?>
1064
		</a>
1065
		  <br />
1066
		  <br />
1067
		<?php endif; ?>
1068
<?=gettext("The contents of the HTML/PHP file that you upload here are displayed when an authentication error occurs. " .
1069
"You may include"); ?> &quot;$PORTAL_MESSAGE$&quot;, <?=gettext("which will be replaced by the error or reply messages from the RADIUS server, if any."); ?></td>
1070
	</tr>
1071
	<tr>
1072
	  <td width="22%" valign="top" class="vncell"><?=gettext("Logout"); ?><br />
1073
		<?=gettext("page"); ?><br />
1074
		<?=gettext("contents"); ?></td>
1075
	  <td class="vtable">
1076
		<input name="logoutfile" type="file" class="formfld file" id="logoutfile" /><br />
1077
		<?php if ($pconfig['page']['logouttext']): ?>
1078
		<a href="?zone=<?=$cpzone?>&amp;act=viewlogouthtml" target="_blank"><?=gettext("View current page"); ?></a>
1079
		<br />
1080
		<a href="?zone=<?=$cpzone?>&amp;act=getlogouthtml" target="_blank"><?=gettext("Download current page"); ?></a>
1081
		<br />
1082
		<a href="?zone=<?=$cpzone?>&amp;act=dellogouthtml" onclick="return confirm('Do you really want to restore default page?')" target="_blank">
1083
			<?=gettext("Restore default logout page"); ?>
1084
		</a>
1085
		  <br />
1086
		  <br />
1087
		<?php endif; ?>
1088
<?=gettext("The contents of the HTML/PHP file that you upload here are displayed on authentication success when the logout popup is enabled."); ?></td>
1089
	</tr>
1090
	<tr>
1091
	  <td width="22%" valign="top">&nbsp;</td>
1092
	  <td width="78%">
1093
		<?php echo "<input name='zone' id='zone' type='hidden' value='" . htmlspecialchars($cpzone) . "' />"; ?>
1094
		<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onclick="enable_change(true)" />
1095
		<a href="services_captiveportal_zones.php"><input name="Cancel" type="button" class="formbtn" value="<?=gettext("Cancel"); ?>" onclick="enable_change(true)" /></a>
1096
	  </td>
1097
	</tr>
1098
	<tr>
1099
	  <td width="22%" valign="top">&nbsp;</td>
1100
	  <td width="78%"><span class="vexpl"><span class="red"><strong><?=gettext("Note:"); ?><br />
1101
		</strong></span><?=gettext("Changing any settings on this page will disconnect all clients! Don't forget to enable the DHCP server on your captive portal interface! Make sure that the default/maximum DHCP lease time is higher than the timeout entered on this page. Also, the DNS forwarder needs to be enabled for DNS lookups by unauthenticated clients to work."); ?> </span></td>
1102
	</tr>
1103
  </table>
1104
  </td>
1105
  </tr>
1106
  </table>
1107
</form>
1108
<script type="text/javascript">
1109
//<![CDATA[
1110
enable_change(false);
1111
//]]>
1112
</script>
1113
<?php include("fend.inc"); ?>
1114
</body>
1115
</html>
(135-135/252)