Skip to content

Commit

Permalink
Fix SQL query when a user is limited to a subset of monitors and trie…
Browse files Browse the repository at this point in the history
…s to view all zones.
  • Loading branch information
Isaac Connor committed Dec 17, 2024
1 parent 4dcab65 commit 6ec0b5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/skins/classic/views/zones.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
} else if ( isset($_REQUEST['mids']) ) {
$mids = array_map(function($mid){return validCardinal($mid);}, $_REQUEST['mids'] );
} else {
$mids = dbFetchAll('SELECT Id FROM Monitors'.($user->unviewableMonitorIds() ? 'WHERE Id IN ('.$user->viewableMonitorIds().')' : ''), 'Id');
$mids = dbFetchAll('SELECT Id FROM Monitors'.($user->unviewableMonitorIds() ? ' WHERE Id IN ('.implode(',', array_map(function(){return '?';}, $user->viewableMonitorIds())).')' : ''), 'Id', $user->viewableMonitorIds());
}

if ( !($mids and count($mids)) ) {
Expand Down

0 comments on commit 6ec0b5a

Please sign in to comment.