Merged in version checking.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@778 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2004-01-27 10:17:23 +00:00
parent 79ddb94748
commit a1ad267393
15 changed files with 424 additions and 12 deletions

2
configure vendored
View File

@ -1508,7 +1508,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE=zm PACKAGE=zm
VERSION=1.17.1 VERSION=1.17.2
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF

View File

@ -1,5 +1,5 @@
AUTOMAKE_OPTIONS = gnu 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

View File

@ -117,9 +117,9 @@ sysconfdir = @sysconfdir@
target_alias = @target_alias@ target_alias = @target_alias@
AUTOMAKE_OPTIONS = gnu 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 subdir = scripts
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h CONFIG_HEADER = $(top_builddir)/config.h

View File

@ -83,7 +83,7 @@ $ENV{PATH} = '/bin:/usr/bin';
$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; $ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL};
delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; 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; my $command = shift @ARGV;
die( "No command given" ) unless( $command ); die( "No command given" ) unless( $command );

View File

@ -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 zmx10.pl -c start" );
} }
execute( ZM_PATH_BIN."/zmdc.pl start zmwatch.pl" ); execute( ZM_PATH_BIN."/zmdc.pl start zmwatch.pl" );
if ( ZM_CHECK_FOR_UPDATES )
{
execute( ZM_PATH_BIN."/zmdc.pl start zmupdate.pl" );
}
} }
else else
{ {

159
scripts/zmupdate.pl.z Executable file
View File

@ -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 => "<from zmconfig>";
use constant ZM_PATH_BIN => "<from zmconfig>";
use constant ZM_DB_SERVER => "<from zmconfig>";
use constant ZM_DB_NAME => "<from zmconfig>";
use constant ZM_DB_USERA => "<from zmconfig>";
use constant ZM_DB_PASSA => "<from zmconfig>";
# 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();

View File

@ -6,9 +6,9 @@ webdir = @WEB_PREFIX@
webuser = @WEB_USER@ webuser = @WEB_USER@
webgroup = @WEB_GROUP@ 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! # Yes, you are correct. This is a HACK!
install-data-hook: install-data-hook:

View File

@ -123,9 +123,9 @@ webdir = @WEB_PREFIX@
webuser = @WEB_USER@ webuser = @WEB_USER@
webgroup = @WEB_GROUP@ 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 subdir = web
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h CONFIG_HEADER = $(top_builddir)/config.h

View File

@ -391,6 +391,56 @@ if ( isset($action) )
} }
if ( canEdit( 'System' ) ) 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 ) ) if ( $action == "options" && isset( $tab ) )
{ {
$config_cat = $config_cats[$tab]; $config_cat = $config_cats[$tab];

View File

@ -125,6 +125,7 @@ function loadConfig()
$jws = array( $jws = array(
'console' => array( 'w'=>720, 'h'=>540 ), 'console' => array( 'w'=>720, 'h'=>540 ),
'state' => array( 'w'=>300, 'h'=>120 ), 'state' => array( 'w'=>300, 'h'=>120 ),
'version' => array( 'w'=>300, 'h'=>140 ),
'cycle' => array( 'w'=>46, 'h'=>80 ), 'cycle' => array( 'w'=>46, 'h'=>80 ),
'montage' => array( 'w'=>20, 'h'=>20 ), 'montage' => array( 'w'=>20, 'h'=>20 ),
'monitor' => array( 'w'=>360, 'h'=>300 ), 'monitor' => array( 'w'=>360, 'h'=>300 ),

View File

@ -104,6 +104,7 @@ switch( $view )
case "console" : case "console" :
case "state" : case "state" :
case "bandwidth" : case "bandwidth" :
case "version" :
case "options" : case "options" :
case "optionhelp" : case "optionhelp" :
case "restarting" : case "restarting" :

View File

@ -107,13 +107,21 @@ window.setTimeout( "window.location.replace('<?= $PHP_SELF ?>')", <?= (REFRESH_M
<?php <?php
} }
?> ?>
<?php
if ( ZM_CHECK_FOR_UPDATES && canEdit( 'System' ) && ( ZM_DYN_LAST_VERSION != ZM_DYN_CURR_VERSION ) && ( ZM_DYN_NEXT_REMINDER < time() ) )
{
?>
newWindow( '<?= $PHP_SELF ?>?view=version', 'zmVersion', <?= $jws['version']['w'] ?>, <?= $jws['version']['h'] ?> );
<?php
}
?>
</script> </script>
</head> </head>
<body scroll="auto"> <body scroll="auto">
<table align="center" border="0" cellspacing="2" cellpadding="2" width="96%"> <table align="center" border="0" cellspacing="2" cellpadding="2" width="96%">
<tr> <tr>
<td class="smallhead" align="left"><?= date( "D jS M, g:ia" ) ?></td> <td class="smallhead" align="left"><?= date( "D jS M, g:ia" ) ?></td>
<td class="bighead" align="center"><strong>ZoneMinder <?= $zmSlangConsole ?> - <?php if ( canEdit( 'System' ) ) { ?><a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=state', 'zmState', <?= $jws['state']['w'] ?>, <?= $jws['state']['h'] ?> );"><?= $status ?></a> - <?php } ?>v<?= ZM_VERSION ?></strong></td> <td class="bighead" align="center"><strong><a href="http://www.zoneminder.com" target="ZoneMinder">ZoneMinder</a> <?= $zmSlangConsole ?> - <?php if ( canEdit( 'System' ) ) { ?><a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=state', 'zmState', <?= $jws['state']['w'] ?>, <?= $jws['state']['h'] ?> );"><?= $status ?></a> - <?php } ?><?= makeLink( "javascript: newWindow( '$PHP_SELF?view=version', 'zmVersion', ".$jws['version']['w'].", ".$jws['version']['h']." );", "v".ZM_VERSION, canEdit( 'System' ) ) ?></strong></td>
<?php <?php
$uptime = shell_exec( 'uptime' ); $uptime = shell_exec( 'uptime' );
$load = ''; $load = '';

View File

@ -0,0 +1,133 @@
<?php
//
// ZoneMinder web version view file, $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.
//
if ( !canEdit( 'System' ) )
{
$view = "error";
return;
}
$options = array(
"go" => $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
) );
}
?>
<html>
<head>
<title>ZM - <?= $zmSlangVersion ?></title>
<link rel="stylesheet" href="zm_styles.css" type="text/css">
<script language="JavaScript">
window.focus();
function zmWindow()
{
var winName = window.open( 'http://www.zoneminder.com', 'ZoneMinder' );
winName.focus();
}
function closeWindow()
{
window.close();
}
function submitForm()
{
with( document.version_form )
{
if ( option.selectedIndex == 0 )
{
view.value = '<?= $view ?>';
}
else
{
view.value = 'none';
}
}
}
<?php
if ( $action == "version" && $option == "go" )
{
?>
zmWindow();
<?php
}
?>
</script>
</head>
<body>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td align="center" class="head">ZoneMinder - <?= $zmSlangVersion ?></td>
</tr>
</table>
<?php
if ( ZM_DYN_LAST_VERSION == ZM_VERSION )
{
?>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr>
<td align="center" class="text"><br/><?= sprintf( $zmClangRunningRecentVer, ZM_VERSION ) ?><br/><br/><?= $zmSlangUpdateNotNecessary ?></td>
</tr>
<tr>
<td align="center" class="text">&nbsp;</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="1" width="100%">
<tr>
<td width="75%" align="center"><input type="button" value="<?= $zmSlangGoToZoneMinder ?>" class="form" onClick="zmWindow()"></td>
<td width="25%" align="center"><input type="button" value="<?= $zmSlangClose ?>" class="form" onClick="closeWindow()"></td>
</tr>
</table>
<?php
}
else
{
?>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<form name="version_form" method="post" action="<?= $PHP_SELF ?>">
<input type="hidden" name="view" value="none">
<input type="hidden" name="action" value="version">
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr>
<td align="center" class="text"><br/><?= $zmSlangUpdateAvailable ?><br/><br/><?= sprintf( $zmClangLatestRelease, ZM_DYN_LAST_VERSION, ZM_VERSION ) ?><br/><br/></td>
</tr>
<tr>
<td align="center" class="text">Action: <?= buildSelect( "option", $options ); ?></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="1" width="100%">
<tr>
<td width="50%" align="center">&nbsp;</td>
<td width="25%" align="center"><input type="submit" value="<?= $zmSlangApply ?>" class="form" onClick="submitForm()"></td>
<td width="25%" align="center"><input type="button" value="<?= $zmSlangClose ?>" class="form" onClick="closeWindow()"></td>
</tr>
</table>
</form>
<?php
}
?>
</body>
</html>

View File

@ -72,6 +72,7 @@
// Simple String Replacements // Simple String Replacements
$zmSlang24BitColour = '24 bit colour'; $zmSlang24BitColour = '24 bit colour';
$zmSlang8BitGrey = '8 bit greyscale'; $zmSlang8BitGrey = '8 bit greyscale';
$zmSlangAction = 'Action';
$zmSlangActual = 'Actual'; $zmSlangActual = 'Actual';
$zmSlangAddNewMonitor = 'Add New Monitor'; $zmSlangAddNewMonitor = 'Add New Monitor';
$zmSlangAddNewUser = 'Add New User'; $zmSlangAddNewUser = 'Add New User';
@ -168,6 +169,7 @@ $zmSlangFunc = 'Func';
$zmSlangFunction = 'Function'; $zmSlangFunction = 'Function';
$zmSlangGenerateVideo = 'Generate Video'; $zmSlangGenerateVideo = 'Generate Video';
$zmSlangGeneratingVideo = 'Generating Video'; $zmSlangGeneratingVideo = 'Generating Video';
$zmSlangGoToZoneMinder = 'Go to ZoneMinder.com';
$zmSlangGrey = 'Grey'; $zmSlangGrey = 'Grey';
$zmSlangHighBW = 'High&nbsp;B/W'; $zmSlangHighBW = 'High&nbsp;B/W';
$zmSlangHigh = 'High'; $zmSlangHigh = 'High';
@ -303,6 +305,8 @@ $zmSlangType = 'Type';
$zmSlangUnarchive = 'Unarchive'; $zmSlangUnarchive = 'Unarchive';
$zmSlangUnits = 'Units'; $zmSlangUnits = 'Units';
$zmSlangUnknown = 'Unknown'; $zmSlangUnknown = 'Unknown';
$zmSlangUpdateNotNecessary = 'No update is necessary.';
$zmSlangUpdateAvailable = 'An update to ZoneMinder is available.';
$zmSlangUseFilterExprsPost = '&nbsp;filter&nbsp;expressions'; // This is used at the end of the phrase 'use N filter expressions' $zmSlangUseFilterExprsPost = '&nbsp;filter&nbsp;expressions'; // This is used at the end of the phrase 'use N filter expressions'
$zmSlangUseFilterExprsPre = 'Use&nbsp;'; // This is used at the beginning of the phrase 'use N filter expressions' $zmSlangUseFilterExprsPre = 'Use&nbsp;'; // This is used at the beginning of the phrase 'use N filter expressions'
$zmSlangUseFilter = 'Use Filter'; $zmSlangUseFilter = 'Use Filter';
@ -310,6 +314,12 @@ $zmSlangUsername = 'Username';
$zmSlangUsers = 'Users'; $zmSlangUsers = 'Users';
$zmSlangUser = 'User'; $zmSlangUser = 'User';
$zmSlangValue = 'Value'; $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!'; $zmSlangVideoGenFailed = 'Video Generation Failed!';
$zmSlangVideoGenParms = 'Video Generation Parameters'; $zmSlangVideoGenParms = 'Video Generation Parameters';
$zmSlangVideoSize = 'Video Size'; $zmSlangVideoSize = 'Video Size';
@ -350,8 +360,10 @@ $zmSlangZone = 'Zone';
$zmClangCurrentLogin = 'Current login is \'%1$s\''; $zmClangCurrentLogin = 'Current login is \'%1$s\'';
$zmClangEventCount = '%1$s %2$s'; // For example '37 Events' (from Vlang below) $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) $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) $zmClangMonitorCount = '%1$s %2$s'; // For example '4 Monitors' (from Vlang below)
$zmClangMonitorFunction = 'Monitor %1$s Function'; $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 // 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 // generate the correctly conjugated forms of words depending on a count that is associated

View File

@ -795,6 +795,14 @@ my @options =
type => $types{boolean}, type => $types{boolean},
category => 'system', 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", name => "ZM_WEB_REFRESH_METHOD",
default => "javascript", default => "javascript",
@ -1018,6 +1026,42 @@ my @options =
type => $types{integer}, type => $types{integer},
category => 'phoneband', 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; my %options_hash = map { ( $_->{name}, $_ ) } @options;
@ -1370,7 +1414,7 @@ if ( $reprocess )
printf( CFG_HDR_FILE "#define ZM_MAX_CFG_ID $last_id\n" ); printf( CFG_HDR_FILE "#define ZM_MAX_CFG_ID $last_id\n" );
close( CFG_HDR_FILE ); 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 ) foreach my $config_file ( @config_files )
{ {