Fix SQL query when a user is limited to a subset of monitors and tries to view all zones.

pull/4131/merge
Isaac Connor 2024-12-17 15:58:23 -05:00
parent 4dcab65d51
commit 6ec0b5a1dc
1 changed files with 1 additions and 1 deletions

View File

@ -25,7 +25,7 @@ if ( isset($_REQUEST['mid']) ) {
} 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)) ) {