Allow for separate headers upon conditional

This commit is contained in:
pblasquez
2016-04-28 14:30:03 -07:00
parent c295283807
commit 71a57b6214
3 changed files with 6 additions and 3 deletions

View File

@@ -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');
}
@@ -32,5 +32,6 @@ if (is_numeric($map_id) && $map_id > 0) {
'rule' => $map['name'],
'target' => $map['target'],
);
header('Content-type: application/json');
echo _json_encode($output);
}