summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-04-20 18:44:33 +0000
committerErmal <eri@pfsense.org>2010-04-20 18:44:33 +0000
commit68d0b70a5a4436d6de8016ade7aa7dc456db7b25 (patch)
tree72bac44ea49ad5bf79a9573516183b10d93a4000
parent1dbe445acc2b74c4a610e397c0c15031d99666e5 (diff)
downloadpfsense-68d0b70a5a4436d6de8016ade7aa7dc456db7b25.zip
pfsense-68d0b70a5a4436d6de8016ade7aa7dc456db7b25.tar.gz
Make pasthrough GUI code catch-up with the latest changes.
-rw-r--r--etc/inc/captiveportal.inc2
-rwxr-xr-xusr/local/www/services_captiveportal_mac.php12
2 files changed, 4 insertions, 10 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index b5bc8ac..be89ba5 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -1011,7 +1011,7 @@ function captiveportal_get_ipfw_ruleno_byvalue($value) {
if (file_exists("{$g['vardb_path']}/captiveportal.rules")) {
$rules = unserialize(file_get_contents("{$g['vardb_path']}/captiveportal.rules"));
- $ruleno = intval(`/sbin/ipfw show | /usr/bin/grep 00:0c:29:88:77:80 | /usr/bin/grep -v grep | /usr/bin/cut -d " " -f 1 | /usr/bin/head -n 1`);
+ $ruleno = intval(`/sbin/ipfw table 1 list | /usr/bin/grep {$value} | /usr/bin/grep -v grep | /usr/bin/cut -d " " -f 1 | /usr/bin/head -n 1`);
if ($rules[$ruleno])
return $ruleno;
}
diff --git a/usr/local/www/services_captiveportal_mac.php b/usr/local/www/services_captiveportal_mac.php
index b689a81..c653c0a 100755
--- a/usr/local/www/services_captiveportal_mac.php
+++ b/usr/local/www/services_captiveportal_mac.php
@@ -59,9 +59,6 @@ if ($_POST) {
$retval = 0;
$rules = captiveportal_passthrumac_configure();
- //file_put_contents("{$g['tmp_path']}/passthru.mac", $rules);
- //mwexec("/sbin/ipfw {$g['tmp_path']}/passthru.mac");
-
$savemsg = get_std_save_message($retval);
if ($retval == 0)
clear_subsystem_dirty('passthrumac');
@@ -70,12 +67,9 @@ if ($_POST) {
if ($_GET['act'] == "del") {
if ($a_passthrumacs[$_GET['id']]) {
- $ruleno = captiveportal_get_ipfw_ruleno_byvalue($a_passthrumacs[$_GET['id']]['mac']);
- if ($ruleno) {
- mwexec("/sbin/ipfw delete {$ruleno}");
- captiveportal_free_ipfw_ruleno($ruleno);
- $ruleno++;
- mwexec("/sbin/ipfw delete {$ruleno}");
+ $ip = captiveportal_get_ipfw_ruleno_byvalue($a_passthrumacs[$_GET['id']]['mac']);
+ if ($ip) {
+ captiveportal_disconnect_client($ip);
}
unset($a_passthrumacs[$_GET['id']]);
write_config();
OpenPOWER on IntegriCloud