Project

General

Profile

Download (21.8 KB) Statistics
| Branch: | Tag: | Revision:
1
#!/usr/local/bin/php
2
<?php
3
/* $Id$ */
4
/*
5
	services_captiveportal.php
6
	part of m0n0wall (http://m0n0.ch/wall)
7

    
8
	Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
9
	All rights reserved.
10

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

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

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

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

    
33
$pgtitle = array("Services", "Captive portal");
34
require("guiconfig.inc");
35

    
36
if (!is_array($config['captiveportal'])) {
37
	$config['captiveportal'] = array();
38
	$config['captiveportal']['page'] = array();
39
	$config['captiveportal']['timeout'] = 60;
40
}
41

    
42
if ($_GET['act'] == "viewhtml") {
43
	echo base64_decode($config['captiveportal']['page']['htmltext']);
44
	exit;
45
} else if ($_GET['act'] == "viewerrhtml") {
46
	echo base64_decode($config['captiveportal']['page']['errtext']);
47
	exit;
48
}
49

    
50
$pconfig['cinterface'] = $config['captiveportal']['interface'];
51
$pconfig['timeout'] = $config['captiveportal']['timeout'];
52
$pconfig['idletimeout'] = $config['captiveportal']['idletimeout'];
53
$pconfig['enable'] = isset($config['captiveportal']['enable']);
54
$pconfig['auth_method'] = $config['captiveportal']['auth_method'];
55
$pconfig['radacct_enable'] = isset($config['captiveportal']['radacct_enable']);
56
$pconfig['httpslogin_enable'] = isset($config['captiveportal']['httpslogin']);
57
$pconfig['httpsname'] = $config['captiveportal']['httpsname'];
58
$pconfig['cert'] = base64_decode($config['captiveportal']['certificate']);
59
$pconfig['key'] = base64_decode($config['captiveportal']['private-key']);
60
$pconfig['logoutwin_enable'] = isset($config['captiveportal']['logoutwin_enable']);
61
$pconfig['nomacfilter'] = isset($config['captiveportal']['nomacfilter']);
62
$pconfig['peruserbw'] = isset($config['captiveportal']['peruserbw']);
63
$pconfig['bwauthmacup'] = $config['captiveportal']['bwauthmacup'];
64
$pconfig['bwauthmacdn'] = $config['captiveportal']['bwauthmacdn'];
65
$pconfig['bwauthipup'] = $config['captiveportal']['bwauthipup'];
66
$pconfig['bwauthipdn'] = $config['captiveportal']['bwauthipdn'];
67
$pconfig['bwdefaultup'] = $config['captiveportal']['bwdefaultup'];
68
$pconfig['bwdefaultdn'] = $config['captiveportal']['bwdefaultdn'];
69
$pconfig['redirurl'] = $config['captiveportal']['redirurl'];
70
$pconfig['radiusip'] = $config['captiveportal']['radiusip'];
71
$pconfig['radiusport'] = $config['captiveportal']['radiusport'];
72
$pconfig['radiusacctport'] = $config['captiveportal']['radiusacctport'];
73
$pconfig['radiuskey'] = $config['captiveportal']['radiuskey'];
74

    
75
if ($_POST) {
76

    
77
	unset($input_errors);
78
	$pconfig = $_POST;
79

    
80
	/* input validation */
81
	if ($_POST['enable']) {
82
		$config['captiveportal']['enable'] = $_POST['enable'] ? true : false;
83

    
84
		$reqdfields = explode(" ", "cinterface");
85
		$reqdfieldsn = explode(",", "Interface");
86

    
87
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
88

    
89
		/* make sure no interfaces are bridged */
90
		for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
91
			$coptif = &$config['interfaces']['opt' . $i];
92
			if (isset($coptif['enable']) && $coptif['bridge']) {
93
				$input_errors[] = "The captive portal cannot be used when one or more interfaces are bridged.";
94
				break;
95
			}
96
		}
