Merge branch 'storageareas' of github.com:ConnorTechnology/ZoneMinder into storageareas
commit
cb69d1a693
|
@ -1711,7 +1711,7 @@ our @options =
|
|||
},
|
||||
{
|
||||
name => "ZM_OPT_FAST_DELETE",
|
||||
default => "yes",
|
||||
default => "no",
|
||||
description => "Delete only event database records for speed",
|
||||
help => qqq("
|
||||
Normally an event created as the result of an alarm consists of
|
||||
|
@ -1722,7 +1722,8 @@ our @options =
|
|||
option which means that the browser client only deletes the key
|
||||
entries in the events table, which means the events will no
|
||||
longer appear in the listing, and leaves the zmaudit daemon to
|
||||
clear up the rest later.
|
||||
clear up the rest later. Note that this feature is less relevant
|
||||
with modern hardware. Recommend this feature be left off.
|
||||
"),
|
||||
type => $types{boolean},
|
||||
category => "system",
|
||||
|
|
|
@ -595,9 +595,9 @@ if ( 1 ) {
|
|||
}
|
||||
|
||||
if ( opkt.dts != AV_NOPTS_VALUE ) {
|
||||
int64_t max = video_output_stream->cur_dts + !(oc->oformat->flags & AVFMT_TS_NONSTRICT);
|
||||
if (video_output_stream->cur_dts && video_output_stream->cur_dts != AV_NOPTS_VALUE && max > opkt.dts) {
|
||||
Warning("st:%d PTS: %"PRId64" DTS: %"PRId64" < %"PRId64" invalid, clipping\n", opkt.stream_index, opkt.pts, opkt.dts, max);
|
||||
int64_t max = video_output_stream->cur_dts + !(oc->oformat->flags & AVFMT_TS_NONSTRICT);
|
||||
if ( video_output_stream->cur_dts && ( video_output_stream->cur_dts != AV_NOPTS_VALUE ) && ( max > opkt.dts ) ) {
|
||||
Warning("st:%d PTS: %"PRId64" DTS: %"PRId64" < %"PRId64" invalid, clipping", opkt.stream_index, opkt.pts, opkt.dts, max);
|
||||
if( opkt.pts >= opkt.dts)
|
||||
opkt.pts = FFMAX(opkt.pts, max);
|
||||
opkt.dts = max;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<VirtualHost *:80>
|
||||
DocumentRoot /var/www/zm
|
||||
DocumentRoot /usr/local/share/zoneminder
|
||||
DirectoryIndex index.php
|
||||
|
||||
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
|
||||
|
|
|
@ -72,7 +72,7 @@ class DATABASE_CONFIG {
|
|||
'password' => ZM_DB_PASS,
|
||||
'database' => ZM_DB_NAME,
|
||||
'prefix' => '',
|
||||
//'encoding' => 'utf8',
|
||||
'encoding' => 'utf8',
|
||||
);
|
||||
|
||||
public $test = array(
|
||||
|
|
|
@ -99,7 +99,18 @@ class HostController extends AppController {
|
|||
));
|
||||
}
|
||||
|
||||
function getTimeZone()
|
||||
{
|
||||
//http://php.net/manual/en/function.date-default-timezone-get.php
|
||||
$tz = date_default_timezone_get();
|
||||
$this->set(array(
|
||||
'tz' => $tz,
|
||||
'_serialize' => array('tz')
|
||||
));
|
||||
}
|
||||
|
||||
function getVersion() {
|
||||
//throw new UnauthorizedException(__('API Disabled'));
|
||||
$version = Configure::read('ZM_VERSION');
|
||||
// not going to use the ZM_API_VERSION
|
||||
// requires recompilation and dependency on ZM upgrade
|
||||
|
|
|
@ -291,7 +291,6 @@ if ( !empty($action) ) {
|
|||
|
||||
$monitor['Function'] = $newFunction;
|
||||
$monitor['Enabled'] = $newEnabled;
|
||||
//if ( $cookies ) session_write_close();
|
||||
if ( daemonCheck() ) {
|
||||
$restart = ($oldFunction == 'None') || ($newFunction == 'None') || ($newEnabled != $oldEnabled);
|
||||
zmaControl( $monitor, 'stop' );
|
||||
|
@ -378,8 +377,7 @@ if ( !empty($action) ) {
|
|||
|
||||
$refreshParent = true;
|
||||
fixSequences();
|
||||
}
|
||||
if ( $action == 'delete' ) {
|
||||
} elseif ( $action == 'delete' ) {
|
||||
if ( isset($_REQUEST['markZids']) ) {
|
||||
$deletedZid = 0;
|
||||
foreach( $_REQUEST['markZids'] as $markZid ) {
|
||||
|
@ -402,12 +400,13 @@ if ( !empty($action) ) {
|
|||
$refreshParent = true;
|
||||
} // end if deletedzid
|
||||
} // end if isset($_REQUEST['markZids'])
|
||||
} // end if action == delete
|
||||
}
|
||||
} // end if action
|
||||
} // end if $mid and canEdit($mid)
|
||||
|
||||
// Monitor edit actions, monitor id derived, require edit permissions for that monitor
|
||||
if ( canEdit( 'Monitors' ) ) {
|
||||
if ( $action == 'monitor' ) {
|
||||
$mid = 0;
|
||||
if ( !empty($_REQUEST['mid']) ) {
|
||||
$mid = validInt($_REQUEST['mid']);
|
||||
$monitor = dbFetchOne( 'SELECT * FROM Monitors WHERE Id = ?', NULL, array($mid) );
|
||||
|
@ -440,9 +439,8 @@ if ( !empty($action) ) {
|
|||
$changes = getFormChanges( $monitor, $_REQUEST['newMonitor'], $types, $columns );
|
||||
|
||||
if ( count( $changes ) ) {
|
||||
if ( !empty($_REQUEST['mid']) ) {
|
||||
$mid = validInt($_REQUEST['mid']);
|
||||
dbQuery( "update Monitors set ".implode( ", ", $changes )." where Id =?", array($mid) );
|
||||
if ( $mid ) {
|
||||
dbQuery( 'UPDATE Monitors SET '.implode( ", ", $changes ).' WHERE Id =?', array($mid) );
|
||||
if ( isset($changes['Name']) ) {
|
||||
$saferOldName = basename( $monitor['Name'] );
|
||||
$saferNewName = basename( $_REQUEST['newMonitor']['Name'] );
|
||||
|
@ -480,12 +478,12 @@ if ( !empty($action) ) {
|
|||
}
|
||||
}
|
||||
}
|
||||
} elseif ( !$user['MonitorIds'] ) {
|
||||
} elseif ( ! $user['MonitorIds'] ) { // Can only create new monitors if we are not restricted to specific monitors
|
||||
# FIXME This is actually a race condition. Should lock the table.
|
||||
$maxSeq = dbFetchOne( 'SELECT max(Sequence) AS MaxSequence FROM Monitors', 'MaxSequence' );
|
||||
$changes[] = 'Sequence = '.($maxSeq+1);
|
||||
|
||||
dbQuery( "insert into Monitors set ".implode( ", ", $changes ) );
|
||||
dbQuery( 'INSERT INTO Monitors SET '.implode( ', ', $changes ) );
|
||||
$mid = dbInsertId();
|
||||
$zoneArea = $_REQUEST['newMonitor']['Width'] * $_REQUEST['newMonitor']['Height'];
|
||||
dbQuery( "insert into Zones set MonitorId = ?, Name = 'All', Type = 'Active', Units = 'Percent', NumCoords = 4, Coords = ?, Area=?, AlarmRGB = 0xff0000, CheckMethod = 'Blobs', MinPixelThreshold = 25, MinAlarmPixels=?, MaxAlarmPixels=?, FilterX = 3, FilterY = 3, MinFilterPixels=?, MaxFilterPixels=?, MinBlobPixels=?, MinBlobs = 1", array( $mid, sprintf( "%d,%d %d,%d %d,%d %d,%d", 0, 0, $_REQUEST['newMonitor']['Width']-1, 0, $_REQUEST['newMonitor']['Width']-1, $_REQUEST['newMonitor']['Height']-1, 0, $_REQUEST['newMonitor']['Height']-1 ), $zoneArea, intval(($zoneArea*3)/100), intval(($zoneArea*75)/100), intval(($zoneArea*3)/100), intval(($zoneArea*75)/100), intval(($zoneArea*2)/100) ) );
|
||||
|
@ -496,6 +494,8 @@ if ( !empty($action) ) {
|
|||
if ( isset($_COOKIE['zmGroup']) ) {
|
||||
dbQuery( "UPDATE Groups SET MonitorIds = concat(MonitorIds,',".$mid."') WHERE Id=?", array($_COOKIE['zmGroup']) );
|
||||
}
|
||||
} else {
|
||||
Error("Users with Monitors restrictions cannot create new monitors.");
|
||||
}
|
||||
$restart = true;
|
||||
}
|
||||
|
@ -518,14 +518,16 @@ if ( !empty($action) ) {
|
|||
}
|
||||
|
||||
if ( $restart ) {
|
||||
$monitor = dbFetchOne( 'SELECT * FROM Monitors WHERE Id = ?', NULL, array($mid) );
|
||||
$new_monitor = dbFetchOne( 'SELECT * FROM Monitors WHERE Id = ?', NULL, array($mid) );
|
||||
//fixDevices();
|
||||
//if ( $cookies )
|
||||
//session_write_close();
|
||||
if ( daemonCheck() ) {
|
||||
zmaControl( $monitor, 'stop' );
|
||||
zmcControl( $monitor, 'restart' );
|
||||
zmaControl( $monitor, 'start' );
|
||||
zmcControl( $monitor, 'stop' );
|
||||
|
||||
zmcControl( $new_monitor, 'start' );
|
||||
zmaControl( $new_monitor, 'start' );
|
||||
}
|
||||
if ( $monitor['Controllable'] ) {
|
||||
require_once( 'control_functions.php' );
|
||||
|
|
|
@ -361,7 +361,7 @@ function outputControlStream( $src, $width, $height, $monitor, $scale, $target )
|
|||
}
|
||||
|
||||
function outputHelperStream( $id, $src, $width, $height, $title="" ) {
|
||||
echo getOutputHelperStream( $id, $src, $width, $height, $title );
|
||||
echo getHelperStream( $id, $src, $width, $height, $title );
|
||||
}
|
||||
function getHelperStream( $id, $src, $width, $height, $title="" ) {
|
||||
return '<applet id="'.$id.'" code="com.charliemouse.cambozola.Viewer"
|
||||
|
@ -536,10 +536,6 @@ function makePopupButton( $url, $winName, $winSize, $buttonValue, $condition=1,
|
|||
return( $string );
|
||||
}
|
||||
|
||||
function truncText( $text, $length, $deslash=1 ) {
|
||||
return( preg_replace( "/^(.{".$length.",}?)\b.*$/", "\\1…", ($deslash?stripslashes($text):$text) ) );
|
||||
}
|
||||
|
||||
function htmlSelect( $name, $contents, $values, $behaviours=false ) {
|
||||
|
||||
$behaviourText = "";
|
||||
|
@ -562,6 +558,10 @@ function htmlSelect( $name, $contents, $values, $behaviours=false ) {
|
|||
return $html;
|
||||
}
|
||||
|
||||
function truncText( $text, $length, $deslash=1 ) {
|
||||
return( preg_replace( "/^(.{".$length.",}?)\b.*$/", "\\1…", ($deslash?stripslashes($text):$text) ) );
|
||||
}
|
||||
|
||||
function buildSelect( $name, $contents, $behaviours=false )
|
||||
{
|
||||
$value = "";
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
#scaleControl {
|
||||
float: right;
|
||||
}
|
||||
#controls {
|
||||
width: 80%;
|
||||
text-align: center;
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
#scaleControl {
|
||||
float: right;
|
||||
}
|
||||
#controls {
|
||||
width: 80%;
|
||||
text-align: center;
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
#scaleControl {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#controls {
|
||||
width: 80%;
|
||||
text-align: center;
|
||||
|
|
|
@ -95,7 +95,14 @@ var $j = jQuery.noConflict();
|
|||
<?php } ?>
|
||||
<?php if ( $title == 'Login' && (defined('ZM_OPT_USE_GOOG_RECAPTCHA') && ZM_OPT_USE_GOOG_RECAPTCHA) ) { ?>
|
||||
<script src='https://www.google.com/recaptcha/api.js'></script>
|
||||
<?php }
|
||||
<?php } else if ( $title == 'Event' ) {
|
||||
?>
|
||||
<link href="//vjs.zencdn.net/4.11/video-js.css" rel="stylesheet">
|
||||
<script src="//vjs.zencdn.net/4.11/video.js"></script>
|
||||
<script src="./js/videojs.zoomrotate.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment.min.js"></script>
|
||||
<?php
|
||||
}
|
||||
if ( $skinJsPhpFile )
|
||||
{
|
||||
?>
|
||||
|
|
|
@ -153,10 +153,6 @@ if ( $Event->DefaultVideo() ) {
|
|||
</video>
|
||||
</div>
|
||||
<!--script>includeVideoJs();</script-->
|
||||
<link href="//vjs.zencdn.net/4.11/video-js.css" rel="stylesheet">
|
||||
<script src="//vjs.zencdn.net/4.11/video.js"></script>
|
||||
<script src="./js/videojs.zoomrotate.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment.min.js"></script>
|
||||
<script>
|
||||
var LabelFormat = "<?php echo validJsStr($Monitor->LabelFormat())?>";
|
||||
var monitorName = "<?php echo validJsStr($Monitor->Name())?>";
|
||||
|
|
|
@ -29,19 +29,19 @@ $eid = validInt($_REQUEST['eid']);
|
|||
if ( !empty($_REQUEST['fid']) )
|
||||
$fid = validInt($_REQUEST['fid']);
|
||||
|
||||
$sql = 'SELECT E.*,M.Name AS MonitorName,M.DefaultScale,M.VideoWriter FROM Events AS E INNER JOIN Monitors AS M ON E.MonitorId = M.Id WHERE E.Id = ?';
|
||||
$event = dbFetchOne( $sql, NULL, array($eid) );
|
||||
$Event = new Event( $eid );
|
||||
$Monitor = $Event->Monitor();
|
||||
|
||||
if ( !empty($fid) ) {
|
||||
$sql = 'SELECT * FROM Frames WHERE EventId = ? AND FrameId = ?';
|
||||
if ( !($frame = dbFetchOne( $sql, NULL, array($eid, $fid) )) )
|
||||
$frame = array( 'FrameId'=>$fid, 'Type'=>'Normal', 'Score'=>0 );
|
||||
$sql = 'SELECT * FROM Frames WHERE EventId = ? AND FrameId = ?';
|
||||
if ( !($frame = dbFetchOne( $sql, NULL, array($eid, $fid) )) )
|
||||
$frame = array( 'FrameId'=>$fid, 'Type'=>'Normal', 'Score'=>0 );
|
||||
} else {
|
||||
$frame = dbFetchOne( 'SELECT * FROM Frames WHERE EventId = ? AND Score = ?', NULL, array( $eid, $event['MaxScore'] ) );
|
||||
$frame = dbFetchOne( 'SELECT * FROM Frames WHERE EventId = ? AND Score = ?', NULL, array( $eid, $Event->MaxScore() ) );
|
||||
}
|
||||
$Frame = new Frame( $frame );
|
||||
|
||||
$maxFid = $event['Frames'];
|
||||
$maxFid = $Event->Frames();
|
||||
|
||||
$firstFid = 1;
|
||||
$prevFid = $Frame->FrameId()-1;
|
||||
|
@ -50,10 +50,15 @@ $lastFid = $maxFid;
|
|||
|
||||
$alarmFrame = $Frame->Type()=='Alarm';
|
||||
|
||||
if ( isset( $_REQUEST['scale'] ) )
|
||||
$scale = validInt($_REQUEST['scale']);
|
||||
else
|
||||
$scale = max( reScale( SCALE_BASE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE ), SCALE_BASE );
|
||||
if ( isset( $_REQUEST['scale'] ) ) {
|
||||
$scale = validInt($_REQUEST['scale']);
|
||||
} else if ( isset( $_COOKIE['zmWatchScale'.$Monitor->Id()] ) ) {
|
||||
$scale = $_COOKIE['zmWatchScale'.$Monitor->Id()];
|
||||
} else if ( isset( $_COOKIE['zmWatchScale'] ) ) {
|
||||
$scale = $_COOKIE['zmWatchScale'];
|
||||
} else {
|
||||
$scale = max( reScale( SCALE_BASE, $Monitor->DefaultScale(), ZM_WEB_DEFAULT_SCALE ), SCALE_BASE );
|
||||
}
|
||||
|
||||
$show = 'capt';
|
||||
if ( isset($_REQUEST['show']) ) {
|
||||
|
@ -61,7 +66,7 @@ if ( isset($_REQUEST['show']) ) {
|
|||
#} else if ( $imageData['hasAnalImage'] ) {
|
||||
#$show = 'anal';
|
||||
}
|
||||
$imageData = getImageSrc( $event, $frame, $scale, ($show=="capt") );
|
||||
$imageData = $Event->getImageSrc( $frame, $scale, ($show=="capt") );
|
||||
|
||||
$imagePath = $imageData['thumbPath'];
|
||||
$eventPath = $imageData['eventPath'];
|
||||
|
@ -70,38 +75,43 @@ $rImagePath = sprintf( "%s/%0".ZM_EVENT_IMAGE_DIGITS."d-diag-r.jpg", $eventPath,
|
|||
|
||||
$focusWindow = true;
|
||||
|
||||
xhtmlHeaders(__FILE__, translate('Frame')." - ".$event['Id']." - ".$Frame->FrameId() );
|
||||
xhtmlHeaders(__FILE__, translate('Frame')." - ".$Event->Id()." - ".$Frame->FrameId() );
|
||||
?>
|
||||
<body>
|
||||
<div id="page">
|
||||
<div id="header">
|
||||
<form>
|
||||
<div id="headerButtons">
|
||||
<?php if ( ZM_RECORD_EVENT_STATS && $alarmFrame ) { echo makePopupLink( '?view=stats&eid='.$event['Id'].'&fid='.$Frame->FrameId(), 'zmStats', 'stats', translate('Stats') ); } ?>
|
||||
<?php if ( canEdit( 'Events' ) ) { ?><a href="?view=none&action=delete&markEid=<?php echo $event['Id'] ?>"><?php echo translate('Delete') ?></a><?php } ?>
|
||||
<?php if ( ZM_RECORD_EVENT_STATS && $alarmFrame ) { echo makePopupLink( '?view=stats&eid='.$Event->Id().'&fid='.$Frame->FrameId(), 'zmStats', 'stats', translate('Stats') ); } ?>
|
||||
<?php if ( canEdit( 'Events' ) ) { ?><a href="?view=none&action=delete&markEid=<?php echo $Event->Id() ?>"><?php echo translate('Delete') ?></a><?php } ?>
|
||||
<a href="#" onclick="closeWindow(); return( false );"><?php echo translate('Close') ?></a>
|
||||
</div>
|
||||
<h2><?php echo translate('Frame') ?> <?php echo $event['Id']."-".$Frame->FrameId()." (".$Frame->Score().")" ?></h2>
|
||||
<div id="scaleControl"><label for="scale"><?php echo translate('Scale') ?></label><?php echo buildSelect( "scale", $scales, "changeScale();" ); ?></div>
|
||||
<h2><?php echo translate('Frame') ?> <?php echo $Event->Id()."-".$Frame->FrameId()." (".$Frame->Score().")" ?></h2>
|
||||
<input type="hidden" name="base_width" id="base_width" value="<?php echo $Event->Width(); ?>"/>
|
||||
<input type="hidden" name="base_height" id="base_height" value="<?php echo $Event->Height(); ?>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="content">
|
||||
<p id="image">
|
||||
<a href="?view=frame&eid=<?php echo $event['Id'] ?>&fid=<?php echo $Frame->FrameId() ?>&scale=<?php echo $scale ?>&show=<?php echo $show == 'anal' ? 'capt':'anal' ?>">
|
||||
<img src="<?php echo $Frame->getImageSrc($imageData['isAnalImage']?'analyse':'capture') ?>" width="<?php echo reScale( $event['Width'], $event['DefaultScale'], $scale ) ?>" height="<?php echo reScale( $event['Height'], $event['DefaultScale'], $scale ) ?>" alt="<?php echo $Frame->EventId()."-".$Frame->FrameId() ?>" class="<?php echo $imageData['imageClass'] ?>"/>
|
||||
<a href="?view=frame&eid=<?php echo $Event->Id() ?>&fid=<?php echo $Frame->FrameId() ?>&scale=<?php echo $scale ?>&show=<?php echo $show == 'anal' ? 'capt':'anal' ?>">
|
||||
<img id="frameImg" src="<?php echo $Frame->getImageSrc($imageData['isAnalImage']?'analyse':'capture') ?>" width="<?php echo reScale( $Event->Width(), $Monitor->DefaultScale(), $scale ) ?>" height="<?php echo reScale( $Event->Height(), $Monitor->DefaultScale(), $scale ) ?>" alt="<?php echo $Frame->EventId()."-".$Frame->FrameId() ?>" class="<?php echo $imageData['imageClass'] ?>"/>
|
||||
</p>
|
||||
<p id="controls">
|
||||
<?php if ( $Frame->FrameId() > 1 ) { ?>
|
||||
<a id="firstLink" href="?view=frame&eid=<?php echo $event['Id'] ?>&fid=<?php echo $firstFid ?>&scale=<?php echo $scale ?>&show=<?php echo $show ?>"><?php echo translate('First') ?></a>
|
||||
<a id="prevLink" href="?view=frame&eid=<?php echo $event['Id'] ?>&fid=<?php echo $prevFid ?>&scale=<?php echo $scale ?>&show=<?php echo $show ?>"><?php echo translate('Prev') ?></a>
|
||||
<a id="firstLink" href="?view=frame&eid=<?php echo $Event->Id() ?>&fid=<?php echo $firstFid ?>&scale=<?php echo $scale ?>&show=<?php echo $show ?>"><?php echo translate('First') ?></a>
|
||||
<a id="prevLink" href="?view=frame&eid=<?php echo $Event->Id() ?>&fid=<?php echo $prevFid ?>&scale=<?php echo $scale ?>&show=<?php echo $show ?>"><?php echo translate('Prev') ?></a>
|
||||
<?php } if ( $Frame->FrameId() < $maxFid ) { ?>
|
||||
<a id="nextLink" href="?view=frame&eid=<?php echo $event['Id'] ?>&fid=<?php echo $nextFid ?>&scale=<?php echo $scale ?>&show=<?php echo $show ?>"><?php echo translate('Next') ?></a>
|
||||
<a id="lastLink" href="?view=frame&eid=<?php echo $event['Id'] ?>&fid=<?php echo $lastFid ?>&scale=<?php echo $scale ?>&show=<?php echo $show ?>"><?php echo translate('Last') ?></a>
|
||||
<a id="nextLink" href="?view=frame&eid=<?php echo $Event->Id() ?>&fid=<?php echo $nextFid ?>&scale=<?php echo $scale ?>&show=<?php echo $show ?>"><?php echo translate('Next') ?></a>
|
||||
<a id="lastLink" href="?view=frame&eid=<?php echo $Event->Id() ?>&fid=<?php echo $lastFid ?>&scale=<?php echo $scale ?>&show=<?php echo $show ?>"><?php echo translate('Last') ?></a>
|
||||
<?php } ?>
|
||||
</p>
|
||||
<?php if (file_exists ($dImagePath)) { ?>
|
||||
<p id="diagImagePath"><?php echo $dImagePath ?></p>
|
||||
<p id="diagImage"><img src="<?php echo viewImagePath( $dImagePath ) ?>" width="<?php echo reScale( $event['Width'], $event['DefaultScale'], $scale ) ?>" height="<?php echo reScale( $event['Height'], $event['DefaultScale'], $scale ) ?>" class="<?php echo $imageData['imageClass'] ?>"/></p>
|
||||
<p id="diagImage"><img src="<?php echo viewImagePath( $dImagePath ) ?>" width="<?php echo reScale( $Event->Width(), $Monitor->DefaultScale(), $scale ) ?>" height="<?php echo reScale( $Event->Height(), $Monitor->DefaultScale(), $scale ) ?>" class="<?php echo $imageData['imageClass'] ?>"/></p>
|
||||
<?php } if (file_exists ($rImagePath)) { ?>
|
||||
<p id="refImagePath"><?php echo $rImagePath ?></p>
|
||||
<p id="refImage"><img src="<?php echo viewImagePath( $rImagePath ) ?>" width="<?php echo reScale( $event['Width'], $event['DefaultScale'], $scale ) ?>" height="<?php echo reScale( $event['Height'], $event['DefaultScale'], $scale ) ?>" class="<?php echo $imageData['imageClass'] ?>"/></p>
|
||||
<p id="refImage"><img src="<?php echo viewImagePath( $rImagePath ) ?>" width="<?php echo reScale( $Event->Width(), $Monitor->DefaultScale(), $scale ) ?>" height="<?php echo reScale( $Event->Height(), $Monitor->DefaultScale(), $scale ) ?>" class="<?php echo $imageData['imageClass'] ?>"/></p>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
var vid = null;
|
||||
|
||||
function setButtonState( element, butClass )
|
||||
{
|
||||
if ( element ) {
|
||||
|
@ -214,7 +216,9 @@ function getEventResponse( respObj, respText )
|
|||
return;
|
||||
|
||||
eventData = respObj.event;
|
||||
if ( !$('eventStills').hasClass( 'hidden' ) && currEventId != eventData.Id )
|
||||
var eventStills = $('eventStills');
|
||||
|
||||
if ( eventStills && !$('eventStills').hasClass( 'hidden' ) && currEventId != eventData.Id )
|
||||
resetEventStills();
|
||||
currEventId = eventData.Id;
|
||||
|
||||
|
@ -275,8 +279,10 @@ function getNearEventsResponse( respObj, respText )
|
|||
PrevEventDefVideoPath = respObj.nearevents.PrevEventDefVideoPath;
|
||||
NextEventDefVideoPath = respObj.nearevents.NextEventDefVideoPath;
|
||||
|
||||
$('prevEventBtn').disabled = !prevEventId;
|
||||
$('nextEventBtn').disabled = !nextEventId;
|
||||
var prevEventBtn = $('prevEventBtn');
|
||||
if ( prevEventBtn ) prevEventBtn.disabled = !prevEventId;
|
||||
var nextEventBtn = $('nextEventBtn');
|
||||
if ( nextEventBtn ) nextEventBtn.disabled = !nextEventId;
|
||||
}
|
||||
|
||||
var nearEventsReq = new Request.JSON( { url: thisUrl, method: 'get', timeout: AJAX_TIMEOUT, link: 'cancel', onSuccess: getNearEventsResponse } );
|
||||
|
@ -859,7 +865,9 @@ function setupListener()
|
|||
|
||||
function initPage() {
|
||||
//FIXME prevent blocking...not sure what is happening or best way to unblock
|
||||
vid = videojs("videoobj");
|
||||
if ( $('videoobj') ) {
|
||||
vid = videojs("videoobj");
|
||||
}
|
||||
if ( vid ) {
|
||||
/*
|
||||
setupListener();
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
function changeScale() {
|
||||
var scale = $('scale').get('value');
|
||||
var img = $('frameImg');
|
||||
if ( img ) {
|
||||
var baseWidth = $('base_width').value;
|
||||
var baseHeight = $('base_height').value;
|
||||
var newWidth = ( baseWidth * scale ) / SCALE_BASE;
|
||||
var newHeight = ( baseHeight * scale ) / SCALE_BASE;
|
||||
|
||||
img.style.width = newWidth + "px";
|
||||
img.style.height = newHeight + "px";
|
||||
}
|
||||
Cookie.write( 'zmWatchScale', scale, { duration: 10*365 } );
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
var SCALE_BASE = <?php echo SCALE_BASE ?>;
|
|
@ -2,72 +2,40 @@
|
|||
xhtmlHeaders(__FILE__, translate('Login') );
|
||||
?>
|
||||
<body>
|
||||
<style>
|
||||
body {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
input[type="text"] {
|
||||
margin-bottom: -1px;
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
|
||||
input[type="password"] {
|
||||
margin-bottom: 10px;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
|
||||
input[type="submit"] {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
form {
|
||||
max-width: 450px;
|
||||
padding: 40px 60px;
|
||||
margin: 15px auto;
|
||||
border: 1px solid #e7e7e7;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 0 6px 0 rgba(0,0,0,0.08);
|
||||
}
|
||||
|
||||
.form-control {
|
||||
height: 54px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 250%;
|
||||
margin-top: 0;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<div class="container">
|
||||
<form class="center-block" name="loginForm" id="loginForm" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
|
||||
<input type="hidden" name="action" value="login"/>
|
||||
<input type="hidden" name="view" value="postlogin"/>
|
||||
<input type="hidden" name="postLoginQuery" value="<?php echo $_SERVER['QUERY_STRING'] ?>">
|
||||
|
||||
<h1><?php echo translate('Login') ?></h1>
|
||||
|
||||
<label for="inputEmail" class="sr-only"><?php echo translate('Username') ?></label>
|
||||
<input type="text" name="username" class="form-control" placeholder="Username" required autofocus />
|
||||
|
||||
<label for="inputPassword" class="sr-only"><?php echo translate('Password') ?></label>
|
||||
<input type="password" name="password" value="" size="12" class="form-control" placeholder="Password" required />
|
||||
|
||||
<?php
|
||||
if (defined('ZM_OPT_USE_GOOG_RECAPTCHA')
|
||||
&& defined('ZM_OPT_GOOG_RECAPTCHA_SITEKEY')
|
||||
&& defined('ZM_OPT_GOOG_RECAPTCHA_SECRETKEY')
|
||||
&& ZM_OPT_USE_GOOG_RECAPTCHA && ZM_OPT_GOOG_RECAPTCHA_SITEKEY && ZM_OPT_GOOG_RECAPTCHA_SECRETKEY)
|
||||
{
|
||||
echo "<div class='g-recaptcha' data-sitekey='".ZM_OPT_GOOG_RECAPTCHA_SITEKEY."'></div>";
|
||||
} ?>
|
||||
|
||||
<input class="btn btn-lg btn-primary btn-block" type="submit" value="<?php echo translate('Login') ?>"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="page">
|
||||
<div id="header">
|
||||
<h1>ZoneMinder <?php echo translate('Login') ?></h1>
|
||||
</div>
|
||||
<div id="content">
|
||||
<form name="loginForm" id="loginForm" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
|
||||
<input type="hidden" name="action" value="login"/>
|
||||
<input type="hidden" name="view" value="postlogin"/>
|
||||
<input type="hidden" name="postLoginQuery" value="<?php echo $_SERVER['QUERY_STRING'] ?>">
|
||||
<table id="loginTable" class="minor" cellspacing="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="colLeft"><?php echo translate('Username') ?></td>
|
||||
<td class="colRight"><input type="text" name="username" autocorrect="off" autocapitalize="off" spellcheck="false" value="<?php echo isset($_REQUEST['username'])?validHtmlStr($_REQUEST['username']):"" ?>" size="12"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="colLeft"><?php echo translate('Password') ?></td>
|
||||
<td class="colRight"><input type="password" name="password" value="" size="12"/></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="submit" value="<?php echo translate('Login') ?>"/>
|
||||
<!-- PP: Added recaptcha widget if enabled -->
|
||||
<?php
|
||||
if (defined('ZM_OPT_USE_GOOG_RECAPTCHA')
|
||||
&& defined('ZM_OPT_GOOG_RECAPTCHA_SITEKEY')
|
||||
&& defined('ZM_OPT_GOOG_RECAPTCHA_SECRETKEY')
|
||||
&& ZM_OPT_USE_GOOG_RECAPTCHA && ZM_OPT_GOOG_RECAPTCHA_SITEKEY && ZM_OPT_GOOG_RECAPTCHA_SECRETKEY)
|
||||
{
|
||||
echo "<br/><br/><center> <div class='g-recaptcha' data-sitekey='".ZM_OPT_GOOG_RECAPTCHA_SITEKEY."'></div> </center>";
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue