2016-08-12 09:58:16 -05: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.
|
|
|
|
*/
|
|
|
|
|
2021-04-29 22:42:18 -05:00
|
|
|
use LibreNMS\Util\Debug;
|
|
|
|
|
2017-07-01 15:28:29 -05:00
|
|
|
session_start();
|
2019-10-26 00:29:12 +00:00
|
|
|
session_write_close();
|
2017-07-01 15:28:29 -05:00
|
|
|
if (isset($_SESSION['stage']) && $_SESSION['stage'] == 2) {
|
2020-09-21 14:54:51 +02:00
|
|
|
$init_modules = ['web', 'nodb'];
|
2017-07-01 15:28:29 -05:00
|
|
|
require realpath(__DIR__ . '/..') . '/includes/init.php';
|
|
|
|
} else {
|
2020-09-21 14:54:51 +02:00
|
|
|
$init_modules = ['web', 'auth', 'alerts'];
|
2017-07-01 15:28:29 -05:00
|
|
|
require realpath(__DIR__ . '/..') . '/includes/init.php';
|
2016-11-21 14:12:59 -06:00
|
|
|
|
2020-09-21 14:54:51 +02:00
|
|
|
if (! Auth::check()) {
|
|
|
|
exit('Unauthorized');
|
2017-07-01 15:28:29 -05:00
|
|
|
}
|
2016-11-21 14:12:59 -06:00
|
|
|
}
|
2016-08-12 09:58:16 -05:00
|
|
|
|
2021-04-29 22:42:18 -05:00
|
|
|
Debug::set($_REQUEST['debug']);
|
2019-04-11 23:26:42 -05:00
|
|
|
$id = basename($_REQUEST['id']);
|
2016-08-12 09:58:16 -05:00
|
|
|
|
2019-06-23 00:29:12 -05:00
|
|
|
if ($id && is_file(\LibreNMS\Config::get('install_dir') . "/includes/html/output/$id.inc.php")) {
|
|
|
|
require \LibreNMS\Config::get('install_dir') . "/includes/html/output/$id.inc.php";
|
2016-08-12 09:58:16 -05:00
|
|
|
}
|