97

    
98
		if ($_POST['httpslogin_enable']) {
99
		 	if (!$_POST['cert'] || !$_POST['key']) {
100
				$input_errors[] = "Certificate and key must be specified for HTTPS login.";
101
			} else {
102
				if (!strstr($_POST['cert'], "BEGIN CERTIFICATE") || !strstr($_POST['cert'], "END CERTIFICATE"))
103
					$input_errors[] = "This certificate does not appear to be valid.";
104
				if (!strstr($_POST['key'], "BEGIN RSA PRIVATE KEY") || !strstr($_POST['key'], "END RSA PRIVATE KEY"))
105
					$input_errors[] = "This key does not appear to be valid.";
106
			}
107

    
108
			if (!$_POST['httpsname'] || !is_domain($_POST['httpsname'])) {
109
				$input_errors[] = "The HTTPS server name must be specified for HTTPS login.";
110
			}
111
		}
112
	}
113

    
114
	if ($_POST['timeout'] && (!is_numeric($_POST['timeout']) || ($_POST['timeout'] < 1))) {
115
		$input_errors[] = "The timeout must be at least 1 minute.";
116
	}
117
	if ($_POST['idletimeout'] && (!is_numeric($_POST['idletimeout']) || ($_POST['idletimeout'] < 1))) {
118
		$input_errors[] = "The idle timeout must be at least 1 minute.";
119
	}
120
	if (($_POST['radiusip'] && !is_ipaddr($_POST['radiusip']))) {
121
		$input_errors[] = "A valid IP address must be specified. [".$_POST['radiusip']."]";
122
	}
123
	if (($_POST['radiusport'] && !is_port($_POST['radiusport']))) {
124
		$input_errors[] = "A valid port number must be specified. [".$_POST['radiusport']."]";
125
	}
126
	if (($_POST['radiusacctport'] && !is_port($_POST['radiusacctport']))) {
127
		$input_errors[] = "A valid port number must be specified. [".$_POST['radiusport']."]";
128
	}
129

    
130
	if (!$input_errors) {
131
		$config['captiveportal']['interface'] = $_POST['cinterface'];
132
		$config['captiveportal']['timeout'] = $_POST['timeout'];
133
		$config['captiveportal']['idletimeout'] = $_POST['idletimeout'];
134
		$config['captiveportal']['enable'] = $_POST['enable'] ? true : false;
135
		$config['captiveportal']['auth_method'] = $_POST['auth_method'];
136
		$config['captiveportal']['radacct_enable'] = $_POST['radacct_enable'] ? true : false;
137
		$config['captiveportal']['httpslogin'] = $_POST['httpslogin_enable'] ? true : false;
138
		$config['captiveportal']['httpsname'] = $_POST['httpsname'];
139
		$config['captiveportal']['certificate'] = base64_encode($_POST['cert']);
140
		$config['captiveportal']['private-key'] = base64_encode($_POST['key']);
141
		$config['captiveportal']['logoutwin_enable'] = $_POST['logoutwin_enable'] ? true : false;
142
		$config['captiveportal']['peruserbw'] = $_POST['peruserbw'] ? true : false;
143
		$config['captiveportal']['bwauthmacup'] = $_POST['bwauthmacup'];
144
		$config['captiveportal']['bwauthmacdn'] = $_POST['bwauthmacdn'];
145
		$config['captiveportal']['bwauthipup'] = $_POST['bwauthipup'];
146
		$config['captiveportal']['bwauthipdn'] = $_POST['bwauthipdn'];
147
		$config['captiveportal']['bwdefaultup'] = $_POST['bwdefaultup'];
148
		$config['captiveportal']['bwdefaultdn'] = $_POST['bwdefaultdn'];
149
		$config['captiveportal']['nomacfilter'] = $_POST['nomacfilter'] ? true : false;
150
		$config['captiveportal']['redirurl'] = $_POST['redirurl'];
151
		$config['captiveportal']['radiusip'] = $_POST['radiusip'];
152
		$config['captiveportal']['radiusport'] = $_POST['radiusport'];
153
		$config['captiveportal']['radiusacctport'] = $_POST['radiusacctport'];
154
		$config['captiveportal']['radiuskey'] = $_POST['radiuskey'];
155

    
156
		/* file upload? */
157
		if (is_uploaded_file($_FILES['htmlfile']['tmp_name']))
158
			$config['captiveportal']['page']['htmltext'] = base64_encode(file_get_contents($_FILES['htmlfile']['tmp_name']));
159
		if (is_uploaded_file($_FILES['errfile']['tmp_name'])) 
160
			$config['captiveportal']['page']['errtext'] = base64_encode(file_get_contents($_FILES['errfile']['tmp_name']));
161

    
162
		write_config();
163

    
164
		filter_configure();
165

    
166
		$retval = 0;
167
		if (!file_exists($d_sysrebootreqd_path)) {
168
			config_lock();
169
			$retval = captiveportal_configure();
170
			config_unlock();
171
		}
172
		$savemsg = get_std_save_message($retval);
173
	}
