mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix graphs device check before auth (#15551)
It should be after the auth check.
This commit is contained in:
@ -9,10 +9,9 @@ try {
|
||||
$device = is_numeric($vars['device'])
|
||||
? device_by_id_cache($vars['device'])
|
||||
: device_by_name($vars['device']);
|
||||
if (empty($device['device_id'])) {
|
||||
throw new \LibreNMS\Exceptions\RrdGraphException('Device not found');
|
||||
if (isset($device['device_id'])) {
|
||||
DeviceCache::setPrimary($device['device_id']);
|
||||
}
|
||||
DeviceCache::setPrimary($device['device_id']);
|
||||
}
|
||||
|
||||
// variables for included graphs
|
||||
@ -59,6 +58,11 @@ try {
|
||||
return;
|
||||
}
|
||||
|
||||
// check after auth
|
||||
if (isset($vars['device']) && empty($device['device_id'])) {
|
||||
throw new \LibreNMS\Exceptions\RrdGraphException('Device not found');
|
||||
}
|
||||
|
||||
$rrd_options = $graph_params . ' ' . $rrd_options;
|
||||
|
||||
// command output requested
|
||||
|
Reference in New Issue
Block a user