mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	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:
		
				
					committed by
					
						
						Neil Lathwood
					
				
			
			
				
	
			
			
			
						parent
						
							2ece84495d
						
					
				
				
					commit
					7250376104
				
			@@ -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>");
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user