mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fixed query which caused issues when no devices_perms existed
This commit is contained in:
@ -3,10 +3,11 @@
|
||||
$where = 1;
|
||||
$param = array();
|
||||
|
||||
$sql = " FROM `devices`, `devices_perms` AS `DP`";
|
||||
$sql = " FROM `devices`";
|
||||
|
||||
if (is_admin() === FALSE && is_read() === FALSE) {
|
||||
$where .= " AND `devices`.`device_id`=`DP`.`device_id` AND `DP`.`user_id`=?";
|
||||
$sql .= " LEFT JOIN `devices_perms` AS `DP` ON `devices`.`device_id` = `DP`.`device_id`";
|
||||
$where .= " AND (`devices`.`device_id`=`DP`.`device_id` AND `DP`.`user_id`=?)";
|
||||
$param[] = $_SESSION['user_id'];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user