summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xusr/local/www/services_captiveportal_ip_edit.php9
-rwxr-xr-xusr/local/www/services_captiveportal_mac_edit.php9
2 files changed, 12 insertions, 6 deletions
diff --git a/usr/local/www/services_captiveportal_ip_edit.php b/usr/local/www/services_captiveportal_ip_edit.php
index cf5145b..57e8476 100755
--- a/usr/local/www/services_captiveportal_ip_edit.php
+++ b/usr/local/www/services_captiveportal_ip_edit.php
@@ -111,10 +111,13 @@ if ($_POST) {
$ip['bw_up'] = $_POST['bw_up'];
if ($_POST['bw_down'])
$ip['bw_down'] = $_POST['bw_down'];
- if (isset($id) && $a_allowedips[$id])
+ if (isset($id) && $a_allowedips[$id]) {
+ $oldip = $a_allowedips[$id]['ip'];
$a_allowedips[$id] = $ip;
- else
+ } else {
+ $oldip = $ip['ip'];
$a_allowedips[] = $ip;
+ }
allowedips_sort();
write_config();
@@ -122,7 +125,7 @@ if ($_POST) {
if (isset($config['captiveportal']['enable']) && is_module_loaded("ipfw.ko")) {
$rules = "";
for ($i = 3; $i < 10; $i++)
- $rules .= "table {$i} delete {$ip['ip']}\n";
+ $rules .= "table {$i} delete {$oldip}\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}");
diff --git a/usr/local/www/services_captiveportal_mac_edit.php b/usr/local/www/services_captiveportal_mac_edit.php
index 0d46ec4..bc397b7 100755
--- a/usr/local/www/services_captiveportal_mac_edit.php
+++ b/usr/local/www/services_captiveportal_mac_edit.php
@@ -112,15 +112,18 @@ if ($_POST) {
$mac['descr'] = $_POST['descr'];
- if (isset($id) && $a_passthrumacs[$id])
+ if (isset($id) && $a_passthrumacs[$id]) {
+ $oldmac = $a_passthrumacs[$id]['mac'];
$a_passthrumacs[$id] = $mac;
- else
+ } else {
+ $oldmac = $mac['mac'];
$a_passthrumacs[] = $mac;
+ }
passthrumacs_sort();
write_config();
- $ruleno = captiveportal_get_ipfw_passthru_ruleno($mac['mac']);
+ $ruleno = captiveportal_get_ipfw_passthru_ruleno($oldmac);
if ($ruleno) {
captiveportal_free_ipfw_ruleno($ruleno);
$rules = "delete {$ruleno}\n";
OpenPOWER on IntegriCloud