From 3378289af3f39b231de2c26e298d85d3eca4c835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20LU=C3=87I?= Date: Fri, 19 Jun 2015 17:35:31 +0200 Subject: Ticket #4746 Correctly set global variables to be used by hostnames cod epaths --- usr/local/www/services_captiveportal_hostname_edit.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/services_captiveportal_hostname_edit.php b/usr/local/www/services_captiveportal_hostname_edit.php index dc33739..674e220 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"; @@ -64,6 +66,7 @@ $cpzone = $_GET['zone']; if (isset($_POST['zone'])) { $cpzone = $_POST['zone']; } +$cpzoneid = $config['captiveportal'][$cpzone]['zoneid']; if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) { header("Location: services_captiveportal_zones.php"); @@ -154,8 +157,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}"); -- cgit v1.1