174
}
175

    
176
$pgtitle = "Services: Captive Portal";
177
include("head.inc");
178

    
179
?>
180

    
181
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
182
<?php include("fbegin.inc"); ?>
183
<script language="JavaScript">
184
<!--
185
function auth_method_change() {
186
	if (document.iform.auth_method[0].checked == false) {
187
		document.iform.logoutwin_enable.checked = 1;
188
	} else {
189
		document.iform.logoutwin_enable.checked = 0;
190
	}
191
	if (document.iform.auth_method[2].checked == false) {
192
		document.iform.radiusip.disabled = 1;
193
  	        document.iform.radiusport.disabled = 1;
194
  	        document.iform.radiuskey.disabled = 1;
195
  	        document.iform.radacct_enable.disabled = 1;
196
  	        document.iform.radiusacctport.disabled = 1;
197
	} else {
198
		document.iform.radiusip.disabled = 0;
199
  	        document.iform.radiusport.disabled = 0;
200
  	        document.iform.radiuskey.disabled = 0;
201
  	        document.iform.radacct_enable.disabled = 0;
202
  	        document.iform.radiusacctport.disabled = 0;
203
	}
204
}
205

    
206
function radacct_change() {
207
	if (document.iform.radacct_enable.checked) {
208
		auth_method_change();
209
	}
210
}
211

    
212
function enable_https() {
213
        if (document.iform.httpslogin_enable.checked == false) {
214
                document.iform.httpsname.disabled = 1;
215
                document.iform.cert.disabled = 1;
216
                document.iform.key.disabled = 1;
217
        } else {
218
                document.iform.httpsname.disabled = 0;
219
                document.iform.cert.disabled = 0;
220
                document.iform.key.disabled = 0;
221
        }
222
}
223

    
224
function enable_peruserbw() {
225
        if (document.iform.peruserbw.checked == false) {
226
                document.iform.bwauthmacdn.disabled = 1;
227
                document.iform.bwauthmacup.disabled = 1;
228
                document.iform.bwauthipdn.disabled = 1;
229
                document.iform.bwauthipup.disabled = 1;
230
                document.iform.bwdefaultdn.disabled = 1;
231
                document.iform.bwdefaultup.disabled = 1;
232
        } else {
233
                document.iform.bwauthmacdn.disabled = 0;
234
                document.iform.bwauthmacup.disabled = 0;
235
                document.iform.bwauthipdn.disabled = 0;
236
                document.iform.bwauthipup.disabled = 0;
237
                document.iform.bwdefaultdn.disabled = 0;
238
                document.iform.bwdefaultup.disabled = 0;
239
        }
240
} 
241

    
242
function enable_change(enable_change) {
243
	var endis;
244
	endis = !(document.iform.enable.checked || enable_change);
245

    
246
	document.iform.cinterface.disabled = endis;
247
	document.iform.idletimeout.disabled = endis;
248
	document.iform.timeout.disabled = endis;
249
	document.iform.redirurl.disabled = endis;
250
	document.iform.radiusip.disabled = endis;
251
	document.iform.radiusport.disabled = endis;
252
	document.iform.radiuskey.disabled = endis;
253
	document.iform.radacct_enable.disabled = endis;
254
	document.iform.auth_method[0].disabled = endis;
255
	document.iform.auth_method[1].disabled = endis;
256
	document.iform.auth_method[2].disabled = endis;
257
	document.iform.httpslogin_enable.disabled = endis;
258
	document.iform.httpsname.disabled = endis;
259
	document.iform.cert.disabled = endis;
260
	document.iform.key.disabled = endis;
261
	document.iform.logoutwin_enable.disabled = endis;
262
	//document.iform.nomacfilter.disabled = endis;
263
	document.iform.htmlfile.disabled = endis;
264
	document.iform.errfile.disabled = endis;
265

    
266
	if (enable_change && document.iform.radacct_enable.checked) {
267
		document.iform.logoutwin_enable.checked = 1;
268
	}
269
	if (enable_change && document.iform.auth_method[0].checked == false) {
270
		document.iform.logoutwin_enable.checked = 1;
271
	}
272

    
273
	auth_method_change();
274
	enable_https();
275
	//enable_peruserbw();
276

    
277
}
278
//-->
279
</script>
280
<?php if ($input_errors) print_input_errors($input_errors); ?>
281
<?php if ($savemsg) print_info_box($savemsg); ?>
282
<form action="services_captiveportal.php" method="post" enctype="multipart/form-data" name="iform" id="iform">
283
<div id="mainarea">
284
<table width="100%" border="0" cellpadding="0" cellspacing="0">
285
  <tr><td class="tabnavtbl">
