MontageReview should only be visisble to people who can view events. Fix running state

pull/1185/head
Isaac Connor 2016-10-20 13:38:12 -04:00
parent ea27e07276
commit f153e9b8fb
3 changed files with 13 additions and 4 deletions

View File

@ -137,7 +137,10 @@ if ( ZM_OPT_USE_AUTH ) {
require_once( 'includes/lang.php' );
require_once( 'includes/functions.php' );
#$running = daemonCheck();
# Running is global but only do the daemonCheck if it is actually needed
$running = null;
#= daemonCheck();
#$states = dbFetchAll( 'SELECT * FROM States' );
#foreach ( $states as $state ) {
#if ( $state['IsActive'] == 1 ) {

View File

@ -185,8 +185,10 @@ function getNavBarHTML() {
global $VLANG;
global $CLANG;
global $VLANG;
global $status;
$running = daemonCheck();
global $running;
if ( $running == null )
$running = daemonCheck();
$status = $running?translate('Running'):translate('Stopped');
global $user;
global $bwArray;
?>
@ -220,7 +222,9 @@ function getNavBarHTML() {
?>
<li><?php echo makePopupLink( '?view=cycle&amp;group='.$cycleGroup, 'zmCycle'.$cycleGroup, array( 'cycle', $cycleWidth, $cycleHeight ), translate('Cycle'), $running ) ?></li>
<li><?php echo makePopupLink( '?view=montage&amp;group='.$cycleGroup, 'zmMontage'.$cycleGroup, 'montage', translate('Montage'), $running ) ?></li>
<li><?php echo makePopupLink( '?view=montagereview&amp;group='.$cycleGroup, 'zmMontageReview'.$cycleGroup, 'montagereview', translate('MontageReview'), $running ) ?></li>
<?php } ?>
<?php if ( canView('Events') ) { ?>
<li><?php echo makePopupLink( '?view=montagereview&amp;group='.$cycleGroup, 'zmMontageReview'.$cycleGroup, 'montagereview', translate('MontageReview') ) ?></li>
<?php } ?>
</ul>

View File

@ -22,6 +22,8 @@ $servers = Server::find_all();
require_once('includes/Storage.php');
$storage_areas = Storage::find_all();
$show_storage_areas = count($storage_areas) > 1 and canEdit( 'System' ) ? 1 : 0;
if ( $running == null )
$running = daemonCheck();
$eventCounts = array(
array(