Fix SQL query when a user is limited to a subset of monitors and tries to view all zones.
parent
4dcab65d51
commit
6ec0b5a1dc
|
@ -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)) ) {
|
||||
|
|
Loading…
Reference in New Issue