summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal LUÇI <eri@pfsense.org>2015-06-19 17:33:19 +0200
committerErmal LUÇI <eri@pfsense.org>2015-06-19 17:33:19 +0200
commitfabb4b0321514813bbb0307671c8605c7c1b36e0 (patch)
treebd877a5ce3ad66e681bb62ea8a617efcb1d1d54a
parent7dc35024af3af1d644c25b002ca9f40f1d61c05b (diff)
downloadpfsense-fabb4b0321514813bbb0307671c8605c7c1b36e0.zip
pfsense-fabb4b0321514813bbb0307671c8605c7c1b36e0.tar.gz
Ticket #4746 Correctly set global variables to be used by hostnames cod epaths
-rw-r--r--etc/inc/captiveportal.inc4
-rw-r--r--usr/local/www/services_captiveportal_hostname_edit.php6
2 files changed, 6 insertions, 4 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index 87a4a74..5ed4b3f 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -1117,7 +1117,7 @@ function captiveportal_allowedip_configure_entry($ipent, $ishostname = false) {
}
function captiveportal_allowedhostname_configure() {
- global $config, $g, $cpzone;
+ global $config, $g, $cpzone, $cpzoneid;
$rules = "";
if (is_array($config['captiveportal'][$cpzone]['allowedhostname'])) {
@@ -1134,7 +1134,7 @@ function captiveportal_allowedhostname_configure() {
if (isvalidpid("{$g['varrun_path']}/filterdns-{$cpzone}-cpah.pid"))
sigkillbypid("{$g['varrun_path']}/filterdns-{$cpzone}-cpah.pid", "HUP");
else
- mwexec("/usr/local/sbin/filterdns -p {$g['varrun_path']}/filterdns-{$cpzone}-cpah.pid -i 300 -c {$cp_filterdns_filename} -y {$cpzone} -d 1");
+ mwexec("/usr/local/sbin/filterdns -p {$g['varrun_path']}/filterdns-{$cpzone}-cpah.pid -i 300 -c {$cp_filterdns_filename} -y {$cpzoneid} -d 1");
} else {
killbypid("{$g['varrun_path']}/filterdns-{$cpzone}-cpah.pid");
@unlink("{$g['varrun_path']}/filterdns-{$cpzone}-cpah.pid");
diff --git a/usr/local/www/services_captiveportal_hostname_edit.php b/usr/local/www/services_captiveportal_hostname_edit.php
index 9d7c7d6..9eff9d0 100644
--- a/usr/local/www/services_captiveportal_hostname_edit.php
+++ b/usr/local/www/services_captiveportal_hostname_edit.php
@@ -57,6 +57,8 @@ require_once("filter.inc");
require("shaper.inc");
require("captiveportal.inc");
+global $cpzone, $cpzoneid;
+
$pgtitle = array(gettext("Services"),gettext("Captive portal"),gettext("Edit allowed Hostname"));
$shortcut_section = "captiveportal";
@@ -68,6 +70,7 @@ if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) {
header("Location: services_captiveportal_zones.php");
exit;
}
+$cpzoneid = $config['captiveportal'][$cpzone]['zoneid'];
if (!is_array($config['captiveportal']))
$config['captiveportal'] = array();
@@ -142,8 +145,7 @@ if ($_POST) {
$rules = captiveportal_allowedhostname_configure();
@file_put_contents("{$g['tmp_path']}/hostname_rules", $rules);
- $cpzoneid = $a_cp[$cpzone]['zoneid'];
- mwexec("/sbin/ipfw -x {$cpzoneid} {$g['tmp_path']}/hostname_rules");
+ mwexec("/sbin/ipfw -x {$cpzoneid} {$g['tmp_path']}/hostname_rules", true);
unset($rules);
header("Location: services_captiveportal_hostname.php?zone={$cpzone}");
OpenPOWER on IntegriCloud