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:
Tony Murray
2019-08-05 14:16:05 -05:00
committed by GitHub
parent f2163edcd8
commit e99f421511
185 changed files with 342 additions and 781 deletions

View File

@@ -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 ";