Files
librenms-librenms/html/graph.php
Jellyfrog 659325d5d0 Prevent unauthorized access to device graphs
Users could access info for the wrong device by piggyback on port permissions
2020-06-30 13:35:45 +02:00

36 lines
748 B
PHP

<?php
/**
* LibreNMS
*
* This file is part of LibreNMS.
*
* @package librenms
* @subpackage graphing
* @copyright (C) 2006 - 2012 Adam Armstrong
*/
use LibreNMS\Authentication\LegacyAuth;
use LibreNMS\Data\Store\Datastore;
$start = microtime(true);
$init_modules = array('web', 'graphs', 'auth');
require realpath(__DIR__ . '/..') . '/includes/init.php';
if (!(Auth::check() || is_client_authorized($_SERVER['REMOTE_ADDR']))) {
die('Unauthorized');
}
set_debug(isset($_GET['debug']));
require \LibreNMS\Config::get('install_dir') . '/includes/html/graphs/graph.inc.php';
Datastore::terminate();
if ($debug) {
echo '<br />';
printf("Runtime %.3fs", microtime(true) - $start);
echo '<br />';
printStats();
}