286
<?php
287
	$tab_array = array();
288
	$tab_array[0] = array("Captive portal", true, "services_captiveportal.php");
289
	$tab_array[1] = array("Pass-through MAC", false, "services_captiveportal_mac.php");
290
	$tab_array[2] = array("Allowed IP addresses", false, "services_captiveportal_ip.php");
291
	$tab_array[3] = array("Users", false, "services_captiveportal_users.php");
292
	display_top_tabs($tab_array);
293
?>  
294
  </td></tr>
295
  <tr>
296
  <td class="tabcont">
297
  <table width="100%" border="0" cellpadding="6" cellspacing="0">
298
	<tr>
299
	  <td width="22%" valign="top" class="vtable">&nbsp;</td>
300
	  <td width="78%" class="vtable">
301
		<input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked"; ?> onClick="enable_change(false)">
302
		<strong>Enable captive portal </strong></td>
303
	</tr>
304
	<tr>
305
	  <td width="22%" valign="top" class="vncellreq">Interface</td>
306
	  <td width="78%" class="vtable">
307
		<select name="cinterface" class="formfld" id="cinterface">
308
		  <?php $interfaces = array('lan' => 'LAN');
309
		  for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
310
			if (isset($config['interfaces']['opt' . $i]['enable']))
311
				$interfaces['opt' . $i] = $config['interfaces']['opt' . $i]['descr'];
312
		  }
313
		  foreach ($interfaces as $iface => $ifacename): ?>
314
		  <option value="<?=$iface;?>" <?php if ($iface == $pconfig['cinterface']) echo "selected"; ?>>
315
		  <?=htmlspecialchars($ifacename);?>
316
		  </option>
317
		  <?php endforeach; ?>
318
		</select> <br>
319
		<span class="vexpl">Choose which interface to run the captive portal on.</span></td>
320
	</tr>
321
	<tr>
322
	  <td valign="top" class="vncell">Idle timeout</td>
323
	  <td class="vtable">
324
		<input name="idletimeout" type="text" class="formfld" id="idletimeout" size="6" value="<?=htmlspecialchars($pconfig['idletimeout']);?>">
325
minutes<br>
326
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>
327
	</tr>
328
	<tr>
329
	  <td width="22%" valign="top" class="vncell">Hard timeout</td>
330
	  <td width="78%" class="vtable">
331
		<input name="timeout" type="text" class="formfld" id="timeout" size="6" value="<?=htmlspecialchars($pconfig['timeout']);?>">
332
		minutes<br>
333
	  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>
334
	</tr>
335
	<tr>
336
	  <td width="22%" valign="top" class="vncell">Logout popup window</td>
337
	  <td width="78%" class="vtable">
338
		<input name="logoutwin_enable" type="checkbox" class="formfld" id="logoutwin_enable" value="yes" <?php if($pconfig['logoutwin_enable']) echo "checked"; ?>>
339
		<strong>Enable logout popup window</strong><br>
340
	  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. When RADIUS accounting is  enabled, this option is implied.</td>
341
	</tr>
342
	<tr>
343
	  <td valign="top" class="vncell">Redirection URL</td>
344
	  <td class="vtable">
