From fac13a5eb382ce8773e6897d06d28e06abe07179 Mon Sep 17 00:00:00 2001 From: Ermal Date: Fri, 28 May 2010 18:38:41 +0000 Subject: Add a function to find the mac address on a passthrough mac entry by username(if present) in the tag of the entry. --- usr/local/www/services_captiveportal_mac.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'usr') 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']) { -- cgit v1.1