mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Allow for separate headers upon conditional
This commit is contained in:
@@ -11,9 +11,9 @@
|
|||||||
* option) any later version. Please see LICENSE.txt at the top level of
|
* option) any later version. Please see LICENSE.txt at the top level of
|
||||||
* the source code distribution for details.
|
* the source code distribution for details.
|
||||||
*/
|
*/
|
||||||
header('Content-type: application/json');
|
|
||||||
|
|
||||||
if (is_admin() === false) {
|
if (is_admin() === false) {
|
||||||
|
header('Content-type: text/plain');
|
||||||
die('ERROR: You need to be admin');
|
die('ERROR: You need to be admin');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,5 +35,6 @@ if (is_numeric($group_id) && $group_id > 0) {
|
|||||||
'desc' => $group['desc'],
|
'desc' => $group['desc'],
|
||||||
'pattern' => $group_split,
|
'pattern' => $group_split,
|
||||||
);
|
);
|
||||||
|
header('Content-type: application/json');
|
||||||
echo _json_encode($output);
|
echo _json_encode($output);
|
||||||
}
|
}
|
||||||
|
@@ -11,9 +11,9 @@
|
|||||||
* option) any later version. Please see LICENSE.txt at the top level of
|
* option) any later version. Please see LICENSE.txt at the top level of
|
||||||
* the source code distribution for details.
|
* the source code distribution for details.
|
||||||
*/
|
*/
|
||||||
header('Content-type: application/json');
|
|
||||||
|
|
||||||
if (is_admin() === false) {
|
if (is_admin() === false) {
|
||||||
|
header('Content-type: text/plain');
|
||||||
die('ERROR: You need to be admin');
|
die('ERROR: You need to be admin');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,5 +25,6 @@ if (is_numeric($group_id) && $group_id > 0) {
|
|||||||
'group_name' => $group['group_name'],
|
'group_name' => $group['group_name'],
|
||||||
'descr' => $group['descr'],
|
'descr' => $group['descr'],
|
||||||
);
|
);
|
||||||
|
header('Content-type: application/json');
|
||||||
echo _json_encode($output);
|
echo _json_encode($output);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user