diff --git a/html/includes/forms/parse-template-rules.inc.php b/html/includes/forms/parse-template-rules.inc.php index 199daa559..7211bc2b2 100644 --- a/html/includes/forms/parse-template-rules.inc.php +++ b/html/includes/forms/parse-template-rules.inc.php @@ -11,9 +11,9 @@ * option) any later version. Please see LICENSE.txt at the top level of * the source code distribution for details. */ -header('Content-type: application/json'); if (is_admin() === false) { + header('Content-type: text/plain'); die('ERROR: You need to be admin'); } @@ -25,5 +25,6 @@ if (is_numeric($template_id) && $template_id > 0) { } $output = array('rule_id' => $rules); + header('Content-type: application/json'); echo _json_encode($output); } diff --git a/html/includes/forms/schedule-maintenance.inc.php b/html/includes/forms/schedule-maintenance.inc.php index 661c9ba49..40a39e613 100644 --- a/html/includes/forms/schedule-maintenance.inc.php +++ b/html/includes/forms/schedule-maintenance.inc.php @@ -11,9 +11,9 @@ * option) any later version. Please see LICENSE.txt at the top level of * the source code distribution for details. */ -header('Content-type: application/json'); if (is_admin() === false) { + header('Content-type: text/plain'); die('ERROR: You need to be admin'); } @@ -129,5 +129,5 @@ else if ($sub_type == 'del-maintenance') { 'message' => $message, ); }//end if - +header('Content-type: application/json'); echo _json_encode($response); diff --git a/html/includes/forms/test-transport.inc.php b/html/includes/forms/test-transport.inc.php index 2486c71ca..81da4e40b 100644 --- a/html/includes/forms/test-transport.inc.php +++ b/html/includes/forms/test-transport.inc.php @@ -11,9 +11,9 @@ * option) any later version. Please see LICENSE.txt at the top level of * the source code distribution for details. */ -header('Content-type: application/json'); if (is_admin() === false) { + header('Content-type: text/plain'); die('ERROR: You need to be admin'); } @@ -51,5 +51,5 @@ if (file_exists($config['install_dir']."/includes/alerts/transport.".$transport. } } } - +header('Content-type: application/json'); echo _json_encode(array('status' => $status));