From 58d326681a5b44bbb0fbb815c28cf0bbd06ea7a6 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 17 May 2016 09:17:19 -0400 Subject: [PATCH 01/11] quick fix for gcc6 --- src/zm_rtp_ctrl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zm_rtp_ctrl.h b/src/zm_rtp_ctrl.h index 2526f22ce..f487d1191 100644 --- a/src/zm_rtp_ctrl.h +++ b/src/zm_rtp_ctrl.h @@ -123,7 +123,7 @@ private: } sdes; // BYE - struct Bye + struct { uint32_t srcN[]; // list of sources // can't express trailing text for reason (what does this mean? it's not even english!) From 8bac5fbdfb151a0920456781f01b16f51aaa3c15 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Wed, 18 May 2016 16:58:04 -0500 Subject: [PATCH 02/11] typo - remove extra comma --- scripts/zmdc.pl.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/zmdc.pl.in b/scripts/zmdc.pl.in index 730af9995..e70c4d568 100644 --- a/scripts/zmdc.pl.in +++ b/scripts/zmdc.pl.in @@ -92,7 +92,7 @@ my @daemons = ( 'zmwatch.pl', 'zmupdate.pl', 'zmtrack.pl', - 'zmtelemetry.pl', + 'zmtelemetry.pl' ); my $command = shift @ARGV; From 183f9c70a4ab8cc4a75e603da4405b02e90b0963 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 19 May 2016 12:08:25 -0400 Subject: [PATCH 03/11] Must use ZoneMinder instead of ZoneMinder::Logger --- scripts/zmsystemctl.pl.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/zmsystemctl.pl.in b/scripts/zmsystemctl.pl.in index 75acae242..b6753fa26 100644 --- a/scripts/zmsystemctl.pl.in +++ b/scripts/zmsystemctl.pl.in @@ -48,7 +48,7 @@ use bytes; use autouse 'Pod::Usage'=>qw(pod2usage); @EXTRA_PERL_LIB@ -use ZoneMinder::Logger qw(:all); +use ZoneMinder; my $command = $ARGV[0]; From 4018cab743f78777507a82bc7581d59060b577cb Mon Sep 17 00:00:00 2001 From: arjunrc Date: Thu, 19 May 2016 14:53:16 -0400 Subject: [PATCH 04/11] don't pass partial data to daemoncontrol --- web/api/app/Controller/MonitorsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/api/app/Controller/MonitorsController.php b/web/api/app/Controller/MonitorsController.php index 893410ce8..7bf36de75 100644 --- a/web/api/app/Controller/MonitorsController.php +++ b/web/api/app/Controller/MonitorsController.php @@ -103,7 +103,7 @@ public function beforeFilter() { $this->Monitor->create(); if ($this->Monitor->save($this->request->data)) { - $this->daemonControl($this->Monitor->id, 'start', $this->request->data); + $this->daemonControl($this->Monitor->id, 'start'); return $this->flash(__('The monitor has been saved.'), array('action' => 'index')); } } From 924acf4284cd55b029f55a63937c5911d67133c7 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 19 May 2016 15:01:31 -0400 Subject: [PATCH 05/11] fix zmdc.pl hang due to needing to connect to db after fork --- scripts/zmdc.pl.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/zmdc.pl.in b/scripts/zmdc.pl.in index e70c4d568..1046c1b91 100644 --- a/scripts/zmdc.pl.in +++ b/scripts/zmdc.pl.in @@ -459,6 +459,8 @@ sub start } elsif ( defined($cpid ) ) { + # Force reconnection to the db. + zmDbConnect(1); logReinit(); dPrint( ZoneMinder::Logger::INFO, "'".join( ' ', ( $daemon, @args ) ) From 13feb968111a14c7fa9eabda64e4d59dcaedd8dd Mon Sep 17 00:00:00 2001 From: arjunrc Date: Thu, 19 May 2016 15:06:41 -0400 Subject: [PATCH 06/11] added alarm apis --- docs/api.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/api.rst b/docs/api.rst index 53c6d155b..e4e7bb1ee 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -130,6 +130,28 @@ depend on it. curl -XDELETE http://server/zm/api/monitors/1.json +Arm/Disarm monitors +^^^^^^^^^^^^^^^^^^^^ + +This command will force an alarm on Monitor 1: + +:: + + curl http://server/zm/api/monitors/alarm/id:1/command:on.json + +This command will disable the alarm on Monitor 1: + +:: + + curl http://server/zm/api/monitors/alarm/id:1/command:off.json + +This command will report the status of the alarm Monitor 1: + +:: + + curl http://server/zm/api/monitors/alarm/id:1/command:status.json + + Return a list of all events ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ From e0c5b2a78ff85dc3d8ce99619e027d0a59565b06 Mon Sep 17 00:00:00 2001 From: arjunrc Date: Thu, 19 May 2016 15:15:48 -0400 Subject: [PATCH 07/11] added consoleEvents API --- docs/api.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/api.rst b/docs/api.rst index e4e7bb1ee..9546a279a 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -238,6 +238,26 @@ Return a list of events for all monitors within a specified date/time range curl -XGET "http://server/zm/api/events/index/StartTime%20>=:2015-05-15%2018:43:56/EndTime%20<=:208:43:56.json" +Return event count based on times and conditions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The API also supports a handy mechanism to return a count of events for a period of time. + +This returns number of events per monitor that were recorded in the last one hour + +:: + + curl "http://server/zm/api/events/consoleEvents/1%20hour.json" + +This returns number of events per monitor that were recorded in the last day where there were atleast 10 frames that were alarms" + +:: + + curl "http://server/zm/api/events/consoleEvents/1%20day.json/AlarmFrames >=: 10.json" + + + + Configuration Apis ^^^^^^^^^^^^^^^^^^^ From 182fa9a5cd3107f115d5f87ce3394ffc1970d2e3 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 20 May 2016 08:53:53 -0400 Subject: [PATCH 08/11] revert the bulk of the merge_db_connects changes. --- scripts/ZoneMinder/lib/ZoneMinder.pm | 5 -- .../ZoneMinder/lib/ZoneMinder/Config.pm.in | 73 ++++++++----------- scripts/ZoneMinder/lib/ZoneMinder/Database.pm | 19 +++-- scripts/ZoneMinder/lib/ZoneMinder/Logger.pm | 58 +++++++++------ scripts/zmdc.pl.in | 2 - scripts/zmsystemctl.pl.in | 2 +- scripts/zmupdate.pl.in | 9 ++- 7 files changed, 84 insertions(+), 84 deletions(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder.pm b/scripts/ZoneMinder/lib/ZoneMinder.pm index 6d8b3bfc8..87a6b14b7 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder.pm @@ -81,11 +81,6 @@ our @EXPORT = ( @EXPORT_OK ); our $VERSION = $ZoneMinder::Base::VERSION; -BEGIN { - ZoneMinder::Config::zmConfigLoad(); - ZoneMinder::Database::zmDbConnect(); -} - 1; __END__ diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in b/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in index 754e4a591..06f3656c7 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in +++ b/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in @@ -30,8 +30,6 @@ use warnings; require Exporter; require ZoneMinder::Base; -require ZoneMinder::Database; -use ZoneMinder::ConfigData qw(:all); our @ISA = qw(Exporter ZoneMinder::Base); @@ -70,48 +68,39 @@ use constant ZM_CONFIG => "@ZM_CONFIG@"; # Path to the ZoneMinder config file use Carp; # Load the config from the database into the symbol table -sub zmConfigLoad { - %Config = (); +BEGIN +{ + my $config_file = ZM_CONFIG; + open( my $CONFIG, "<", $config_file ) + or croak( "Can't open config file '$config_file': $!" ); + foreach my $str ( <$CONFIG> ) + { + next if ( $str =~ /^\s*$/ ); + next if ( $str =~ /^\s*#/ ); + my ( $name, $value ) = $str =~ /^\s*([^=\s]+)\s*=\s*(.*?)\s*$/; + if ( ! $name ) { + print( STDERR "Warning, bad line in $config_file: $str\n" ); + next; + } # end if + $name =~ tr/a-z/A-Z/; + $Config{$name} = $value; + } + close( $CONFIG ); - my $config_file = ZM_CONFIG; - open( my $CONFIG, "<", $config_file ) - or croak( "Can't open config file '$config_file': $!" ); - foreach my $str ( <$CONFIG> ) { - next if ( $str =~ /^\s*$/ ); - next if ( $str =~ /^\s*#/ ); - my ( $name, $value ) = $str =~ /^\s*([^=\s]+)\s*=\s*(.*?)\s*$/; - if ( ! $name ) { - print( STDERR "Warning, bad line in $config_file: $str\n" ); - next; - } # end if - $name =~ tr/a-z/A-Z/; - $Config{$name} = $value; - } - close( $CONFIG ); - - my $dbh = ZoneMinder::Database::zmDbConnect() or croak( "Can't connect to db" ); - my $sql = 'select * from Config'; - my $sth = $dbh->prepare_cached( $sql ) or croak( "Can't prepare '$sql': ".$dbh->errstr() ); - my $res = $sth->execute() or croak( "Can't execute: ".$sth->errstr() ); - while( my $config = $sth->fetchrow_hashref() ) { - $Config{$config->{Name}} = $config->{Value}; - } - $sth->finish(); - - if ( ! exists $Config{ZM_SERVER_ID} ) { - $Config{ZM_SERVER_ID} = undef; - $sth = $dbh->prepare_cached( 'SELECT * FROM Servers WHERE Name=?' ); - if ( $Config{ZM_SERVER_NAME} ) { - $res = $sth->execute( $Config{ZM_SERVER_NAME} ); - my $result = $sth->fetchrow_hashref(); - $Config{ZM_SERVER_ID} = $$result{Id}; - } elsif ( $Config{ZM_SERVER_HOST} ) { - $res = $sth->execute( $Config{ZM_SERVER_HOST} ); - my $result = $sth->fetchrow_hashref(); - $Config{ZM_SERVER_ID} = $$result{Id}; + use DBI; + my $dbh = DBI->connect( "DBI:mysql:database=".$Config{ZM_DB_NAME} + .";host=".$Config{ZM_DB_HOST} + , $Config{ZM_DB_USER} + , $Config{ZM_DB_PASS} + ) or croak( "Can't connect to db" ); + my $sql = 'select * from Config'; + my $sth = $dbh->prepare_cached( $sql ) or croak( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute() or croak( "Can't execute: ".$sth->errstr() ); + while( my $config = $sth->fetchrow_hashref() ) { + $Config{$config->{Name}} = $config->{Value}; } $sth->finish(); - } + #$dbh->disconnect(); } sub loadConfigFromDB { @@ -228,8 +217,6 @@ sub saveConfigToDB { $dbh->{AutoCommit} = $ac; } -1; -__END__ 1; __END__ diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Database.pm b/scripts/ZoneMinder/lib/ZoneMinder/Database.pm index 574c382f5..7dfe0654b 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Database.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Database.pm @@ -27,11 +27,9 @@ package ZoneMinder::Database; use 5.006; use strict; use warnings; -use DBI; require Exporter; require ZoneMinder::Base; -require ZoneMinder::Config; our @ISA = qw(Exporter ZoneMinder::Base); @@ -66,6 +64,7 @@ our $VERSION = $ZoneMinder::Base::VERSION; # ========================================================================== use ZoneMinder::Logger qw(:all); +use ZoneMinder::Config qw(:all); use Carp; @@ -80,23 +79,23 @@ sub zmDbConnect } if ( !defined( $dbh ) ) { - my ( $host, $port ) = ( $ZoneMinder::Config::Config{ZM_DB_HOST} =~ /^([^:]+)(?::(.+))?$/ ); + my ( $host, $port ) = ( $Config{ZM_DB_HOST} =~ /^([^:]+)(?::(.+))?$/ ); if ( defined($port) ) { - $dbh = DBI->connect( "DBI:mysql:database=".$ZoneMinder::Config::Config{ZM_DB_NAME} + $dbh = DBI->connect( "DBI:mysql:database=".$Config{ZM_DB_NAME} .";host=".$host .";port=".$port - , $ZoneMinder::Config::Config{ZM_DB_USER} - , $ZoneMinder::Config::Config{ZM_DB_PASS} + , $Config{ZM_DB_USER} + , $Config{ZM_DB_PASS} ); } else { - $dbh = DBI->connect( "DBI:mysql:database=".$ZoneMinder::Config::Config{ZM_DB_NAME} - .";host=".$ZoneMinder::Config::Config{ZM_DB_HOST} - , $ZoneMinder::Config::Config{ZM_DB_USER} - , $ZoneMinder::Config::Config{ZM_DB_PASS} + $dbh = DBI->connect( "DBI:mysql:database=".$Config{ZM_DB_NAME} + .";host=".$Config{ZM_DB_HOST} + , $Config{ZM_DB_USER} + , $Config{ZM_DB_PASS} ); } $dbh->trace( 0 ); diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm b/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm index 7366ada90..a6a82db87 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm @@ -30,9 +30,6 @@ use warnings; require Exporter; require ZoneMinder::Base; -require ZoneMinder::Database; -require ZoneMinder::Config; - our @ISA = qw(Exporter ZoneMinder::Base); @@ -89,6 +86,8 @@ our $VERSION = $ZoneMinder::Base::VERSION; # # ========================================================================== +use ZoneMinder::Config qw(:all); + use DBI; use Carp; use POSIX; @@ -152,7 +151,7 @@ sub new $this->{hasTerm} = -t STDERR; ( $this->{fileName} = $0 ) =~ s|^.*/||; - $this->{logPath} = $ZoneMinder::Config::Config{ZM_PATH_LOGS}; + $this->{logPath} = $Config{ZM_PATH_LOGS}; $this->{logFile} = $this->{logPath}."/".$this->{id}.".log"; $this->{trace} = 0; @@ -165,7 +164,7 @@ sub BEGIN { # Fake the config variables that are used in case they are not defined yet # Only really necessary to support upgrade from previous version - if ( !eval('defined($ZoneMinder::Config::Config{ZM_LOG_DEBUG})') ) + if ( !eval('defined($Config{ZM_LOG_DEBUG})') ) { no strict 'subs'; no strict 'refs'; @@ -223,7 +222,7 @@ sub initialise( @ ) } else { - $tempDatabaseLevel = $ZoneMinder::Config::Config{ZM_LOG_LEVEL_DATABASE}; + $tempDatabaseLevel = $Config{ZM_LOG_LEVEL_DATABASE}; } if ( defined($options{fileLevel}) ) { @@ -231,7 +230,7 @@ sub initialise( @ ) } else { - $tempFileLevel = $ZoneMinder::Config::Config{ZM_LOG_LEVEL_FILE}; + $tempFileLevel = $Config{ZM_LOG_LEVEL_FILE}; } if ( defined($options{syslogLevel}) ) { @@ -239,7 +238,7 @@ sub initialise( @ ) } else { - $tempSyslogLevel = $ZoneMinder::Config::Config{ZM_LOG_LEVEL_SYSLOG}; + $tempSyslogLevel = $Config{ZM_LOG_LEVEL_SYSLOG}; } if ( defined($ENV{'LOG_PRINT'}) ) @@ -255,9 +254,9 @@ sub initialise( @ ) $tempFileLevel = $level if ( defined($level = $this->getTargettedEnv('LOG_LEVEL_FILE')) ); $tempSyslogLevel = $level if ( defined($level = $this->getTargettedEnv('LOG_LEVEL_SYSLOG')) ); - if ( $ZoneMinder::Config::Config{ZM_LOG_DEBUG} ) + if ( $Config{ZM_LOG_DEBUG} ) { - foreach my $target ( split( /\|/, $ZoneMinder::Config::Config{ZM_LOG_DEBUG_TARGET} ) ) + foreach my $target ( split( /\|/, $Config{ZM_LOG_DEBUG_TARGET} ) ) { if ( $target eq $this->{id} || $target eq "_".$this->{id} @@ -266,12 +265,12 @@ sub initialise( @ ) || $target eq "" ) { - if ( $ZoneMinder::Config::Config{ZM_LOG_DEBUG_LEVEL} > NOLOG ) + if ( $Config{ZM_LOG_DEBUG_LEVEL} > NOLOG ) { - $tempLevel = $this->limit( $ZoneMinder::Config::Config{ZM_LOG_DEBUG_LEVEL} ); - if ( $ZoneMinder::Config::Config{ZM_LOG_DEBUG_FILE} ne "" ) + $tempLevel = $this->limit( $Config{ZM_LOG_DEBUG_LEVEL} ); + if ( $Config{ZM_LOG_DEBUG_FILE} ne "" ) { - $tempLogFile = $ZoneMinder::Config::Config{ZM_LOG_DEBUG_FILE}; + $tempLogFile = $Config{ZM_LOG_DEBUG_FILE}; $tempFileLevel = $tempLevel; } } @@ -461,14 +460,32 @@ sub databaseLevel { if ( !$this->{dbh} ) { - $this->{dbh} = ZoneMinder::Database::zmDbConnect(); + my ( $host, $port ) = ( $Config{ZM_DB_HOST} =~ /^([^:]+)(?::(.+))?$/ ); + + if ( defined($port) ) + { + $this->{dbh} = DBI->connect( "DBI:mysql:database=".$Config{ZM_DB_NAME} + .";host=".$host + .";port=".$port + , $Config{ZM_DB_USER} + , $Config{ZM_DB_PASS} + ); + } + else + { + $this->{dbh} = DBI->connect( "DBI:mysql:database=".$Config{ZM_DB_NAME} + .";host=".$Config{ZM_DB_HOST} + , $Config{ZM_DB_USER} + , $Config{ZM_DB_PASS} + ); + } if ( !$this->{dbh} ) { $databaseLevel = NOLOG; Error( "Unable to write log entries to DB, can't connect to database '" - .$ZoneMinder::Config::Config{ZM_DB_NAME} + .$Config{ZM_DB_NAME} ."' on host '" - .$ZoneMinder::Config::Config{ZM_DB_HOST} + .$Config{ZM_DB_HOST} ."'" ); } @@ -488,8 +505,7 @@ sub databaseLevel { if ( $this->{dbh} ) { - # $this->dbh is now the global dbh, so don't close it. - #$this->{dbh}->disconnect(); + $this->{dbh}->disconnect(); undef($this->{dbh}); } } @@ -566,8 +582,8 @@ sub openFile { $LOGFILE->autoflush() if ( $this->{autoFlush} ); - my $webUid = (getpwnam( $ZoneMinder::Config::Config{ZM_WEB_USER} ))[2]; - my $webGid = (getgrnam( $ZoneMinder::Config::Config{ZM_WEB_GROUP} ))[2]; + my $webUid = (getpwnam( $Config{ZM_WEB_USER} ))[2]; + my $webGid = (getgrnam( $Config{ZM_WEB_GROUP} ))[2]; if ( $> == 0 ) { chown( $webUid, $webGid, $this->{logFile} ) diff --git a/scripts/zmdc.pl.in b/scripts/zmdc.pl.in index 1046c1b91..e70c4d568 100644 --- a/scripts/zmdc.pl.in +++ b/scripts/zmdc.pl.in @@ -459,8 +459,6 @@ sub start } elsif ( defined($cpid ) ) { - # Force reconnection to the db. - zmDbConnect(1); logReinit(); dPrint( ZoneMinder::Logger::INFO, "'".join( ' ', ( $daemon, @args ) ) diff --git a/scripts/zmsystemctl.pl.in b/scripts/zmsystemctl.pl.in index b6753fa26..75acae242 100644 --- a/scripts/zmsystemctl.pl.in +++ b/scripts/zmsystemctl.pl.in @@ -48,7 +48,7 @@ use bytes; use autouse 'Pod::Usage'=>qw(pod2usage); @EXTRA_PERL_LIB@ -use ZoneMinder; +use ZoneMinder::Logger qw(:all); my $command = $ARGV[0]; diff --git a/scripts/zmupdate.pl.in b/scripts/zmupdate.pl.in index 176de10a6..ccc76ba02 100644 --- a/scripts/zmupdate.pl.in +++ b/scripts/zmupdate.pl.in @@ -67,7 +67,12 @@ use constant CHECK_INTERVAL => (1*24*60*60); # Interval between version checks # ========================================================================== @EXTRA_PERL_LIB@ -use ZoneMinder; +use ZoneMinder::Base qw(:all); +use ZoneMinder::Config qw(:all); +use ZoneMinder::Logger qw(:all); +use ZoneMinder::General qw(:all); +use ZoneMinder::Database qw(:all); +use ZoneMinder::ConfigAdmin qw( :functions ); use POSIX; use DBI; use Getopt::Long; @@ -364,8 +369,8 @@ if ( $interactive ) { my $sql = "ALTER TABLE $_ ENGINE = InnoDB"; my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); + $sth->finish(); } - $sth->finish(); $dbh->do(q|SET sql_mode=''|); # Set mode back to default } } From bb5dbf3e4ad3884c867fd2a6642b6b8b39666b1f Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 20 May 2016 09:29:40 -0400 Subject: [PATCH 09/11] Need to import Config Data into Config --- scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in b/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in index 06f3656c7..0cc8081d2 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in +++ b/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in @@ -30,6 +30,7 @@ use warnings; require Exporter; require ZoneMinder::Base; +use ZoneMinder::ConfigData qw(:all); our @ISA = qw(Exporter ZoneMinder::Base); From 8bbb443c67898e7b7da0e1bf0a1c96b8e084821a Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Fri, 20 May 2016 10:35:03 -0500 Subject: [PATCH 10/11] fix invalid key name in config hash --- scripts/zmtelemetry.pl.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/zmtelemetry.pl.in b/scripts/zmtelemetry.pl.in index c7bf4a3f3..5a5328829 100644 --- a/scripts/zmtelemetry.pl.in +++ b/scripts/zmtelemetry.pl.in @@ -71,7 +71,7 @@ if ( $Config{ZM_TELEMETRY_DATA} ) { print( "Update agent starting at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n" ); - my $lastCheck = $Config{ZM_TELEMETRY_LAST_CHECK}; + my $lastCheck = $Config{ZM_TELEMETRY_LAST_UPLOAD}; while( 1 ) { my $now = time(); From a8e407172a4b1a9a17f244887283caf33b2da014 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 24 May 2016 15:50:22 -0400 Subject: [PATCH 11/11] split out versus get functionality in includes/functions. Fix positioning of svg over image stream --- web/includes/functions.php | 16 +++++++++------- web/skins/classic/views/zone.php | 6 +++--- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/web/includes/functions.php b/web/includes/functions.php index 25f7edd46..2b73160db 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -365,9 +365,10 @@ function outputHelperStream( $id, $src, $width, $height, $title="" ) { } function outputImageStill( $id, $src, $width, $height, $title="" ) { -?> - <?php echo $title ?> -'; } function outputControlStill( $src, $width, $height, $monitor, $scale, $target ) { @@ -2094,14 +2095,15 @@ function getStreamHTML( $monitor, $scale=100 ) { return getVideoStream( "liveStream", $streamSrc, reScale( $monitor->Width(), $scale ), reScale( $monitor->Height(), $scale ), ZM_MPEG_LIVE_FORMAT, $monitor->Name() ); } else if ( canStream() ) { $streamSrc = $monitor->getStreamSrc( array( 'mode=jpeg', 'scale='.$scale, 'maxfps='.ZM_WEB_VIDEO_MAXFPS, 'buffer='.$monitor->StreamReplayBuffer() ) ); - if ( canStreamNative() ) + if ( canStreamNative() ) { return getImageStream( "liveStream", $streamSrc, reScale( $monitor->Width(), $scale ), reScale( $monitor->Height(), $scale ), $monitor->Name() ); - elseif ( canStreamApplet() ) - outputHelperStream( "liveStream", $streamSrc, reScale( $monitor->Width(), $scale ), reScale( $monitor->Height(), $scale ), $monitor->Name() ); + } elseif ( canStreamApplet() ) { + return getHelperStream( "liveStream", $streamSrc, reScale( $monitor->Width(), $scale ), reScale( $monitor->Height(), $scale ), $monitor->Name() ); + } } else { $streamSrc = $monitor->getStreamSrc( array( 'mode=single', "scale=".$scale ) ); - outputImageStill( "liveStream", $streamSrc, reScale( $monitor->Width(), $scale ), reScale( $monitor->Height(), $scale ), $monitor->Name() ); Info( "The system has fallen back to single jpeg mode for streaming. Consider enabling Cambozola or upgrading the client browser."); + return getImageStill( "liveStream", $streamSrc, reScale( $monitor->Width(), $scale ), reScale( $monitor->Height(), $scale ), $monitor->Name() ); } } // end function getStreamHTML diff --git a/web/skins/classic/views/zone.php b/web/skins/classic/views/zone.php index 1e17d32a6..27f5e8a58 100644 --- a/web/skins/classic/views/zone.php +++ b/web/skins/classic/views/zone.php @@ -214,9 +214,9 @@ xhtmlHeaders(__FILE__, translate('Zone') );
-
- - +
+ + Sorry, your browser does not support inline SVG