From a21c0bccc43bd7df65ef6f3d9ad3821835751655 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Tue, 10 Apr 2018 10:56:22 -0500 Subject: [PATCH] fix: Fixed device group rule suggest, Auth before init (#8538) * Fix Auth before init * Fix Auth before init --- html/ajax_ossuggest.php | 7 +++---- html/ajax_rulesuggest.php | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/html/ajax_ossuggest.php b/html/ajax_ossuggest.php index 73d8fa0bb5..f3609a706f 100644 --- a/html/ajax_ossuggest.php +++ b/html/ajax_ossuggest.php @@ -17,14 +17,13 @@ use LibreNMS\Authentication\Auth; -session_start(); +$init_modules = array('web', 'auth'); +require realpath(__DIR__ . '/..') . '/includes/init.php'; + if (!Auth::check()) { die('Unauthorized.'); } -$init_modules = array('web'); -require realpath(__DIR__ . '/..') . '/includes/init.php'; - set_debug($_REQUEST['debug']); /** diff --git a/html/ajax_rulesuggest.php b/html/ajax_rulesuggest.php index 669ad0a655..3afe8006c8 100644 --- a/html/ajax_rulesuggest.php +++ b/html/ajax_rulesuggest.php @@ -25,14 +25,13 @@ use LibreNMS\Authentication\Auth; -session_start(); +$init_modules = array('web', 'auth'); +require realpath(__DIR__ . '/..') . '/includes/init.php'; + if (!Auth::check()) { die('Unauthorized.'); } -$init_modules = array('web'); -require realpath(__DIR__ . '/..') . '/includes/init.php'; - set_debug($_REQUEST['debug']); /**