summaryrefslogtreecommitdiffstats
path: root/usr/local/www/services_captiveportal_mac.php
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-05-28 18:38:41 +0000
committerErmal <eri@pfsense.org>2010-05-28 18:38:41 +0000
commitfac13a5eb382ce8773e6897d06d28e06abe07179 (patch)
tree3ff60b435f61c2b777de9a3cd7efac89476d01fd /usr/local/www/services_captiveportal_mac.php
parent4fc68c5aa4f72e930d453266c7bfb166af057b18 (diff)
downloadpfsense-fac13a5eb382ce8773e6897d06d28e06abe07179.zip
pfsense-fac13a5eb382ce8773e6897d06d28e06abe07179.tar.gz
Add a function to find the mac address on a passthrough mac entry by username(if present) in the <username> tag of the entry.
Diffstat (limited to 'usr/local/www/services_captiveportal_mac.php')
-rwxr-xr-xusr/local/www/services_captiveportal_mac.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/usr/local/www/services_captiveportal_mac.php b/usr/local/www/services_captiveportal_mac.php
index 7c40b85..f7aa502 100755
--- a/usr/local/www/services_captiveportal_mac.php
+++ b/usr/local/www/services_captiveportal_mac.php
@@ -64,8 +64,15 @@ if ($_POST) {
clear_subsystem_dirty('passthrumac');
}
- if ($_POST['delmac'] && $_POST['postafterlogin']) {
- if (is_array($a_passthrumacs)) {
+ if ($_POST['postafterlogin']) {
+ if (!is_array($a_passthrumacs))
+ exit;
+ if ($_POST['username']) {
+ $mac = captiveportal_passthrumac_findbyname($_POST['username']);
+ if (!empty($mac))
+ $_POST['delmac'] = $mac['mac'];
+ }
+ if ($_POST['delmac']) {
$found = false;
foreach ($a_passthrumacs as $idx => $macent) {
if ($macent['mac'] == $_POST['delmac']) {
OpenPOWER on IntegriCloud