Issues (2963)

html/graph.php (1 issue)

1
<?php
2
/**
3
 * LibreNMS
4
 *
5
 *   This file is part of LibreNMS.
6
 *
7
 * @copyright  (C) 2006 - 2012 Adam Armstrong
8
 */
9
10
use LibreNMS\Data\Store\Datastore;
11
use LibreNMS\Util\Debug;
12
13
$auth = false;
14
$start = microtime(true);
15
16
$init_modules = ['web', 'graphs', 'auth'];
17
require realpath(__DIR__ . '/..') . '/includes/init.php';
18
19
if (! Auth::check()) {
20
    // check for unauthenticated graphs and set auth
21
    $auth = is_client_authorized($_SERVER['REMOTE_ADDR']);
22
    if (! $auth) {
0 ignored issues
show
The condition $auth is always true.
Loading history...
23
        exit('Unauthorized');
24
    }
25
}
26
27
Debug::set(isset($_GET['debug']));
28
29
require \LibreNMS\Config::get('install_dir') . '/includes/html/graphs/graph.inc.php';
30
31
Datastore::terminate();
32
33
if (Debug::isEnabled()) {
34
    echo '<br />';
35
    printf('Runtime %.3fs', microtime(true) - $start);
36
    echo '<br />';
37
    printStats();
38
}
39