345
		<input name="redirurl" type="text" class="formfld" id="redirurl" size="60" value="<?=htmlspecialchars($pconfig['redirurl']);?>">
346
		<br>
347
If you provide a URL here, clients will be redirected to that URL instead of the one they initially tried
348
to access after they've authenticated.</td>
349
	</tr>
350
	<tr>
351
	  <td width="22%" valign="top" class="vncell">RADIUS server</td>
352
	  <td width="78%" class="vtable">
353
		<table cellpadding="0" cellspacing="0">
354
		<td>No Authentication:&nbsp;&nbsp;</td>
355
 		<td><input name="auth_method" type="radio" id="auth_method" value="none" <?php if($pconfig['auth_method']!="local" || $pconfig['auth_method']!="radius") echo "checked"; ?> onClick="auth_method_change()"></td>
356
		</tr>
357
		<td>Local <a href="services_captiveportal_users.php">Usermanager</a>:&nbsp;&nbsp;</td>
358
 		<td><input name="auth_method" type="radio" id="auth_method" value="local" <?php if($pconfig['auth_method']=="local") echo "checked"; ?> onClick="auth_method_change()"></td>
359
		</tr>
360
		<td>RADIUS Authentication:&nbsp;&nbsp;</td>
361
 		<td><input name="auth_method" type="radio" id="auth_method" value="radius" <?php if($pconfig['auth_method']=="radius") echo "checked"; ?> onClick="auth_method_change()"></td>
362
		</tr>
363
		<tr>
364
		<td>IP address:</td>
365
		<td><input name="radiusip" type="text" class="formfld" id="radiusip" size="20" value="<?=htmlspecialchars($pconfig['radiusip']);?>"></td>
366
		</tr><tr>
367
		<td>Port:</td>
368
		<td><input name="radiusport" type="text" class="formfld" id="radiusport" size="5" value="<?=htmlspecialchars($pconfig['radiusport']);?>"></td>
369
		</tr><tr>
370
		<td>Shared secret:&nbsp;&nbsp;</td>
371
		<td><input name="radiuskey" type="text" class="formfld" id="radiuskey" size="16" value="<?=htmlspecialchars($pconfig['radiuskey']);?>"> </td>
372
 		</tr>
373
		<tr>
374
          <td>Accounting:&nbsp;&nbsp;</td>
375
          <td><input name="radacct_enable" type="checkbox" id="radacct_enable" value="yes" <?php if($pconfig['radacct_enable']) echo "checked"; ?> onClick="radacct_change()"></td>
376
		  </tr>
377
		<tr>
378
          <td>Accounting port:&nbsp;&nbsp;</td>
379
          <td><input name="radiusacctport" type="text" class="formfld" id="radiusacctport" size="5" value="<?=htmlspecialchars($pconfig['radiusacctport']);?>"></td>
380
		  </tr></table>
381
 		<br>
382
 	Enter the IP address and port of the RADIUS server which users of the captive portal have to authenticate against. Leave blank to disable RADIUS authentication. Leave port number blank to use the default port (1812). Leave the RADIUS shared secret blank to not use a RADIUS shared secret. RADIUS accounting packets will also be sent to the RADIUS server if  accounting is enabled (default port is 1813).
383
	</tr>
384
	<tr>
385
      <td valign="top" class="vncell">HTTPS login</td>
386
      <td class="vtable">
387
        <input name="httpslogin_enable" type="checkbox" class="formfld" id="httpslogin_enable" value="yes" <?php if($pconfig['httpslogin_enable']) echo "checked"; ?> onClick="enable_https()">
388
        <strong>Enable HTTPS login</strong><br>
389
    If enabled, the username and password will be transmitted over an HTTPS connection to protect against eavesdroppers. This option only applies when RADIUS authentication is used. A server name, certificate and matching private key must also be specified below.</td>
390
	  </tr>
391
	<tr>
392
      <td valign="top" class="vncell">HTTPS server name </td>
393
      <td class="vtable">
394
        <input name="httpsname" type="text" class="formfld" id="httpsname" size="30" value="<?=htmlspecialchars($pconfig['httpsname']);?>"><br>
395
    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. </td>
396
	  </tr>
397
	<tr>
398
      <td valign="top" class="vncell">HTTPS certificate</td>
399
      <td class="vtable">
