diff --git a/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in index 46808a1fd..07453d19d 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in +++ b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in @@ -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", diff --git a/utils/docker/apache-vhost b/utils/docker/apache-vhost index 5f59c01b2..514897a16 100644 --- a/utils/docker/apache-vhost +++ b/utils/docker/apache-vhost @@ -1,5 +1,5 @@ - DocumentRoot /var/www/zm + DocumentRoot /usr/local/share/zoneminder DirectoryIndex index.php ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ diff --git a/web/api/app/Config/database.php.default b/web/api/app/Config/database.php.default index 5ea567a09..52ad549a2 100644 --- a/web/api/app/Config/database.php.default +++ b/web/api/app/Config/database.php.default @@ -72,7 +72,7 @@ class DATABASE_CONFIG { 'password' => ZM_DB_PASS, 'database' => ZM_DB_NAME, 'prefix' => '', - //'encoding' => 'utf8', + 'encoding' => 'utf8', ); public $test = array( diff --git a/web/api/app/Controller/HostController.php b/web/api/app/Controller/HostController.php index 57b210a7e..4fdb48cba 100644 --- a/web/api/app/Controller/HostController.php +++ b/web/api/app/Controller/HostController.php @@ -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 diff --git a/web/includes/functions.php b/web/includes/functions.php index 8ab9fbea6..fa8a0aba9 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -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 = ""; diff --git a/web/skins/classic/css/flat/views/frame.css b/web/skins/classic/css/flat/views/frame.css index 2c7789349..9e3e94da1 100644 --- a/web/skins/classic/css/flat/views/frame.css +++ b/web/skins/classic/css/flat/views/frame.css @@ -1,3 +1,7 @@ +#scaleControl { + float: right; +} + #controls { width: 80%; text-align: center; diff --git a/web/skins/classic/views/frame.php b/web/skins/classic/views/frame.php index d4a8dc38d..9f83b71e3 100644 --- a/web/skins/classic/views/frame.php +++ b/web/skins/classic/views/frame.php @@ -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() ); ?>
diff --git a/web/skins/classic/views/js/frame.js b/web/skins/classic/views/js/frame.js new file mode 100644 index 000000000..0705032bc --- /dev/null +++ b/web/skins/classic/views/js/frame.js @@ -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 } ); +} + diff --git a/web/skins/classic/views/js/frame.js.php b/web/skins/classic/views/js/frame.js.php new file mode 100644 index 000000000..dff39cdab --- /dev/null +++ b/web/skins/classic/views/js/frame.js.php @@ -0,0 +1,2 @@ + +var SCALE_BASE = ; diff --git a/web/skins/classic/views/login.php b/web/skins/classic/views/login.php index 326aa54e7..e0c735a05 100644 --- a/web/skins/classic/views/login.php +++ b/web/skins/classic/views/login.php @@ -2,72 +2,40 @@ xhtmlHeaders(__FILE__, translate('Login') ); ?> - -
-
- - - - -

- - - - - - - -
"; - } ?> - - - - +
+ +
+
+ + + + + + + + + + + + + + +
" size="12"/>
+ + +
"; + } + ?> +
+
+