From f3c4dacf7d4247248b4c682813386ca196b07d09 Mon Sep 17 00:00:00 2001 From: pblasquez Date: Thu, 28 Apr 2016 14:38:20 -0700 Subject: [PATCH] Allow for separate headers upon conditional --- html/includes/forms/parse-device-group.inc.php | 3 ++- html/includes/forms/parse-poller-groups.inc.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/html/includes/forms/parse-device-group.inc.php b/html/includes/forms/parse-device-group.inc.php index b67af077f1..d8aa169a3d 100644 --- a/html/includes/forms/parse-device-group.inc.php +++ b/html/includes/forms/parse-device-group.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'); } @@ -35,5 +35,6 @@ if (is_numeric($group_id) && $group_id > 0) { 'desc' => $group['desc'], 'pattern' => $group_split, ); + header('Content-type: application/json'); echo _json_encode($output); } diff --git a/html/includes/forms/parse-poller-groups.inc.php b/html/includes/forms/parse-poller-groups.inc.php index 01d20a9612..0fb09eea6c 100644 --- a/html/includes/forms/parse-poller-groups.inc.php +++ b/html/includes/forms/parse-poller-groups.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($group_id) && $group_id > 0) { 'group_name' => $group['group_name'], 'descr' => $group['descr'], ); + header('Content-type: application/json'); echo _json_encode($output); }