mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Remove legacy auth usage of $_SESSION (#10491)
* Remove auth use of $_SESSION Will break plugins that depend on $_SESSION, Weathermap was already fixed. Port them to use Auth::check()/Auth::user()/Auth:id() * revert accidental replacement
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
<?php
|
||||
|
||||
use LibreNMS\Authentication\LegacyAuth;
|
||||
|
||||
$param = array();
|
||||
|
||||
$sql .= ' FROM `ipv4_mac` AS M, `ports` AS P, `devices` AS D ';
|
||||
|
||||
if (!LegacyAuth::user()->hasGlobalRead()) {
|
||||
if (!Auth::user()->hasGlobalRead()) {
|
||||
$sql .= ' LEFT JOIN `devices_perms` AS `DP` ON `D`.`device_id` = `DP`.`device_id`';
|
||||
$where .= ' AND `DP`.`user_id`=?';
|
||||
$param[] = LegacyAuth::id();
|
||||
$param[] = Auth::id();
|
||||
}
|
||||
|
||||
$sql .= " WHERE M.port_id = P.port_id AND P.device_id = D.device_id $where ";
|
||||
|
||||
Reference in New Issue
Block a user