summaryrefslogtreecommitdiffstats
path: root/usr/local/www/widgets/widgets
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-11-13 14:48:42 -0200
committerRenato Botelho <garga@FreeBSD.org>2014-11-13 14:50:23 -0200
commitb4e0f02b89fa6b8e8b22f31ee4486df171ae5337 (patch)
tree82bfb5ba7a3e076f0063b673e0b9d04f28a5b78f /usr/local/www/widgets/widgets
parent0cd7c91a29a88c3ac859be9ee9563e1737924128 (diff)
downloadpfsense-b4e0f02b89fa6b8e8b22f31ee4486df171ae5337.zip
pfsense-b4e0f02b89fa6b8e8b22f31ee4486df171ae5337.tar.gz
Make sure $cpzoneid is defined and use it to call pfSense_ipfw_Tableaction() and pfSense_ipfw_getTablestats(). Also fix fieldnames for captiveportal_hostnames. It should fix #4001
Diffstat (limited to 'usr/local/www/widgets/widgets')
-rw-r--r--usr/local/www/widgets/widgets/captive_portal_status.widget.php19
1 files changed, 13 insertions, 6 deletions
diff --git a/usr/local/www/widgets/widgets/captive_portal_status.widget.php b/usr/local/www/widgets/widgets/captive_portal_status.widget.php
index 6c699ab..4726ba1 100644
--- a/usr/local/www/widgets/widgets/captive_portal_status.widget.php
+++ b/usr/local/www/widgets/widgets/captive_portal_status.widget.php
@@ -47,10 +47,21 @@ require_once("captiveportal.inc");
<?php
-if (($_GET['act'] == "del") && (!empty($_GET['zone']))) {
- $cpzone = $_GET['zone'];
+if (!is_array($config['captiveportal']))
+ $config['captiveportal'] = array();
+$a_cp =& $config['captiveportal'];
+
+$cpzone = $_GET['zone'];
+if (isset($_POST['zone']))
+ $cpzone = $_POST['zone'];
+
+if (isset($cpzone) && !empty($cpzone) && isset($a_cp[$cpzone]['zoneid']))
+ $cpzoneid = $a_cp[$cpzone]['zoneid'];
+
+if (($_GET['act'] == "del") && !empty($cpzone) && isset($cpzoneid)) {
captiveportal_disconnect_client($_GET['id']);
}
+unset($cpzone);
flush();
@@ -59,10 +70,6 @@ function clientcmp($a, $b) {
return strcmp($a[$order], $b[$order]);
}
-if (!is_array($config['captiveportal']))
- $config['captiveportal'] = array();
-$a_cp =& $config['captiveportal'];
-
$cpdb_all = array();
foreach ($a_cp as $cpzone => $cp) {
OpenPOWER on IntegriCloud