diff options
author | Ermal <eri@pfsense.org> | 2011-09-15 19:23:46 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2011-09-15 19:23:46 +0000 |
commit | 0dad12d86c315d0a9de2608023422fbac7504202 (patch) | |
tree | a2e05521610010c5a1f02e64d03da0f8782bfa45 /usr/local/www | |
parent | 7d3eeb8c2e88593aeec5a70f6aafc0a974663bed (diff) | |
download | pfsense-0dad12d86c315d0a9de2608023422fbac7504202.zip pfsense-0dad12d86c315d0a9de2608023422fbac7504202.tar.gz |
Do not try to add mac passthrough to a not loaded ipfw since the macs might be added to the wrong zone.
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/services_captiveportal_mac_edit.php | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/usr/local/www/services_captiveportal_mac_edit.php b/usr/local/www/services_captiveportal_mac_edit.php index 9f590cb..dc9f2a1 100755 --- a/usr/local/www/services_captiveportal_mac_edit.php +++ b/usr/local/www/services_captiveportal_mac_edit.php @@ -142,18 +142,20 @@ if ($_POST) { write_config(); - $ruleno = captiveportal_get_ipfw_passthru_ruleno($oldmac); - if ($ruleno) { - captiveportal_free_ipfw_ruleno($ruleno); - $rules = "delete {$ruleno}\n"; - $rules .= "delete " . ++$ruleno . "\n"; + if (isset($config['captiveportal'][$cpzone]['enable'])) { + $ruleno = captiveportal_get_ipfw_passthru_ruleno($oldmac); + if ($ruleno) { + captiveportal_free_ipfw_ruleno($ruleno); + $rules = "delete {$ruleno}\n"; + $rules .= "delete " . ++$ruleno . "\n"; + } + + $rules .= captiveportal_passthrumac_configure_entry($mac); + file_put_contents("{$g['tmp_path']}/{$cpzone}_tmpmacedit{$id}", $rules); + captiveportal_ipfw_set_context($cpzone); + mwexec("/sbin/ipfw -q {$g['tmp_path']}/{$cpzone}_tmpmacedit{$id}"); + @unlink("{$g['tmp_path']}/{$cpzone}_tmpmacedit{$id}"); } - - $rules .= captiveportal_passthrumac_configure_entry($mac); - file_put_contents("{$g['tmp_path']}/{$cpzone}_tmpmacedit{$id}", $rules); - captiveportal_ipfw_set_context($cpzone); - mwexec("/sbin/ipfw -q {$g['tmp_path']}/{$cpzone}_tmpmacedit{$id}"); - @unlink("{$g['tmp_path']}/{$cpzone}_tmpmacedit{$id}"); header("Location: services_captiveportal_mac.php?zone={$cpzone}"); exit; |