Allow for separate headers upon conditional

This commit is contained in:
pblasquez
2016-04-28 14:38:20 -07:00
parent de03046936
commit f3c4dacf7d
2 changed files with 4 additions and 2 deletions
@@ -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);
}