Tony Murray 7250376104 refactor: Don't access $_SESSION directly for Auth (#8513)
* Don't access $_SESSION directly for Auth

* fix style

* add property annotations
2018-04-07 21:55:28 +01:00

13 lines
430 B
PHP

<?php
use LibreNMS\Authentication\Auth;
if (Auth::user()->hasGlobalRead()) {
$data['count'] = array('query' => "SELECT COUNT(`toner_id`) FROM toner");
} else {
$data['count'] = array(
'query' => "SELECT COUNT(`toner_id`) FROM toner AS T, devices AS D, devices_perms AS P WHERE P.`user_id` = ? AND P.`device_id` = D.`device_id` AND T.`device_id` = D.`device_id`",
'params' => array(Auth::id()),
);
}