summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-09-09 09:43:58 -0300
committerRenato Botelho <garga@FreeBSD.org>2013-09-12 08:44:51 -0300
commit5eee375564b95e184b15c90ec0680d57172e496e (patch)
treeb5ce2f7a3073763aeaca0f3df24f563fda5fb612 /etc
parent736c36c6745bb7823c061d06f58ae1169ef6649e (diff)
downloadpfsense-5eee375564b95e184b15c90ec0680d57172e496e.zip
pfsense-5eee375564b95e184b15c90ec0680d57172e496e.tar.gz
Make captiveportal_passthrumac_delete_entry() return rules instead of execute them as other similar functions do
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/captiveportal.inc16
1 files changed, 7 insertions, 9 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index da55c89..d76f5a0 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -959,31 +959,29 @@ function captiveportal_passthrumac_configure_entry($macent) {
}
function captiveportal_passthrumac_delete_entry($macent) {
- global $cpzone;
+ $rules = "";
$ruleno = captiveportal_get_ipfw_passthru_ruleno($macent['mac']);
if (!$ruleno)
- return false;
+ return $rules;
- $cmd = "/sbin/ipfw -x {$cpzone} delete {$ruleno}";
+ $rules .= "delete {$ruleno}\n";
captiveportal_free_ipfw_ruleno($ruleno, ($macent['action'] == 'block'));
if ($macent['action'] == 'pass') {
- $cmd .= "; /sbin/ipfw -x {$cpzone} delete " . ++$ruleno;
+ $rules .= "delete " . ++$ruleno . "\n";
$pipeno = captiveportal_get_dn_passthru_ruleno($macent['mac']);
if (!empty($pipeno)) {
captiveportal_free_dn_ruleno($pipeno);
- $cmd .= "; /sbin/ipfw -x {$cpzone} pipe delete " . $pipeno;
- $cmd .= "; /sbin/ipfw -x {$cpzone} pipe delete " . ++$pipeno;
+ $rules .= "pipe delete " . $pipeno . "\n";
+ $rules .= "pipe delete " . ++$pipeno . "\n";
}
}
- mwexec($cmd);
-
- return true;
+ return $rules;
}
function captiveportal_passthrumac_configure($lock = false) {
OpenPOWER on IntegriCloud