2015-03-15 21:44:35 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* LibreNMS
|
|
|
|
*
|
|
|
|
* Copyright (c) 2014 Neil Lathwood <https://github.com/laf/ http://www.lathwood.co.uk/fa>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation, either version 3 of the License, or (at your
|
|
|
|
* option) any later version. Please see LICENSE.txt at the top level of
|
|
|
|
* the source code distribution for details.
|
|
|
|
*/
|
|
|
|
|
2019-08-05 14:16:05 -05:00
|
|
|
if (! Auth::user()->hasGlobalAdmin()) {
|
2016-08-18 20:28:22 -05:00
|
|
|
header('Content-type: text/plain');
|
2015-03-15 21:44:35 +00:00
|
|
|
exit('ERROR: You need to be admin');
|
|
|
|
}
|
|
|
|
|
2023-03-13 22:32:22 +01:00
|
|
|
$group_id = $_POST['group_id'];
|
2015-03-15 21:44:35 +00:00
|
|
|
|
|
|
|
if (is_numeric($group_id) && $group_id > 0) {
|
|
|
|
$group = dbFetchRow('SELECT * FROM `poller_groups` WHERE `id` = ? LIMIT 1', [$group_id]);
|
|
|
|
$output = [
|
|
|
|
'group_name' => $group['group_name'],
|
2024-01-05 05:39:12 +01:00
|
|
|
'descr' => $group['descr'],
|
2015-03-15 21:44:35 +00:00
|
|
|
];
|
2016-08-18 20:28:22 -05:00
|
|
|
header('Content-type: application/json');
|
2021-03-04 07:55:41 -06:00
|
|
|
echo json_encode($output, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
|
2015-03-15 21:44:35 +00:00
|
|
|
}
|