Merge branch 'master' into storageareas

This commit is contained in:
Isaac Connor 2018-06-25 16:15:46 -04:00
commit 29f0747895
5 changed files with 47 additions and 51 deletions

View File

@ -2,37 +2,25 @@
define("MSG_TIMEOUT", 2.0);
define("MSG_DATA_SIZE", 4+256);
if ( canEdit( 'Monitors' ) )
{
$zmuCommand = getZmuCommand( " -m ".validInt($_REQUEST['id']) );
if ( canEdit('Monitors') ) {
$zmuCommand = getZmuCommand(' -m '.validInt($_REQUEST['id']));
switch ( validJsStr($_REQUEST['command']) )
{
case "disableAlarms" :
{
$zmuCommand .= " -n";
switch ( validJsStr($_REQUEST['command']) ) {
case 'disableAlarms' :
$zmuCommand .= ' -n';
break;
}
case "enableAlarms" :
{
$zmuCommand .= " -c";
case 'enableAlarms' :
$zmuCommand .= ' -c';
break;
}
case "forceAlarm" :
{
$zmuCommand .= " -a";
case 'forceAlarm' :
$zmuCommand .= ' -a';
break;
}
case "cancelForcedAlarm" :
{
$zmuCommand .= " -c";
case 'cancelForcedAlarm' :
$zmuCommand .= ' -c';
break;
}
default :
{
ajaxError("Unexpected command '".validJsStr($_REQUEST['command'])."'");
}
}
ajaxResponse(exec(escapeshellcmd($zmuCommand)));
} else {
ajaxError('Insufficient permissions');

View File

@ -104,7 +104,6 @@ function getAuthUser($auth) {
} // end getAuthUser($auth)
function generateAuthHash($useRemoteAddr, $force=false) {
$auth = '';
if ( ZM_OPT_USE_AUTH and ZM_AUTH_RELAY == 'hashed' and isset($_SESSION['username']) and $_SESSION['passwordHash'] ) {
# regenerate a hash at half the liftetime of a hash, an hour is 3600 so half is 1800
$time = time();
@ -126,13 +125,16 @@ function generateAuthHash($useRemoteAddr, $force=false) {
$_SESSION['AuthHash'] = $auth;
$_SESSION['AuthHashGeneratedAt'] = $time;
session_write_close();
} else {
return $auth;
}
#Logger::Debug("Generated new auth $auth at " . $_SESSION['AuthHashGeneratedAt']. " using $authKey" );
#} else {
#Logger::Debug("Using cached auth " . $_SESSION['AuthHash'] ." beacuse generatedat:" . $_SESSION['AuthHashGeneratedAt'] . ' < now:'. $time . ' - ' . ZM_AUTH_HASH_TTL . ' * 1800 = '. $mintime);
} # end if AuthHash is not cached
}
return $auth;
return $_SESSION['AuthHash'];
} # end if using AUTH and AUTH_RELAY
return '';
}
function visibleMonitor($mid) {

View File

@ -2159,8 +2159,9 @@ function getStreamHTML( $monitor, $options = array() ) {
$options['buffer'] = $monitor->StreamReplayBuffer();
//Warning("width: " . $options['width'] . ' height: ' . $options['height']. ' scale: ' . $options['scale'] );
if ( $monitor->Type() == "WebSite" ) {
return getWebSiteUrl( 'liveStream'.$monitor->Id(), $monitor->Path(),
if ( $monitor->Type() == 'WebSite' ) {
return getWebSiteUrl(
'liveStream'.$monitor->Id(), $monitor->Path(),
( isset($options['width']) ? $options['width'] : NULL ),
( isset($options['height']) ? $options['height'] : NULL ),
$monitor->Name()

View File

@ -59,7 +59,7 @@ noCacheHeaders();
$popup = ((isset($_REQUEST['popup'])) && ($_REQUEST['popup'] == 1));
xhtmlHeaders( __FILE__, $monitor->Name()." - ".translate('Feed') );
xhtmlHeaders( __FILE__, $monitor->Name().' - '.translate('Feed') );
?>
<body>
<div id="page">
@ -83,7 +83,12 @@ if ( canView( 'Control' ) && $monitor->Type() == 'Local' ) {
<?php if ( $monitor->Type() != 'WebSite' ) { ?>
<div id="monitorStatus">
<?php if ( canEdit('Monitors') ) { ?>
<div id="enableDisableAlarms"><a id="enableAlarmsLink" href="#" onclick="cmdEnableAlarms(); return( false );" class="hidden"><?php echo translate('EnableAlarms') ?></a><a id="disableAlarmsLink" href="#" onclick="cmdDisableAlarms(); return( false );" class="hidden"><?php echo translate('DisableAlarms') ?></a></div>
<div id="enableDisableAlarms">
<a id="enableAlarmsLink" href="#" onclick="cmdEnableAlarms();return false;" class="hidden">
<?php echo translate('EnableAlarms') ?></a>
<a id="disableAlarmsLink" href="#" onclick="cmdDisableAlarms();return false;" class="hidden">
<?php echo translate('DisableAlarms') ?></a>
</div>
<?php
}
if ( canEdit('Monitors') ) {