From a1ad2673937421a109a87e92cc433497b8b346c9 Mon Sep 17 00:00:00 2001 From: stan Date: Tue, 27 Jan 2004 10:17:23 +0000 Subject: [PATCH] Merged in version checking. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@778 e3e1d417-86f3-4887-817a-d78f3d33393f --- configure | 2 +- scripts/Makefile.am | 4 +- scripts/Makefile.in | 4 +- scripts/zmdc.pl.z | 2 +- scripts/zmpkg.pl.z | 4 + scripts/zmupdate.pl.z | 159 +++++++++++++++++++++++++++++++++++ web/Makefile.am | 4 +- web/Makefile.in | 4 +- web/zm_actions.php | 50 +++++++++++ web/zm_config.php.z | 1 + web/zm_html.php | 1 + web/zm_html_view_console.php | 10 ++- web/zm_html_view_version.php | 133 +++++++++++++++++++++++++++++ web/zm_lang_en_gb.php | 12 +++ zmconfig.pl.in | 46 +++++++++- 15 files changed, 424 insertions(+), 12 deletions(-) create mode 100755 scripts/zmupdate.pl.z create mode 100644 web/zm_html_view_version.php diff --git a/configure b/configure index 73951cadc..0c5951689 100755 --- a/configure +++ b/configure @@ -1508,7 +1508,7 @@ fi # Define the identity of the package. PACKAGE=zm - VERSION=1.17.1 + VERSION=1.17.2 cat >>confdefs.h <<_ACEOF diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 640f13b28..fec52c4bd 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -1,5 +1,5 @@ AUTOMAKE_OPTIONS = gnu -bin_SCRIPTS = zmdc.pl zmaudit.pl zmfilter.pl zmx10.pl zmwatch.pl zmpkg.pl zmvideo.pl +bin_SCRIPTS = zmdc.pl zmaudit.pl zmfilter.pl zmx10.pl zmwatch.pl zmpkg.pl zmupdate.pl zmvideo.pl -EXTRA_DIST = zmdc.pl.z zmaudit.pl.z zmfilter.pl.z zmx10.pl.z zmwatch.pl.z zmpkg.pl.z zmvideo.pl.z zm.z +EXTRA_DIST = zmdc.pl.z zmaudit.pl.z zmfilter.pl.z zmx10.pl.z zmwatch.pl.z zmpkg.pl.z zmupdate.pl zmvideo.pl.z zm.z diff --git a/scripts/Makefile.in b/scripts/Makefile.in index d167ef6a8..84d03e745 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -117,9 +117,9 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = gnu -bin_SCRIPTS = zmdc.pl zmaudit.pl zmfilter.pl zmx10.pl zmwatch.pl zmpkg.pl zmvideo.pl +bin_SCRIPTS = zmdc.pl zmaudit.pl zmfilter.pl zmx10.pl zmwatch.pl zmpkg.pl zmupdate.pl zmvideo.pl -EXTRA_DIST = zmdc.pl.z zmaudit.pl.z zmfilter.pl.z zmx10.pl.z zmwatch.pl.z zmpkg.pl.z zmvideo.pl.z zm.z +EXTRA_DIST = zmdc.pl.z zmaudit.pl.z zmfilter.pl.z zmx10.pl.z zmwatch.pl.z zmpkg.pl.z zmupdate.pl zmvideo.pl.z zm.z subdir = scripts mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h diff --git a/scripts/zmdc.pl.z b/scripts/zmdc.pl.z index d236f048a..bc660042a 100755 --- a/scripts/zmdc.pl.z +++ b/scripts/zmdc.pl.z @@ -83,7 +83,7 @@ $ENV{PATH} = '/bin:/usr/bin'; $ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; -my @daemons = ( 'zmc', 'zma', 'zmf', 'zmfilter.pl', 'zmaudit.pl', 'zmx10.pl', 'zmwatch.pl' ); +my @daemons = ( 'zmc', 'zma', 'zmf', 'zmfilter.pl', 'zmaudit.pl', 'zmx10.pl', 'zmwatch.pl', 'zmupdate.pl' ); my $command = shift @ARGV; die( "No command given" ) unless( $command ); diff --git a/scripts/zmpkg.pl.z b/scripts/zmpkg.pl.z index 041ffd332..51a221bbb 100755 --- a/scripts/zmpkg.pl.z +++ b/scripts/zmpkg.pl.z @@ -261,6 +261,10 @@ if ( $command =~ /^(?:start|restart)$/ ) execute( ZM_PATH_BIN."/zmdc.pl start zmx10.pl -c start" ); } execute( ZM_PATH_BIN."/zmdc.pl start zmwatch.pl" ); + if ( ZM_CHECK_FOR_UPDATES ) + { + execute( ZM_PATH_BIN."/zmdc.pl start zmupdate.pl" ); + } } else { diff --git a/scripts/zmupdate.pl.z b/scripts/zmupdate.pl.z new file mode 100755 index 000000000..195e92823 --- /dev/null +++ b/scripts/zmupdate.pl.z @@ -0,0 +1,159 @@ +#!/usr/bin/perl -wT +# +# ========================================================================== +# +# ZoneMinder WatchDog Script, $Date$, $Revision$ +# Copyright (C) 2003 Philip Coombes +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# ========================================================================== +# +# This script just checks what the most recent release of ZoneMinder is +# at the the moment. It will eventually be responsible for applying and +# configuring upgrades etc, including on the fly upgrades. +# + +# ========================================================================== +# +# These are the elements you need to edit to suit your installation +# +# ========================================================================== + +use constant ZM_VERSION => ""; +use constant ZM_PATH_BIN => ""; +use constant ZM_DB_SERVER => ""; +use constant ZM_DB_NAME => ""; +use constant ZM_DB_USERA => ""; +use constant ZM_DB_PASSA => ""; + +# Load the config from the database into the symbol table +BEGIN +{ + use DBI; + no strict 'refs'; + my $dbh = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".ZM_DB_SERVER, ZM_DB_USERA, ZM_DB_PASSA ); + + my $sql = "select * from Config"; + 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() ); + while( my $config = $sth->fetchrow_hashref() ) + { + *{$config->{Name}} = sub { $config->{Value} }; + } + $sth->finish(); + $dbh->disconnect(); +} + +use constant UPDATE_LOG_FILE => ZM_PATH_LOGS.'/zmupdate.log'; +use constant CHECK_INTERVAL => (7*24*60*60); # Interval between version checks +use constant VERBOSE => 0; # Whether to output more verbose debug + +# ========================================================================== +# +# Don't change anything below here +# +# ========================================================================== + +use strict; +use POSIX; +use DBI; +use Data::Dumper; + +$| = 1; + +$ENV{PATH} = '/bin:/usr/bin'; +$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; +delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + +if ( !ZM_CHECK_FOR_UPDATES ) +{ + exit( 0 ); +} + +sub Usage +{ + print( " +Usage: zmupdate.pl +"); + exit( -1 ); +} + +open( LOG, '>>'.UPDATE_LOG_FILE ) or die( "Can't open log file: $!" ); +open( STDOUT, ">&LOG" ) || die( "Can't dup stdout: $!" ); +select( STDOUT ); $| = 1; +open( STDERR, ">&LOG" ) || die( "Can't dup stderr: $!" ); +select( STDERR ); $| = 1; +select( LOG ); $| = 1; +print( "Update agent starting at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n" ); + +my $dbh = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".ZM_DB_SERVER, ZM_DB_USERA, ZM_DB_PASSA ); + +my $last_version = ZM_DYN_LAST_VERSION; +my $curr_version = ZM_DYN_CURR_VERSION; +my $last_check = ZM_DYN_LAST_CHECK; + +if ( !$curr_version ) +{ + $curr_version = ZM_VERSION; + + my $sql = "update Config set Value = ? where Name = 'ZM_DYN_CURR_VERSION'"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $curr_version ) or die( "Can't execute: ".$sth->errstr() ); +} + +while( 1 ) +{ + my $now = time(); + if ( !$last_version || !$last_check || (($now-$last_check) > CHECK_INTERVAL) ) + { + print( "Checking for updates at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n" ); + + use LWP::UserAgent; + my $ua = LWP::UserAgent->new; + $ua->agent( "ZoneMinder Update Agent/".ZM_VERSION ); + + my $req = HTTP::Request->new( GET=>'http://www.zoneminder.com/version' ); + my $res = $ua->request($req); + + if ( $res->is_success ) + { + $last_version = $res->content; + chomp($last_version); + $last_check = $now; + + print( "Got version: '".$last_version."'\n" ); + + { + my $sql = "update Config set Value = ? where Name = 'ZM_DYN_LAST_VERSION'"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $last_version ) or die( "Can't execute: ".$sth->errstr() ); + } + { + my $sql = "update Config set Value = ? where Name = 'ZM_DYN_LAST_CHECK'"; + my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); + my $res = $sth->execute( $last_check ) or die( "Can't execute: ".$sth->errstr() ); + } + } + else + { + print( "Error check failed: '".$res->status_line()."'\n" ); + } + + } + sleep( 3600 ); +} +print( "Update agent exiting at ".strftime( '%y/%m/%d %H:%M:%S', localtime() )."\n" ); +exit(); diff --git a/web/Makefile.am b/web/Makefile.am index 2ee52113c..e930bec65 100644 --- a/web/Makefile.am +++ b/web/Makefile.am @@ -6,9 +6,9 @@ webdir = @WEB_PREFIX@ webuser = @WEB_USER@ webgroup = @WEB_GROUP@ -web_DATA = favicon.ico zm_actions.php zm_config.php zm_db.php zm_funcs.php zm_html.php zm_html_view_bandwidth.php zm_html_view_function.php zm_html_view_none.php zm_html_view_video.php zm_html_view_console.php zm_html_view_state.php zm_html_view_frame.php zm_html_view_optionhelp.php zm_html_view_watchevents.php zm_html_view_cycle.php zm_html_view_login.php zm_html_view_options.php zm_html_view_watchfeed.php zm_html_view_error.php zm_html_view_logout.php zm_html_view_postlogin.php zm_html_view_watch.php zm_html_view_event.php zm_html_view_monitor.php zm_html_view_watchstatus.php zm_html_view_events.php zm_html_view_montagefeed.php zm_html_view_settings.php zm_html_view_zone.php zm_html_view_filter.php zm_html_view_montage.php zm_html_view_frames.php zm_html_view_stats.php zm_html_view_zones.php zm_html_view_filtersave.php zm_html_view_montagestatus.php zm_html_view_user.php zm.php zm_styles.css zm_wml.php zm_wml_view_console.php zm_wml_view_feed.php zm_lang.php zm_lang_en_gb.php zm_lang_en_us.php zm_lang_de_de.php zm_lang_pl_pl.php +web_DATA = zm_actions.php zm_config.php zm_db.php zm_funcs.php zm_html.php zm_html_view_bandwidth.php zm_html_view_function.php zm_html_view_none.php zm_html_view_video.php zm_html_view_console.php zm_html_view_state.php zm_html_view_frame.php zm_html_view_optionhelp.php zm_html_view_watchevents.php zm_html_view_cycle.php zm_html_view_login.php zm_html_view_options.php zm_html_view_watchfeed.php zm_html_view_error.php zm_html_view_logout.php zm_html_view_postlogin.php zm_html_view_watch.php zm_html_view_event.php zm_html_view_monitor.php zm_html_view_watchstatus.php zm_html_view_events.php zm_html_view_montagefeed.php zm_html_view_settings.php zm_html_view_zone.php zm_html_view_filter.php zm_html_view_montage.php zm_html_view_frames.php zm_html_view_stats.php zm_html_view_zones.php zm_html_view_filtersave.php zm_html_view_montagestatus.php zm_html_view_user.php zm.php zm_styles.css zm_wml.php zm_wml_view_console.php zm_wml_view_feed.php zm_html_view_version.php zm_lang.php zm_lang_en_gb.php zm_lang_en_us.php zm_lang_de_de.php zm_lang_pl_pl.php favicon.ico -EXTRA_DIST = favicon.ico zm_config.php.z zm_actions.php zm_db.php zm_funcs.php zm_html.php zm_html_view_bandwidth.php zm_html_view_function.php zm_html_view_none.php zm_html_view_video.php zm_html_view_console.php zm_html_view_state.php zm_html_view_frame.php zm_html_view_optionhelp.php zm_html_view_watchevents.php zm_html_view_cycle.php zm_html_view_login.php zm_html_view_options.php zm_html_view_watchfeed.php zm_html_view_error.php zm_html_view_logout.php zm_html_view_postlogin.php zm_html_view_watch.php zm_html_view_event.php zm_html_view_monitor.php zm_html_view_watchstatus.php zm_html_view_events.php zm_html_view_montagefeed.php zm_html_view_settings.php zm_html_view_zone.php zm_html_view_filter.php zm_html_view_montage.php zm_html_view_frames.php zm_html_view_stats.php zm_html_view_zones.php zm_html_view_filtersave.php zm_html_view_montagestatus.php zm_html_view_user.php zm.php zm_styles.css zm_wml.php zm_wml_view_console.php zm_wml_view_feed.php swap.pl retag.sh zm_lang.php zm_lang_en_gb.php zm_lang_en_us.php zm_lang_de_de.php zm_lang_pl_pl.php +EXTRA_DIST = zm_config.php.z zm_actions.php zm_db.php zm_funcs.php zm_html.php zm_html_view_bandwidth.php zm_html_view_function.php zm_html_view_none.php zm_html_view_video.php zm_html_view_console.php zm_html_view_state.php zm_html_view_frame.php zm_html_view_optionhelp.php zm_html_view_watchevents.php zm_html_view_cycle.php zm_html_view_login.php zm_html_view_options.php zm_html_view_watchfeed.php zm_html_view_error.php zm_html_view_logout.php zm_html_view_postlogin.php zm_html_view_watch.php zm_html_view_event.php zm_html_view_monitor.php zm_html_view_watchstatus.php zm_html_view_events.php zm_html_view_montagefeed.php zm_html_view_settings.php zm_html_view_zone.php zm_html_view_filter.php zm_html_view_montage.php zm_html_view_frames.php zm_html_view_stats.php zm_html_view_zones.php zm_html_view_filtersave.php zm_html_view_montagestatus.php zm_html_view_user.php zm.php zm_styles.css zm_wml.php zm_wml_view_console.php zm_wml_view_feed.php zm_html_view_version.php zm_lang.php zm_lang_en_gb.php zm_lang_en_us.php zm_lang_de_de.php zm_lang_pl_pl.php swap.pl retag.sh favicon.ico # Yes, you are correct. This is a HACK! install-data-hook: diff --git a/web/Makefile.in b/web/Makefile.in index 5958b09b8..3e1ec9864 100644 --- a/web/Makefile.in +++ b/web/Makefile.in @@ -123,9 +123,9 @@ webdir = @WEB_PREFIX@ webuser = @WEB_USER@ webgroup = @WEB_GROUP@ -web_DATA = favicon.ico zm_actions.php zm_config.php zm_db.php zm_funcs.php zm_html.php zm_html_view_bandwidth.php zm_html_view_function.php zm_html_view_none.php zm_html_view_video.php zm_html_view_console.php zm_html_view_state.php zm_html_view_frame.php zm_html_view_optionhelp.php zm_html_view_watchevents.php zm_html_view_cycle.php zm_html_view_login.php zm_html_view_options.php zm_html_view_watchfeed.php zm_html_view_error.php zm_html_view_logout.php zm_html_view_postlogin.php zm_html_view_watch.php zm_html_view_event.php zm_html_view_monitor.php zm_html_view_watchstatus.php zm_html_view_events.php zm_html_view_montagefeed.php zm_html_view_settings.php zm_html_view_zone.php zm_html_view_filter.php zm_html_view_montage.php zm_html_view_frames.php zm_html_view_stats.php zm_html_view_zones.php zm_html_view_filtersave.php zm_html_view_montagestatus.php zm_html_view_user.php zm.php zm_styles.css zm_wml.php zm_wml_view_console.php zm_wml_view_feed.php zm_lang.php zm_lang_en_gb.php zm_lang_en_us.php zm_lang_de_de.php zm_lang_pl_pl.php +web_DATA = zm_actions.php zm_config.php zm_db.php zm_funcs.php zm_html.php zm_html_view_bandwidth.php zm_html_view_function.php zm_html_view_none.php zm_html_view_video.php zm_html_view_console.php zm_html_view_state.php zm_html_view_frame.php zm_html_view_optionhelp.php zm_html_view_watchevents.php zm_html_view_cycle.php zm_html_view_login.php zm_html_view_options.php zm_html_view_watchfeed.php zm_html_view_error.php zm_html_view_logout.php zm_html_view_postlogin.php zm_html_view_watch.php zm_html_view_event.php zm_html_view_monitor.php zm_html_view_watchstatus.php zm_html_view_events.php zm_html_view_montagefeed.php zm_html_view_settings.php zm_html_view_zone.php zm_html_view_filter.php zm_html_view_montage.php zm_html_view_frames.php zm_html_view_stats.php zm_html_view_zones.php zm_html_view_filtersave.php zm_html_view_montagestatus.php zm_html_view_user.php zm.php zm_styles.css zm_wml.php zm_wml_view_console.php zm_wml_view_feed.php zm_html_view_version.php zm_lang.php zm_lang_en_gb.php zm_lang_en_us.php zm_lang_de_de.php zm_lang_pl_pl.php favicon.ico -EXTRA_DIST = favicon.ico zm_config.php.z zm_actions.php zm_db.php zm_funcs.php zm_html.php zm_html_view_bandwidth.php zm_html_view_function.php zm_html_view_none.php zm_html_view_video.php zm_html_view_console.php zm_html_view_state.php zm_html_view_frame.php zm_html_view_optionhelp.php zm_html_view_watchevents.php zm_html_view_cycle.php zm_html_view_login.php zm_html_view_options.php zm_html_view_watchfeed.php zm_html_view_error.php zm_html_view_logout.php zm_html_view_postlogin.php zm_html_view_watch.php zm_html_view_event.php zm_html_view_monitor.php zm_html_view_watchstatus.php zm_html_view_events.php zm_html_view_montagefeed.php zm_html_view_settings.php zm_html_view_zone.php zm_html_view_filter.php zm_html_view_montage.php zm_html_view_frames.php zm_html_view_stats.php zm_html_view_zones.php zm_html_view_filtersave.php zm_html_view_montagestatus.php zm_html_view_user.php zm.php zm_styles.css zm_wml.php zm_wml_view_console.php zm_wml_view_feed.php swap.pl retag.sh zm_lang.php zm_lang_en_gb.php zm_lang_en_us.php zm_lang_de_de.php zm_lang_pl_pl.php +EXTRA_DIST = zm_config.php.z zm_actions.php zm_db.php zm_funcs.php zm_html.php zm_html_view_bandwidth.php zm_html_view_function.php zm_html_view_none.php zm_html_view_video.php zm_html_view_console.php zm_html_view_state.php zm_html_view_frame.php zm_html_view_optionhelp.php zm_html_view_watchevents.php zm_html_view_cycle.php zm_html_view_login.php zm_html_view_options.php zm_html_view_watchfeed.php zm_html_view_error.php zm_html_view_logout.php zm_html_view_postlogin.php zm_html_view_watch.php zm_html_view_event.php zm_html_view_monitor.php zm_html_view_watchstatus.php zm_html_view_events.php zm_html_view_montagefeed.php zm_html_view_settings.php zm_html_view_zone.php zm_html_view_filter.php zm_html_view_montage.php zm_html_view_frames.php zm_html_view_stats.php zm_html_view_zones.php zm_html_view_filtersave.php zm_html_view_montagestatus.php zm_html_view_user.php zm.php zm_styles.css zm_wml.php zm_wml_view_console.php zm_wml_view_feed.php zm_html_view_version.php zm_lang.php zm_lang_en_gb.php zm_lang_en_us.php zm_lang_de_de.php zm_lang_pl_pl.php swap.pl retag.sh favicon.ico subdir = web mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h diff --git a/web/zm_actions.php b/web/zm_actions.php index ce925aac2..241fa0560 100644 --- a/web/zm_actions.php +++ b/web/zm_actions.php @@ -391,6 +391,56 @@ if ( isset($action) ) } if ( canEdit( 'System' ) ) { + if ( $action == "version" && isset($option) ) + { + switch( $option ) + { + case 'go' : + { + // Ignore this, the caller will open the page itself + break; + } + case 'ignore' : + { + $sql = "update Config set Value = '".ZM_DYN_LAST_VERSION."' where Name = 'ZM_DYN_CURR_VERSION'"; + $result = mysql_query( $sql ); + if ( !$result ) + die( mysql_error() ); + break; + } + case 'hour' : + case 'day' : + case 'week' : + { + $next_reminder = time(); + if ( $option == 'hour' ) + { + $next_reminder += 60*60; + } + elseif ( $option == 'day' ) + { + $next_reminder += 24*60*60; + } + elseif ( $option == 'week' ) + { + $next_reminder += 7*24*60*60; + } + $sql = "update Config set Value = '".$next_reminder."' where Name = 'ZM_DYN_NEXT_REMINDER'"; + $result = mysql_query( $sql ); + if ( !$result ) + die( mysql_error() ); + break; + } + case 'never' : + { + $sql = "update Config set Value = '0' where Name = 'ZM_CHECK_FOR_UPDATES'"; + $result = mysql_query( $sql ); + if ( !$result ) + die( mysql_error() ); + break; + } + } + } if ( $action == "options" && isset( $tab ) ) { $config_cat = $config_cats[$tab]; diff --git a/web/zm_config.php.z b/web/zm_config.php.z index 91d8d609e..e6d242ce0 100644 --- a/web/zm_config.php.z +++ b/web/zm_config.php.z @@ -125,6 +125,7 @@ function loadConfig() $jws = array( 'console' => array( 'w'=>720, 'h'=>540 ), 'state' => array( 'w'=>300, 'h'=>120 ), + 'version' => array( 'w'=>300, 'h'=>140 ), 'cycle' => array( 'w'=>46, 'h'=>80 ), 'montage' => array( 'w'=>20, 'h'=>20 ), 'monitor' => array( 'w'=>360, 'h'=>300 ), diff --git a/web/zm_html.php b/web/zm_html.php index 910f41ce1..bda79a889 100644 --- a/web/zm_html.php +++ b/web/zm_html.php @@ -104,6 +104,7 @@ switch( $view ) case "console" : case "state" : case "bandwidth" : + case "version" : case "options" : case "optionhelp" : case "restarting" : diff --git a/web/zm_html_view_console.php b/web/zm_html_view_console.php index 911690e63..c6223bbcf 100644 --- a/web/zm_html_view_console.php +++ b/web/zm_html_view_console.php @@ -107,13 +107,21 @@ window.setTimeout( "window.location.replace('')", + +newWindow( '?view=version', 'zmVersion', , ); + - + $zmSlangGoToZoneMinder +); + +if ( ZM_DYN_CURR_VERSION != ZM_DYN_LAST_VERSION ) +{ + $options = array_merge( $options, array( + "ignore" => $zmSlangVersionIgnore, + "hour" => $zmSlangVersionRemindHour, + "day" => $zmSlangVersionRemindDay, + "week" => $zmSlangVersionRemindWeek, + "never" => $zmSlangVersionRemindNever + ) ); +} +?> + + +ZM - <?= $zmSlangVersion ?> + + + + +
ZoneMinder - - vZoneMinder - -
+ + + +
ZoneMinder -
+ + + + + + + + +



 
+ + + + + +
+ + + + + +
+ + + + + + +





Action:
+ + + + + + +
 
+ + + + diff --git a/web/zm_lang_en_gb.php b/web/zm_lang_en_gb.php index ea98400ec..262c9a150 100644 --- a/web/zm_lang_en_gb.php +++ b/web/zm_lang_en_gb.php @@ -72,6 +72,7 @@ // Simple String Replacements $zmSlang24BitColour = '24 bit colour'; $zmSlang8BitGrey = '8 bit greyscale'; +$zmSlangAction = 'Action'; $zmSlangActual = 'Actual'; $zmSlangAddNewMonitor = 'Add New Monitor'; $zmSlangAddNewUser = 'Add New User'; @@ -168,6 +169,7 @@ $zmSlangFunc = 'Func'; $zmSlangFunction = 'Function'; $zmSlangGenerateVideo = 'Generate Video'; $zmSlangGeneratingVideo = 'Generating Video'; +$zmSlangGoToZoneMinder = 'Go to ZoneMinder.com'; $zmSlangGrey = 'Grey'; $zmSlangHighBW = 'High B/W'; $zmSlangHigh = 'High'; @@ -303,6 +305,8 @@ $zmSlangType = 'Type'; $zmSlangUnarchive = 'Unarchive'; $zmSlangUnits = 'Units'; $zmSlangUnknown = 'Unknown'; +$zmSlangUpdateNotNecessary = 'No update is necessary.'; +$zmSlangUpdateAvailable = 'An update to ZoneMinder is available.'; $zmSlangUseFilterExprsPost = ' filter expressions'; // This is used at the end of the phrase 'use N filter expressions' $zmSlangUseFilterExprsPre = 'Use '; // This is used at the beginning of the phrase 'use N filter expressions' $zmSlangUseFilter = 'Use Filter'; @@ -310,6 +314,12 @@ $zmSlangUsername = 'Username'; $zmSlangUsers = 'Users'; $zmSlangUser = 'User'; $zmSlangValue = 'Value'; +$zmSlangVersion = 'Version'; +$zmSlangVersionIgnore = 'Ignore this version'; +$zmSlangVersionRemindHour = 'Remind again in 1 hour'; +$zmSlangVersionRemindDay = 'Remind again in 1 day'; +$zmSlangVersionRemindWeek = 'Remind again in 1 week'; +$zmSlangVersionRemindNever = 'Don\'t remind about new versions'; $zmSlangVideoGenFailed = 'Video Generation Failed!'; $zmSlangVideoGenParms = 'Video Generation Parameters'; $zmSlangVideoSize = 'Video Size'; @@ -350,8 +360,10 @@ $zmSlangZone = 'Zone'; $zmClangCurrentLogin = 'Current login is \'%1$s\''; $zmClangEventCount = '%1$s %2$s'; // For example '37 Events' (from Vlang below) $zmClangLastEvents = 'Last %1$s %2$s'; // For example 'Last 37 Events' (from Vlang below) +$zmClangLatestRelease = 'The latest release is v%1$s, you have v%2$s.'; $zmClangMonitorCount = '%1$s %2$s'; // For example '4 Monitors' (from Vlang below) $zmClangMonitorFunction = 'Monitor %1$s Function'; +$zmClangRunningRecentVer = 'You are running the most recent version of ZoneMinder, v%s.'; // The next section allows you to describe a series of word ending and counts used to // generate the correctly conjugated forms of words depending on a count that is associated diff --git a/zmconfig.pl.in b/zmconfig.pl.in index 079379087..263a330b1 100755 --- a/zmconfig.pl.in +++ b/zmconfig.pl.in @@ -795,6 +795,14 @@ my @options = type => $types{boolean}, category => 'system', }, + { + name => "ZM_CHECK_FOR_UPDATES", + default => "yes", + description => "Whether to check with zoneminder.com for updated versions", + help => "From ZoneMinder version 1.17.0 onwards new versions are expected to be more frequent. To save checking manually for each new version ZoneMinder can check with the zoneminder.com website to determine the most recent release. These checks are infrequent, about once per week, and no personal or system information is transmitted other than your current version number. If you do not wish these checks to take place or your ZoneMinder system has no internet access you can switch these check off with this configuration variable", + type => $types{boolean}, + category => 'system', + }, { name => "ZM_WEB_REFRESH_METHOD", default => "javascript", @@ -1018,6 +1026,42 @@ my @options = type => $types{integer}, category => 'phoneband', }, + { + name => "ZM_DYN_LAST_VERSION", + default => "", + description => "What the last version of ZoneMinder recorded from zoneminder.com is", + help => "", + type => $types{string}, + readonly => 1, + category => 'dynamic', + }, + { + name => "ZM_DYN_CURR_VERSION", + default => "@VERSION@", + description => "What the effective current version of ZoneMinder is, might be different from actual", + help => "", + type => $types{string}, + readonly => 1, + category => 'dynamic', + }, + { + name => "ZM_DYN_LAST_CHECK", + default => "", + description => "When the last check for version from zoneminder.com was", + help => "", + type => $types{integer}, + readonly => 1, + category => 'dynamic', + }, + { + name => "ZM_DYN_NEXT_REMINDER", + default => "", + description => "When the earliest time to remind about versions will be", + help => "", + type => $types{string}, + readonly => 1, + category => 'dynamic', + }, ); my %options_hash = map { ( $_->{name}, $_ ) } @options; @@ -1370,7 +1414,7 @@ if ( $reprocess ) printf( CFG_HDR_FILE "#define ZM_MAX_CFG_ID $last_id\n" ); close( CFG_HDR_FILE ); - my @config_files = qw( src/zm_config.h web/zm_config.php scripts/zmdc.pl scripts/zmwatch.pl scripts/zmaudit.pl scripts/zmfilter.pl scripts/zmx10.pl scripts/zmpkg.pl scripts/zmvideo.pl scripts/zm db/zmschema.sql ); + my @config_files = qw( src/zm_config.h web/zm_config.php scripts/zmdc.pl scripts/zmwatch.pl scripts/zmaudit.pl scripts/zmfilter.pl scripts/zmx10.pl scripts/zmpkg.pl scripts/zmupdate.pl scripts/zmvideo.pl scripts/zm db/zmschema.sql ); foreach my $config_file ( @config_files ) {