Commit version 24.12.13800
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage graphs
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
@ -15,27 +15,27 @@
|
||||
// Define this is graph
|
||||
define('OBS_GRAPH', TRUE);
|
||||
|
||||
$start = microtime(TRUE); // Needs common.php
|
||||
$gstart = microtime(TRUE); // Needs common.php
|
||||
|
||||
include_once("../includes/sql-config.inc.php");
|
||||
|
||||
include($config['html_dir'] . "/includes/functions.inc.php");
|
||||
include_once("../includes/observium.inc.php");
|
||||
|
||||
if (isset($config['allow_unauth_graphs']) && $config['allow_unauth_graphs']) {
|
||||
$auth = TRUE; // hardcode auth for all with config function
|
||||
print_debug('Authentication bypassed by $config[\'allow_unauth_graphs\'].');
|
||||
$auth = TRUE; // hardcode auth for all with config function
|
||||
print_debug('Authentication bypassed by $config[\'allow_unauth_graphs\'].');
|
||||
} elseif (isset($config['allow_unauth_graphs_cidr']) && count($config['allow_unauth_graphs_cidr'])) {
|
||||
//if (match_network($_SERVER['REMOTE_ADDR'], $config['allow_unauth_graphs_cidr']))
|
||||
if (match_network(get_remote_addr($config['web_session_ip_by_header']), $config['allow_unauth_graphs_cidr'])) {
|
||||
$auth = TRUE; // hardcode authenticated for matched subnet
|
||||
print_debug("Authentication by matched CIDR.");
|
||||
}
|
||||
//if (match_network($_SERVER['REMOTE_ADDR'], $config['allow_unauth_graphs_cidr']))
|
||||
if (match_network(get_remote_addr($config['web_session_ip_by_header']), $config['allow_unauth_graphs_cidr'])) {
|
||||
$auth = TRUE; // hardcode authenticated for matched subnet
|
||||
print_debug("Authentication by matched CIDR.");
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($auth) || !$auth) {
|
||||
// Normal auth
|
||||
include($config['html_dir'] . "/includes/authenticate.inc.php");
|
||||
$auth = $_SESSION['authenticated'];
|
||||
// Normal auth
|
||||
include($config['html_dir'] . "/includes/authenticate.inc.php");
|
||||
$auth = $_SESSION['authenticated'];
|
||||
} elseif (!isset($_SESSION['userlevel']) && $auth) {
|
||||
$_SESSION['userlevel'] = 7; // Set global read for session when $auth hardcoded
|
||||
}
|
||||
|
||||
// Push $_GET into $vars to be compatible with web interface naming
|
||||
@ -44,8 +44,8 @@ $vars = get_vars('GET', $auth);
|
||||
|
||||
include($config['html_dir'] . "/includes/graphs/graph.inc.php");
|
||||
|
||||
$runtime = microtime(TRUE) - $start;
|
||||
$runtime = elapsed_time($gstart);
|
||||
|
||||
print_debug("Runtime ".$runtime." secs");
|
||||
print_debug("Runtime " . $runtime . " secs");
|
||||
|
||||
// EOF
|
||||
|
Reference in New Issue
Block a user