summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/services_captiveportal_ip.php6
-rwxr-xr-xusr/local/www/services_captiveportal_ip_edit.php13
-rwxr-xr-xusr/local/www/services_captiveportal_mac.php2
-rwxr-xr-xusr/local/www/services_captiveportal_mac_edit.php2
4 files changed, 16 insertions, 7 deletions
diff --git a/usr/local/www/services_captiveportal_ip.php b/usr/local/www/services_captiveportal_ip.php
index 4d895cd..4aadde5 100755
--- a/usr/local/www/services_captiveportal_ip.php
+++ b/usr/local/www/services_captiveportal_ip.php
@@ -67,10 +67,12 @@ if ($_GET['act'] == "del") {
$ipent = $a_allowedips[$_GET['id']];
if (isset($config['captiveportal'][$cpzone]['enable'])) {
- if (!empty($ipent['sn']))
+ if (!empty($ipent['sn'])) {
+ $ipfw = pfSense_ipfw_getTablestats($cpzone, 3, $ipent['ip'], $ipent['sn']);
$ipent['ip'] .= "/{$ipent['sn']}";
+ } else
+ $ipfw = pfSense_ipfw_getTablestats($cpzone, 3, $ipent['ip']);
captiveportal_ipfw_set_context($cpzone);
- $ipfw = pfSense_ipfw_getTablestats($cpzone, 3, $ipent['ip']);
if (is_array($ipfw)) {
captiveportal_free_dn_ruleno($ipfw['dnpipe']);
pfSense_pipe_action("pipe delete {$ipfw['dnpipe']}");
diff --git a/usr/local/www/services_captiveportal_ip_edit.php b/usr/local/www/services_captiveportal_ip_edit.php
index 763ca90..2b86051 100755
--- a/usr/local/www/services_captiveportal_ip_edit.php
+++ b/usr/local/www/services_captiveportal_ip_edit.php
@@ -128,15 +128,16 @@ if ($_POST) {
$ip['bw_up'] = $_POST['bw_up'];
if ($_POST['bw_down'])
$ip['bw_down'] = $_POST['bw_down'];
+ $oldmask = "";
if (isset($id) && $a_allowedips[$id]) {
$oldip = $a_allowedips[$id]['ip'];
if (!empty($a_allowedips[$id]['sn']))
- $oldip .= "/{$a_allowedips[$id]['sn']}";
+ $oldmask .= "/{$a_allowedips[$id]['sn']}";
$a_allowedips[$id] = $ip;
} else {
$oldip = $ip['ip'];
if (!empty($ip['sn']))
- $oldip .= "/{$ip['sn']}";
+ $oldmask .= "/{$ip['sn']}";
$a_allowedips[] = $ip;
}
allowedips_sort();
@@ -144,9 +145,15 @@ if ($_POST) {
write_config();
if (isset($a_cp[$cpzone]['enable']) && is_module_loaded("ipfw.ko")) {
+ captiveportal_ipfw_set_context($cpzone);
+ if (is_ipaddr($oldip)) {
+ if (!empty($oldmask))
+ $ipfw = pfSense_ipfw_getTablestats($cpzone, 3, $oldip, $oldmask);
+ else
+ $ipfw = pfSense_ipfw_getTablestats($cpzone, 3, $oldip);
+ }
$rules = "table 3 delete {$oldip}";
$rules .= "table 4 delete {$oldip}";
- $ipfw = pfSense_ipfw_getTablestats($cpzone, 3, $oldip);
if (is_array($ipfw)) {
captiveportal_free_dn_ruleno($ipfw['dnpipe']);
$rules .= "pipe delete {$ipfw['dnpipe']}";
diff --git a/usr/local/www/services_captiveportal_mac.php b/usr/local/www/services_captiveportal_mac.php
index b9a8938..be4edae 100755
--- a/usr/local/www/services_captiveportal_mac.php
+++ b/usr/local/www/services_captiveportal_mac.php
@@ -130,7 +130,7 @@ if ($_GET['act'] == "del") {
$ruleno = captiveportal_get_ipfw_passthru_ruleno($a_passthrumacs[$_GET['id']]['mac']);
if ($ruleno) {
captiveportal_free_ipfw_ruleno($ruleno);
- $pipeno = captiveportal_get_dn_passthru_ruleno($_POST['delmac']);
+ $pipeno = captiveportal_get_dn_passthru_ruleno($a_passthrumacs[$_GET['id']]['mac']);
if ($pipeno)
captiveportal_free_dn_ruleno($pipeno);
captiveportal_ipfw_set_context($cpzone);
diff --git a/usr/local/www/services_captiveportal_mac_edit.php b/usr/local/www/services_captiveportal_mac_edit.php
index 90c2ee9..1ab89c1 100755
--- a/usr/local/www/services_captiveportal_mac_edit.php
+++ b/usr/local/www/services_captiveportal_mac_edit.php
@@ -144,7 +144,7 @@ if ($_POST) {
$ruleno = captiveportal_get_ipfw_passthru_ruleno($oldmac);
if ($ruleno) {
captiveportal_free_ipfw_ruleno($ruleno);
- $pipeno = captiveportal_get_dn_passthru_ruleno($_POST['delmac']);
+ $pipeno = captiveportal_get_dn_passthru_ruleno($oldmac);
if ($pipeno) {
captiveportal_free_dn_ruleno($pipeno);
$rules .= "pipe delete {$pipeno}\n";
OpenPOWER on IntegriCloud