summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-03-13 20:13:37 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-03-13 20:13:37 +0000
commit87c8f2c991b68033295dfb2a59484f578ec5b8d3 (patch)
tree7aeea4183281322cacc1c443747951a13c7a86f2 /usr
parent3aed9904470fc5aaba737b969be8f910b1a85785 (diff)
downloadpfsense-87c8f2c991b68033295dfb2a59484f578ec5b8d3.zip
pfsense-87c8f2c991b68033295dfb2a59484f578ec5b8d3.tar.gz
Sync with Pascal's latest versin
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/captiveportal/index.php13
-rwxr-xr-xusr/local/www/fbegin.inc1
-rwxr-xr-xusr/local/www/services_captiveportal.php168
-rwxr-xr-xusr/local/www/services_captiveportal_ip.php17
-rwxr-xr-xusr/local/www/services_captiveportal_ip_edit.php15
-rwxr-xr-xusr/local/www/services_captiveportal_mac.php17
-rwxr-xr-xusr/local/www/services_captiveportal_mac_edit.php17
7 files changed, 51 insertions, 197 deletions
diff --git a/usr/local/captiveportal/index.php b/usr/local/captiveportal/index.php
index c51c073..1f35a57 100755
--- a/usr/local/captiveportal/index.php
+++ b/usr/local/captiveportal/index.php
@@ -106,19 +106,6 @@ if ($clientmac && portal_mac_fixed($clientmac)) {
readfile("{$g['varetc_path']}/captiveportal-error.html");
}
-} else if ($_POST['accept'] && $config['captiveportal']['auth_method']=="local") {
- //check against local usermanager
-
- //erase expired accounts
- if(trim($config['users'][$_POST['auth_user']]['expirationdate'])!="" && strtotime("-1 day")>strtotime($config['users'][$_POST['auth_user']]['expirationdate'])){
- unset($config['users'][$_POST['auth_user']]);
- write_config();
- }
- if($config['users'][$_POST['auth_user']]['password']==md5($_POST['auth_pass'])){
- portal_allow($clientip, $clientmac,$_POST['auth_user'],0,0);
- } else {
- readfile("{$g['varetc_path']}/captiveportal-error.html");
- }
} else if ($_POST['accept'] && $clientip) {
//KEYCOM: authorised up and down bandwidth defaults (set from webgui). If not set, use 128/128
if (isset($config['captiveportal']['peruserbw'])) {
diff --git a/usr/local/www/fbegin.inc b/usr/local/www/fbegin.inc
index 09571c9..76a1238 100755
--- a/usr/local/www/fbegin.inc
+++ b/usr/local/www/fbegin.inc
@@ -99,7 +99,6 @@ function showhide(tspan, tri) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/services_snmp.php" class="navlnk">SNMP</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/services_proxyarp.php" class="navlnk">Proxy ARP</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/services_captiveportal.php" class="navlnk">Captive portal</a><br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/services_usermanager.php" class="navlnk">User Manager</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/services_wol.php" class="navlnk">Wake on LAN</a><br>
<?php echo return_ext_menu("Services"); ?>
<strong>VPN</strong><br>
diff --git a/usr/local/www/services_captiveportal.php b/usr/local/www/services_captiveportal.php
index 63b47b8..01459fa 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
@@ -50,7 +50,6 @@ $pconfig['cinterface'] = $config['captiveportal']['interface'];
$pconfig['timeout'] = $config['captiveportal']['timeout'];
$pconfig['idletimeout'] = $config['captiveportal']['idletimeout'];
$pconfig['enable'] = isset($config['captiveportal']['enable']);
-$pconfig['auth_method'] = $config['captiveportal']['auth_method'];
$pconfig['radacct_enable'] = isset($config['captiveportal']['radacct_enable']);
$pconfig['httpslogin_enable'] = isset($config['captiveportal']['httpslogin']);
$pconfig['httpsname'] = $config['captiveportal']['httpsname'];
@@ -80,9 +79,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 +90,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 +100,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.";
}
@@ -129,7 +128,6 @@ if ($_POST) {
$config['captiveportal']['timeout'] = $_POST['timeout'];
$config['captiveportal']['idletimeout'] = $_POST['idletimeout'];
$config['captiveportal']['enable'] = $_POST['enable'] ? true : false;
- $config['captiveportal']['auth_method'] = $_POST['auth_method'];
$config['captiveportal']['radacct_enable'] = $_POST['radacct_enable'] ? true : false;
$config['captiveportal']['httpslogin'] = $_POST['httpslogin_enable'] ? true : false;
$config['captiveportal']['httpsname'] = $_POST['httpsname'];
@@ -149,15 +147,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,79 +166,19 @@ 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">
<!--
-function auth_method_change() {
- if (document.iform.auth_method[0].checked == false) {
- document.iform.logoutwin_enable.checked = 1;
- } else {
- document.iform.logoutwin_enable.checked = 0;
- }
- if (document.iform.auth_method[2].checked == false) {
- document.iform.radiusip.disabled = 1;
- document.iform.radiusport.disabled = 1;
- document.iform.radiuskey.disabled = 1;
- document.iform.radacct_enable.disabled = 1;
- document.iform.radiusacctport.disabled = 1;
- } else {
- document.iform.radiusip.disabled = 0;
- document.iform.radiusport.disabled = 0;
- document.iform.radiuskey.disabled = 0;
- document.iform.radacct_enable.disabled = 0;
- document.iform.radiusacctport.disabled = 0;
- }
-}
-
function radacct_change() {
if (document.iform.radacct_enable.checked) {
- auth_method_change();
- }
-}
-
-function enable_https() {
- if (document.iform.httpslogin_enable.checked == false) {
- document.iform.httpsname.disabled = 1;
- document.iform.cert.disabled = 1;
- document.iform.key.disabled = 1;
- } else {
- document.iform.httpsname.disabled = 0;
- document.iform.cert.disabled = 0;
- document.iform.key.disabled = 0;
- }
-}
-
-function enable_peruserbw() {
- if (document.iform.peruserbw.checked == false) {
- document.iform.bwauthmacdn.disabled = 1;
- document.iform.bwauthmacup.disabled = 1;
- document.iform.bwauthipdn.disabled = 1;
- document.iform.bwauthipup.disabled = 1;
- document.iform.bwdefaultdn.disabled = 1;
- document.iform.bwdefaultup.disabled = 1;
- } else {
- document.iform.bwauthmacdn.disabled = 0;
- document.iform.bwauthmacup.disabled = 0;
- document.iform.bwauthipdn.disabled = 0;
- document.iform.bwauthipup.disabled = 0;
- document.iform.bwdefaultdn.disabled = 0;
- document.iform.bwdefaultup.disabled = 0;
- }
+ document.iform.logoutwin_enable.checked = 1;
+ }
}
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;
@@ -249,37 +187,18 @@ function enable_change(enable_change) {
document.iform.radiusport.disabled = endis;
document.iform.radiuskey.disabled = endis;
document.iform.radacct_enable.disabled = endis;
- document.iform.auth_method[0].disabled = endis;
- document.iform.auth_method[1].disabled = endis;
- document.iform.auth_method[2].disabled = endis;
document.iform.httpslogin_enable.disabled = endis;
document.iform.httpsname.disabled = endis;
document.iform.cert.disabled = endis;
document.iform.key.disabled = endis;
document.iform.logoutwin_enable.disabled = endis;
document.iform.nomacfilter.disabled = endis;
- document.iform.peruserbw.disabled = endis;
- document.iform.bwauthmacdn.disabled = endis;
- document.iform.bwauthmacup.disabled = endis;
- document.iform.bwauthipdn.disabled = endis;
- document.iform.bwauthipup.disabled = endis;
- document.iform.bwdefaultdn.disabled = endis;
- document.iform.bwdefaultup.disabled = endis;
- document.iform.radiusacctport.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;
}
- if (enable_change && document.iform.auth_method[0].checked == false) {
- document.iform.logoutwin_enable.checked = 1;
- }
-
- auth_method_change();
- enable_https();
- enable_peruserbw();
-
}
//-->
</script>
@@ -297,13 +216,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">&nbsp;</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">
@@ -313,7 +232,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; ?>
@@ -327,16 +246,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>
@@ -359,7 +278,7 @@ to access after they've authenticated.</td>
<tr>
<td valign="top" class="vncell">Per-user bandwidth restriction</td>
<td class="vtable">
- <input name="peruserbw" type="checkbox" class="formfld" id="peruserbw" value="yes" <?php if ($pconfig['peruserbw']) echo "checked"; ?> onClick="enable_peruserbw()">
+ <input name="peruserbw" type="checkbox" class="formfld" id="peruserbw" value="yes" <?php if ($pconfig['peruserbw']) echo "checked"; ?>>
<strong>Enable per-user bandwidth restriction </strong><br><br>
<table cellpadding="0" cellspacing="0">
<tr>
@@ -367,7 +286,7 @@ to access after they've authenticated.</td>
<td><input type="text" class="formfld" id="bwauthmacdn" size="5" value="<?=htmlspecialchars($pconfig['bwauthmacdn']);?>"> Kbit/s</td>
</tr><tr>
<td>Pass-through MAC upload</td>
- <td><input type="text" class="formfld" id="bwauthmacup" size="5" value="<?=htmlspecialchars($pconfig['bwauthmacup']);?>"> Kbit/s</td>
+ <td><input type="text" class="formfld" id="bwauthmacdn" size="5" value="<?=htmlspecialchars($pconfig['bwauthmacup']);?>"> Kbit/s</td>
</tr><tr>
<td>Pass-through IP download</td>
<td><input type="text" class="formfld" id="bwauthipdn" size="5" value="<?=htmlspecialchars($pconfig['bwauthipdn']);?>"> Kbit/s</td>
@@ -384,19 +303,10 @@ 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:&nbsp;&nbsp;</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>
- </tr>
- <td>Local <a href="services_usermanager.php">Usermanager</a>:&nbsp;&nbsp;</td>
- <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>
- </tr>
- <td>RADIUS Authentication:&nbsp;&nbsp;</td>
- <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>
- </tr>
<tr>
<td>IP address:</td>
<td><input name="radiusip" type="text" class="formfld" id="radiusip" size="20" value="<?=htmlspecialchars($pconfig['radiusip']);?>"></td>
@@ -421,7 +331,7 @@ to access after they've authenticated.</td>
<tr>
<td valign="top" class="vncell">HTTPS login</td>
<td class="vtable">
- <input name="httpslogin_enable" type="checkbox" class="formfld" id="httpslogin_enable" value="yes" <?php if($pconfig['httpslogin_enable']) echo "checked"; ?> onClick="enable_https()">
+ <input name="httpslogin_enable" type="checkbox" class="formfld" id="httpslogin_enable" value="yes" <?php if($pconfig['httpslogin_enable']) echo "checked"; ?>>
<strong>Enable HTTPS login</strong><br>
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>
</tr>
@@ -445,12 +355,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; ?>
@@ -471,19 +381,19 @@ with a submit button (name=&quot;accept&quot;) 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">&nbsp;</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">&nbsp;</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>
diff --git a/usr/local/www/services_captiveportal_ip.php b/usr/local/www/services_captiveportal_ip.php
index b3d406a..1b7c68a 100755
--- a/usr/local/www/services_captiveportal_ip.php
+++ b/usr/local/www/services_captiveportal_ip.php
@@ -29,6 +29,7 @@
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Services", "Captive portal");
require("guiconfig.inc");
if (!is_array($config['captiveportal']['allowedip']))
@@ -67,17 +68,7 @@ if ($_GET['act'] == "del") {
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Services: Captive portal");?></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"); ?>
-<p class="pgtitle">Services: Captive portal: Allowed IP addresses</p>
<form action="services_captiveportal_ip.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_allowedipsdirty_path)): ?><p>
@@ -85,9 +76,9 @@ if ($_GET['act'] == "del") {
<input name="apply" type="submit" class="formbtn" id="apply" value="Apply changes"></p>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
- <li class="tabinact"><a href="services_captiveportal.php">Captive portal</a></li>
+ <li class="tabinact1"><a href="services_captiveportal.php">Captive portal</a></li>
<li class="tabinact"><a href="services_captiveportal_mac.php">Pass-through MAC</a></li>
<li class="tabact">Allowed IP addresses</li>
</ul>
@@ -148,5 +139,3 @@ if ($_GET['act'] == "del") {
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/usr/local/www/services_captiveportal_ip_edit.php b/usr/local/www/services_captiveportal_ip_edit.php
index 4b1cecf..85911e6 100755
--- a/usr/local/www/services_captiveportal_ip_edit.php
+++ b/usr/local/www/services_captiveportal_ip_edit.php
@@ -29,6 +29,7 @@
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Services", "Captive portal", "Edit allowed IP address");
require("guiconfig.inc");
if (!is_array($config['captiveportal']['allowedip']))
@@ -92,17 +93,7 @@ if ($_POST) {
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Services: Captive portal: Edit allowed IP 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"); ?>
-<p class="pgtitle">Services: Captive portal: Edit allowed IP address</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="services_captiveportal_ip_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
@@ -125,7 +116,7 @@ if ($_POST) {
<tr>
<td width="22%" valign="top" class="vncellreq">IP address</td>
<td width="78%" class="vtable">
- <input name="ip" type="text" class="formfld" id="ip" size="17" value="<?=htmlspecialchars($pconfig['ip']);?>">
+ <?=$mandfldhtml;?><input name="ip" type="text" class="formfld" id="ip" size="17" value="<?=htmlspecialchars($pconfig['ip']);?>">
<br>
<span class="vexpl">IP address</span></td>
</tr>
@@ -148,5 +139,3 @@ if ($_POST) {
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/usr/local/www/services_captiveportal_mac.php b/usr/local/www/services_captiveportal_mac.php
index d38c58c..69cf90a 100755
--- a/usr/local/www/services_captiveportal_mac.php
+++ b/usr/local/www/services_captiveportal_mac.php
@@ -29,6 +29,7 @@
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Services", "Captive portal");
require("guiconfig.inc");
if (!is_array($config['captiveportal']['passthrumac']))
@@ -67,17 +68,7 @@ if ($_GET['act'] == "del") {
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Services: Captive portal");?></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"); ?>
-<p class="pgtitle">Services: Captive portal: Pass-through MAC addresses</p>
<form action="services_captiveportal_mac.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_passthrumacsdirty_path)): ?><p>
@@ -85,9 +76,9 @@ if ($_GET['act'] == "del") {
<input name="apply" type="submit" class="formbtn" id="apply" value="Apply changes"></p>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
- <li class="tabinact"><a href="services_captiveportal.php">Captive portal</a></li>
+ <li class="tabinact1"><a href="services_captiveportal.php">Captive portal</a></li>
<li class="tabact">Pass-through MAC</li>
<li class="tabinact"><a href="services_captiveportal_ip.php">Allowed IP addresses</a></li>
</ul>
@@ -129,5 +120,3 @@ if ($_GET['act'] == "del") {
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
diff --git a/usr/local/www/services_captiveportal_mac_edit.php b/usr/local/www/services_captiveportal_mac_edit.php
index f763bac..f204d0f 100755
--- a/usr/local/www/services_captiveportal_mac_edit.php
+++ b/usr/local/www/services_captiveportal_mac_edit.php
@@ -29,6 +29,7 @@
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Services", "Captive portal", "Edit pass-through MAC address");
require("guiconfig.inc");
if (!is_array($config['captiveportal']['passthrumac']))
@@ -57,6 +58,8 @@ if ($_POST) {
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
+ $_POST['mac'] = str_replace("-", ":", $_POST['mac']);
+
if (($_POST['mac'] && !is_macaddr($_POST['mac']))) {
$input_errors[] = "A valid MAC address must be specified. [".$_POST['mac']."]";
}
@@ -90,24 +93,14 @@ 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"); ?>
-<p class="pgtitle">Services: Captive portal: Edit pass-through MAC address</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="services_captiveportal_mac_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq">MAC address</td>
<td width="78%" class="vtable">
- <input name="mac" type="text" class="formfld" id="mac" size="17" value="<?=htmlspecialchars($pconfig['mac']);?>">
+ <?=$mandfldhtml;?><input name="mac" type="text" class="formfld" id="mac" size="17" value="<?=htmlspecialchars($pconfig['mac']);?>">
<br>
<span class="vexpl">MAC address (6 hex octets separated by colons)</span></td>
</tr>
@@ -130,5 +123,3 @@ if ($_POST) {
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
OpenPOWER on IntegriCloud