diff options
author | Ermal <eri@pfsense.org> | 2010-04-20 21:16:28 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-04-20 21:16:28 +0000 |
commit | 9426cb034ac912f495d456a4eeede31bd5efacaa (patch) | |
tree | e495d77bc0a3e295c460437b15e5f5f825a1ed32 | |
parent | 921406213ffc27ef3806500694c27b3c767e4e00 (diff) | |
download | pfsense-9426cb034ac912f495d456a4eeede31bd5efacaa.zip pfsense-9426cb034ac912f495d456a4eeede31bd5efacaa.tar.gz |
Allow a passthrough mac to be deleted by a POST. Take the neccessary actions to disconnect and remove the mac from CP.
-rwxr-xr-x | usr/local/www/services_captiveportal_mac.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/usr/local/www/services_captiveportal_mac.php b/usr/local/www/services_captiveportal_mac.php index c653c0a..88ba019 100755 --- a/usr/local/www/services_captiveportal_mac.php +++ b/usr/local/www/services_captiveportal_mac.php @@ -63,6 +63,28 @@ if ($_POST) { if ($retval == 0) clear_subsystem_dirty('passthrumac'); } + + if ($_POST['delmac'] && $_POST['postafterlogin']) { + if (is_array($a_passthrumacs)) { + $found = false; + foreach ($a_passthrumacs as $idx => $macent) { + if ($macent['mac'] == $_POST['delmac']) { + $found = true; + break; + } + } + if ($found == true) { + $ip = captiveportal_get_ipfw_ruleno_byvalue($_POST['delmac']); + if ($ip) { + captiveportal_disconnect_client($ip); + } + unset($a_passthrumacs[$idx]); + write_config(); + captiveportal_passthrumac_configure(true); + } + } + exit; + } } if ($_GET['act'] == "del") { |