refactor: Don't access $_SESSION directly for Auth (#8513)

* Don't access $_SESSION directly for Auth

* fix style

* add property annotations
This commit is contained in:
Tony Murray
2018-04-07 15:55:28 -05:00
committed by Neil Lathwood
parent 2ece84495d
commit 7250376104
193 changed files with 949 additions and 510 deletions

View File

@@ -24,6 +24,8 @@
* @author f0o <f0o@devilcode.org>
*/
use LibreNMS\Authentication\Auth;
?>
<div class="container-fluid">
@@ -40,7 +42,7 @@
<?php
if (is_admin() === true) {
if (Auth::user()->hasGlobalAdmin()) {
echo '<ul class="nav nav-tabs">';
$pages = dbFetchRows("SELECT DISTINCT `config_group` FROM `config` WHERE `config_group` IS NOT NULL AND `config_group` != ''");
array_unshift($pages, array('config_group' => 'Global')); // Add Global tab
@@ -103,7 +105,7 @@ if (is_admin() === true) {
echo '<div class="table-responsive">' . a2t($config) . '</div>';
if ($debug && $_SESSION['userlevel'] >= '10') {
if ($debug && Auth::user()->hasGlobalAdmin()) {
echo("<pre>");
print_r($config);
echo("</pre>");