Change monitor->canView semantics so that a specified monitorId trumps the Monitors:None setting. This is so that the console can be hidden, but the group dropdown still gets populated.
This commit is contained in:
parent
aa48133096
commit
301d8fa5fa
|
@ -611,7 +611,17 @@ class Monitor extends ZM_Object {
|
|||
|
||||
function canView() {
|
||||
global $user;
|
||||
return ( $user && ($user['Monitors'] != 'None') && ( !$this->{'Id'} || visibleMonitor($this->{'Id'}) ));
|
||||
if (!$user) {
|
||||
# auth turned on and not logged in
|
||||
return false;
|
||||
}
|
||||
if (!empty($user['MonitorIds']) ) {
|
||||
# For the purposes of viewing, having specified monitors trumps the Monitor->canView setting.
|
||||
if (in_array($this->{'Id'}, explode(',', $user['MonitorIds']))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return ($user['Monitors'] != 'None');
|
||||
}
|
||||
|
||||
function AlarmCommand($cmd) {
|
||||
|
|
Loading…
Reference in New Issue