Files

37 lines
1.0 KiB
PHP
Raw Permalink Normal View History

<?php
/*
* LibreNMS
*
* Copyright (c) 2014 Neil Lathwood <https://github.com/laf/ http://www.lathwood.co.uk/fa>
* Copyright (c) 2017 Tony Murray <https://github.com/murrant/>
*
* 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.
*/
$init_modules = array('web', 'auth');
require realpath(__DIR__ . '/..') . '/includes/init.php';
if (!Auth::check()) {
2019-04-11 23:26:42 -05:00
die('Unauthorized');
}
set_debug($_REQUEST['debug']);
2019-04-11 23:26:42 -05:00
$type = basename($_REQUEST['type']);
2019-04-11 23:26:42 -05:00
if ($type && file_exists("includes/html/list/$type.inc.php")) {
header('Content-type: application/json');
2019-04-11 23:26:42 -05:00
list($results, $more) = include "includes/html/list/$type.inc.php";
die(json_encode([
'results' => $results,
'pagination' => ['more' => $more]
]));
}