Fix unauthenticated graphs (#11879)

broken with security fix
This commit is contained in:
Tony Murray
2020-06-30 09:25:01 -05:00
committed by GitHub
parent c606659e11
commit b9f80d32bd

View File

@@ -17,8 +17,12 @@ $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');
if (!Auth::check()) {
// check for unauthenticated graphs and set auth
$auth = is_client_authorized($_SERVER['REMOTE_ADDR']);
if (!$auth) {
die('Unauthorized');
}
}
set_debug(isset($_GET['debug']));