diff options
author | Ermal <eri@pfsense.org> | 2010-05-24 22:58:12 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-05-24 22:58:12 +0000 |
commit | d5c56d72260c089d4044c963eb471cd84359efa2 (patch) | |
tree | 702a2c4a7520fb4d40b8d2d8223848f283e21c98 /usr/local | |
parent | 0eb9b1b4a7f5c8455d5197fff121ddddfff4ad46 (diff) | |
download | pfsense-d5c56d72260c089d4044c963eb471cd84359efa2.zip pfsense-d5c56d72260c089d4044c963eb471cd84359efa2.tar.gz |
When editing a mac/ip passthru entry readd the rules again since values might have changed.
Diffstat (limited to 'usr/local')
-rwxr-xr-x | usr/local/www/services_captiveportal_ip_edit.php | 11 | ||||
-rwxr-xr-x | usr/local/www/services_captiveportal_mac_edit.php | 11 |
2 files changed, 18 insertions, 4 deletions
diff --git a/usr/local/www/services_captiveportal_ip_edit.php b/usr/local/www/services_captiveportal_ip_edit.php index 09d8075..cf5145b 100755 --- a/usr/local/www/services_captiveportal_ip_edit.php +++ b/usr/local/www/services_captiveportal_ip_edit.php @@ -120,10 +120,13 @@ if ($_POST) { write_config(); if (isset($config['captiveportal']['enable']) && is_module_loaded("ipfw.ko")) { - $rules = captiveportal_allowedip_configure_entry($ip); - file_put_contents("{$g['tmp_path']}/allowedip_tmp", $rules); - mwexec("/sbin/ipfw {$g['tmp_path']}/allowedip_tmp"); - @unlink("{$g['tmp_path']}/allowedip_tmp"); + $rules = ""; + for ($i = 3; $i < 10; $i++) + $rules .= "table {$i} delete {$ip['ip']}\n"; + $rules .= captiveportal_allowedip_configure_entry($ip); + file_put_contents("{$g['tmp_path']}/allowedip_tmp{$id}", $rules); + mwexec("/sbin/ipfw -q {$g['tmp_path']}/allowedip_tmp{$id}"); + @unlink("{$g['tmp_path']}/allowedip_tmp{$id}"); } header("Location: services_captiveportal_ip.php"); diff --git a/usr/local/www/services_captiveportal_mac_edit.php b/usr/local/www/services_captiveportal_mac_edit.php index ac7b341..0d46ec4 100755 --- a/usr/local/www/services_captiveportal_mac_edit.php +++ b/usr/local/www/services_captiveportal_mac_edit.php @@ -120,6 +120,17 @@ if ($_POST) { write_config(); + $ruleno = captiveportal_get_ipfw_passthru_ruleno($mac['mac']); + 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']}/tmpmacedit{$id}", $rules); + mwexec("/sbin/ipfw -q {$g['tmp_path']}/tmpmacedit{$id}"); + @unlink("{$g['tmp_path']}/tmpmacedit{$id}"); + } + header("Location: services_captiveportal_mac.php"); exit; } |