diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-03-07 23:40:21 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-03-07 23:40:21 +0000 |
commit | 3d8deb419553e844c21e32b66242b5484c5c298e (patch) | |
tree | cec5f1c7c0409dd3ba72f8b062d8c354075c52af /usr/local/www/services_captiveportal.php | |
parent | c50411a24aef7e32062a3ba22cf3249df8f4c4df (diff) | |
download | pfsense-3d8deb419553e844c21e32b66242b5484c5c298e.zip pfsense-3d8deb419553e844c21e32b66242b5484c5c298e.tar.gz |
Add pfSense header back. 1.2b6 has moved the header information to fbegin.inc
Diffstat (limited to 'usr/local/www/services_captiveportal.php')
-rwxr-xr-x | usr/local/www/services_captiveportal.php | 79 |
1 files changed, 44 insertions, 35 deletions
diff --git a/usr/local/www/services_captiveportal.php b/usr/local/www/services_captiveportal.php index 8265a6d..49018b9 100755 --- a/usr/local/www/services_captiveportal.php +++ b/usr/local/www/services_captiveportal.php @@ -1,22 +1,22 @@ #!/usr/local/bin/php -<?php +<?php /* services_captiveportal.php part of m0n0wall (http://m0n0.ch/wall) - + Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>. All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE @@ -80,9 +80,9 @@ if ($_POST) { if ($_POST['enable']) { $reqdfields = explode(" ", "cinterface"); $reqdfieldsn = explode(",", "Interface"); - + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); - + /* make sure no interfaces are bridged */ for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) { $coptif = &$config['interfaces']['opt' . $i]; @@ -91,7 +91,7 @@ if ($_POST) { break; } } - + if ($_POST['httpslogin_enable']) { if (!$_POST['cert'] || !$_POST['key']) { $input_errors[] = "Certificate and key must be specified for HTTPS login."; @@ -101,13 +101,13 @@ if ($_POST) { if (!strstr($_POST['key'], "BEGIN RSA PRIVATE KEY") || !strstr($_POST['key'], "END RSA PRIVATE KEY")) $input_errors[] = "This key does not appear to be valid."; } - + if (!$_POST['httpsname'] || !is_domain($_POST['httpsname'])) { $input_errors[] = "The HTTPS server name must be specified for HTTPS login."; } } } - + if ($_POST['timeout'] && (!is_numeric($_POST['timeout']) || ($_POST['timeout'] < 1))) { $input_errors[] = "The timeout must be at least 1 minute."; } @@ -149,15 +149,15 @@ if ($_POST) { $config['captiveportal']['radiusport'] = $_POST['radiusport']; $config['captiveportal']['radiusacctport'] = $_POST['radiusacctport']; $config['captiveportal']['radiuskey'] = $_POST['radiuskey']; - + /* file upload? */ if (is_uploaded_file($_FILES['htmlfile']['tmp_name'])) $config['captiveportal']['page']['htmltext'] = base64_encode(file_get_contents($_FILES['htmlfile']['tmp_name'])); if (is_uploaded_file($_FILES['errfile']['tmp_name'])) $config['captiveportal']['page']['errtext'] = base64_encode(file_get_contents($_FILES['errfile']['tmp_name'])); - + write_config(); - + $retval = 0; if (!file_exists($d_sysrebootreqd_path)) { config_lock(); @@ -168,6 +168,15 @@ if ($_POST) { } } ?> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> +<head> +<title><?=gentitle("Services: Captive portal: Edit pass-through MAC address");?></title> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> +<link href="gui.css" rel="stylesheet" type="text/css"> +</head> + +<body link="#0000CC" vlink="#0000CC" alink="#0000CC"> <?php include("fbegin.inc"); ?> <script language="JavaScript"> <!-- @@ -181,13 +190,13 @@ function auth_method_change() { function radacct_change() { if (document.iform.radacct_enable.checked) { auth_method_change(); - } + } } function enable_change(enable_change) { var endis; endis = !(document.iform.enable.checked || enable_change); - + document.iform.cinterface.disabled = endis; document.iform.idletimeout.disabled = endis; document.iform.timeout.disabled = endis; @@ -207,7 +216,7 @@ function enable_change(enable_change) { document.iform.nomacfilter.disabled = endis; document.iform.htmlfile.disabled = endis; document.iform.errfile.disabled = endis; - + if (enable_change && document.iform.radacct_enable.checked) { document.iform.logoutwin_enable.checked = 1; } @@ -231,13 +240,13 @@ function enable_change(enable_change) { <tr> <td class="tabcont"> <table width="100%" border="0" cellpadding="6" cellspacing="0"> - <tr> + <tr> <td width="22%" valign="top" class="vtable"> </td> <td width="78%" class="vtable"> <input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked"; ?> onClick="enable_change(false)"> <strong>Enable captive portal </strong></td> </tr> - <tr> + <tr> <td width="22%" valign="top" class="vncellreq">Interface</td> <td width="78%" class="vtable"> <select name="cinterface" class="formfld" id="cinterface"> @@ -247,7 +256,7 @@ function enable_change(enable_change) { $interfaces['opt' . $i] = $config['interfaces']['opt' . $i]['descr']; } foreach ($interfaces as $iface => $ifacename): ?> - <option value="<?=$iface;?>" <?php if ($iface == $pconfig['cinterface']) echo "selected"; ?>> + <option value="<?=$iface;?>" <?php if ($iface == $pconfig['cinterface']) echo "selected"; ?>> <?=htmlspecialchars($ifacename);?> </option> <?php endforeach; ?> @@ -261,16 +270,16 @@ function enable_change(enable_change) { minutes<br> 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> </tr> - <tr> + <tr> <td width="22%" valign="top" class="vncell">Hard timeout</td> - <td width="78%" class="vtable"> - <input name="timeout" type="text" class="formfld" id="timeout" size="6" value="<?=htmlspecialchars($pconfig['timeout']);?>"> + <td width="78%" class="vtable"> + <input name="timeout" type="text" class="formfld" id="timeout" size="6" value="<?=htmlspecialchars($pconfig['timeout']);?>"> minutes<br> 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> </tr> - <tr> + <tr> <td width="22%" valign="top" class="vncell">Logout popup window</td> - <td width="78%" class="vtable"> + <td width="78%" class="vtable"> <input name="logoutwin_enable" type="checkbox" class="formfld" id="logoutwin_enable" value="yes" <?php if($pconfig['logoutwin_enable']) echo "checked"; ?>> <strong>Enable logout popup window</strong><br> 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> @@ -318,9 +327,9 @@ to access after they've authenticated.</td> <br> If this option is set, the captive portal will restrict each user who logs in to a specific bandwidth as set in RADIUS. Your RADIUS server must return the attributes Nomadix-Bw-Up and Nomadix-Bw-Down (1 and 2 VSAs from Vendor 3309, Nomadix) along with Access-Accept for this to work. Bandwidth is set in Kbit/s. You can control pass-through and default bandwidths above.</td> </tr> - <tr> + <tr> <td width="22%" valign="top" class="vncell">RADIUS server</td> - <td width="78%" class="vtable"> + <td width="78%" class="vtable"> <table cellpadding="0" cellspacing="0"> <td>No Authentication: </td> <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> @@ -379,12 +388,12 @@ to access after they've authenticated.</td> <br> Paste an RSA private key in PEM format here.</td> </tr> - <tr> + <tr> <td width="22%" valign="top" class="vncellreq">Portal page contents</td> - <td width="78%" class="vtable"> + <td width="78%" class="vtable"> <?=$mandfldhtml;?><input type="file" name="htmlfile" class="formfld" id="htmlfile"><br> <?php if ($config['captiveportal']['page']['htmltext']): ?> - <a href="?act=viewhtml" target="_blank">View current page</a> + <a href="?act=viewhtml" target="_blank">View current page</a> <br> <br> <?php endif; ?> @@ -405,19 +414,19 @@ with a submit button (name="accept") and a hidden field with name=&quo <td class="vtable"> <input name="errfile" type="file" class="formfld" id="errfile"><br> <?php if ($config['captiveportal']['page']['errtext']): ?> - <a href="?act=viewerrhtml" target="_blank">View current page</a> + <a href="?act=viewerrhtml" target="_blank">View current page</a> <br> <br> <?php endif; ?> The contents of the HTML file that you upload here are displayed when a RADIUS authentication error occurs.</td> </tr> - <tr> + <tr> <td width="22%" valign="top"> </td> - <td width="78%"> - <input name="Submit" type="submit" class="formbtn" value="Save" onClick="enable_change(true)"> + <td width="78%"> + <input name="Submit" type="submit" class="formbtn" value="Save" onClick="enable_change(true)"> </td> </tr> - <tr> + <tr> <td width="22%" valign="top"> </td> <td width="78%"><span class="vexpl"><span class="red"><strong>Note:<br> </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> |