Allow a passthrough mac to be deleted by a POST. Take the neccessary actions to disconnect and remove the mac from CP.

This commit is contained in:
Ermal 2010-04-20 21:16:28 +00:00
parent 921406213f
commit 9426cb034a

View File

@ -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") {