diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-09-09 09:43:58 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-09-12 08:44:51 -0300 |
commit | 5eee375564b95e184b15c90ec0680d57172e496e (patch) | |
tree | b5ce2f7a3073763aeaca0f3df24f563fda5fb612 /etc | |
parent | 736c36c6745bb7823c061d06f58ae1169ef6649e (diff) | |
download | pfsense-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.inc | 16 |
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) { |