commit version 23.9.13005

This commit is contained in:
2023-11-29 23:53:32 -05:00
parent b7f6a79c2c
commit fa8a702a67
4133 changed files with 2121180 additions and 965181 deletions

View File

@ -4,9 +4,9 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2023 Observium Limited
*
*/
@ -17,25 +17,25 @@ define('OBS_GRAPH', TRUE);
$start = 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
@ -46,6 +46,6 @@ include($config['html_dir'] . "/includes/graphs/graph.inc.php");
$runtime = microtime(TRUE) - $start;
print_debug("Runtime ".$runtime." secs");
print_debug("Runtime " . $runtime . " secs");
// EOF