400
        <textarea name="cert" cols="65" rows="7" id="cert" class="formpre"><?=htmlspecialchars($pconfig['cert']);?></textarea>
401
        <br>
402
    Paste a signed certificate in X.509 PEM format here.</td>
403
	  </tr>
404
	<tr>
405
      <td valign="top" class="vncell">HTTPS private key</td>
406
      <td class="vtable">
407
        <textarea name="key" cols="65" rows="7" id="key" class="formpre"><?=htmlspecialchars($pconfig['key']);?></textarea>
408
        <br>
409
    Paste an RSA private key in PEM format here.</td>
410
	  </tr>
411
	<tr>
412
	  <td width="22%" valign="top" class="vncellreq">Portal page contents</td>
413
	  <td width="78%" class="vtable">
414
		<?=$mandfldhtml;?><input type="file" name="htmlfile" class="formfld" id="htmlfile"><br>
415
		<?php if ($config['captiveportal']['page']['htmltext']): ?>
416
		<a href="?act=viewhtml" target="_blank">View current page</a>
417
		  <br>
418
		  <br>
419
		<?php endif; ?>
420
		  Upload an HTML file for the portal page here (leave blank to keep the current one). Make sure to include a form (POST to &quot;$PORTAL_ACTION$&quot;)
421
with a submit button (name=&quot;accept&quot;) and a hidden field with name=&quot;redirurl&quot; and value=&quot;$PORTAL_REDIRURL$&quot;. Include the &quot;auth_user&quot; and &quot;auth_pass&quot; input elements if RADIUS authentication is enabled. If RADIUS is enabled and no &quot;auth_user&quot; is present, authentication will always fail. If RADIUS is not enabled, you can omit both of these input elements. Example code for the form:<br>
422
		  <br>
423
		  <tt>&lt;form method=&quot;post&quot; action=&quot;$PORTAL_ACTION$&quot;&gt;<br>
424
		  &nbsp;&nbsp;&nbsp;&lt;input name=&quot;auth_user&quot; type=&quot;text&quot;&gt;<br>
425
		  &nbsp;&nbsp;&nbsp;&lt;input name=&quot;auth_pass&quot; type=&quot;password&quot;&gt;<br>
426
		  &nbsp;&nbsp;&nbsp;&lt;input name=&quot;redirurl&quot; type=&quot;hidden&quot; value=&quot;$PORTAL_REDIRURL$&quot;&gt;<br>
427
&nbsp;&nbsp;&nbsp;&lt;input name=&quot;accept&quot; type=&quot;submit&quot; value=&quot;Continue&quot;&gt;<br>
428
		  &lt;/form&gt;</tt></td>
429
	</tr>
430
	<tr>
431
	  <td width="22%" valign="top" class="vncell">Authentication<br>
432
		error page<br>
433
		contents</td>
434
	  <td class="vtable">
435
		<input name="errfile" type="file" class="formfld" id="errfile"><br>
436
		<?php if ($config['captiveportal']['page']['errtext']): ?>
437
		<a href="?act=viewerrhtml" target="_blank">View current page</a>
438
		  <br>
439
		  <br>
440
		<?php endif; ?>
441
The contents of the HTML file that you upload here are displayed when an authentication error occurs.</td>
442
	</tr>
443
	<tr>
444
	  <td width="22%" valign="top">&nbsp;</td>
445
	  <td width="78%">
446
		<input name="Submit" type="submit" class="formbtn" value="Save" onClick="enable_change(true)">
447
	  </td>
448
	</tr>
449
	<tr>
450
	  <td width="22%" valign="top">&nbsp;</td>
451
	  <td width="78%"><span class="vexpl"><span class="red"><strong>Note:<br>
452
		</strong></span>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>
453
	</tr>
454
  </table>
455
  </td>
456
  </tr>
457
  </table>
458
  </div>
459
</form>
460
<script language="JavaScript">
461
<!--
462
enable_change(false);
463
//-->
464
</script>
465
<?php include("fend.inc"); ?>
466
<script type="text/javascript">
467
NiftyCheck();
468
Rounded("div#mainarea","bl br","#FFF","#eeeeee","smooth");
469
</script>
470
</body>
471
</html>
(75-75/127)