Merge branch 'master' into freebsd_fixes

pull/775/head
Isaac Connor 2015-03-31 11:06:53 -04:00
commit 21915eb92c
32 changed files with 139 additions and 200 deletions

9
.gitignore vendored
View File

@ -1,5 +1,6 @@
configure
config.h.in
config.h.in~
autom4te.cache
aclocal.m4
depcomp
@ -12,7 +13,7 @@ scripts/ZoneMinder/blib
Makefile.in
Makefile
docs/_build
compile
config.guess
config.h
config.log
@ -24,6 +25,12 @@ misc/com.zoneminder.systemctl.policy
misc/com.zoneminder.systemctl.rules
misc/logrotate.conf
misc/syslog.conf
onvif/modules/MYMETA.json
onvif/modules/MYMETA.yml
onvif/proxy/MYMETA.json
onvif/proxy/MYMETA.yml
scripts/ZoneMinder/Makefile.old
scripts/ZoneMinder/MYMETA.json
scripts/ZoneMinder/MYMETA.yml
scripts/ZoneMinder/lib/ZoneMinder/Base.pm
scripts/ZoneMinder/lib/ZoneMinder/Config.pm

View File

@ -327,11 +327,6 @@ AC_CHECK_SENDFILE
# Other programs
AC_CHECK_PROG(OPT_FFMPEG,ffmpeg,yes,no)
AC_PATH_PROG(PATH_FFMPEG,ffmpeg)
AC_CHECK_PROG(OPT_NETPBM,pnmscale,yes,no)
AC_PATH_PROG(PATH_NETPBM,pnmscale)
if test "$OPT_NETPBM" == "yes"; then
PATH_NETPBM=`dirname $PATH_NETPBM`
fi
# Checks for libraries.
AC_CHECK_LIB(rt,clock_gettime,,AC_MSG_ERROR(zm requires librt))

View File

@ -1,3 +1,16 @@
zoneminder (1.28.1+1-trusty-SNAPSHOT2015030201) trusty; urgency=medium
* maybe fix for RTSP Basic Auth
* Also remove dependency on netpbm
-- Isaac Connor <iconnor@connortechnology.com> Mon, 02 Mar 2015 11:25:59 -0500
zoneminder (1.28.1+1-utopic-SNAPSHOT2015022301) utopic; urgency=medium
* Big merge of onvif support and some fixes.
-- Isaac Connor <iconnor@connortechnology.com> Mon, 23 Feb 2015 19:45:45 -0500
zoneminder (1.28.0+1-trusty-SNAPSHOT2015021201) trusty; urgency=medium
* add mysql-client-5.6 as a dependency instaed of mysql-client.

View File

@ -2,12 +2,12 @@ Source: zoneminder
Section: net
Priority: optional
Maintainer: Isaac Connor <iconnor@connortechnology.com>
Build-Depends: debhelper (>= 9), autoconf, automake, quilt, libphp-serialization-perl, libgnutls-dev, libmysqlclient-dev | libmariadbclient-dev, libdbd-mysql-perl, libdate-manip-perl, libwww-perl, libjpeg8-dev|libjpeg9-dev|libjpeg62-turbo-dev, libpcre3-dev, libavcodec-dev, libavformat-dev (>= 3:0.svn20090204), libswscale-dev (>= 3:0.svn20090204), libavutil-dev, libv4l-dev (>= 0.8.3), libbz2-dev, libtool, libsys-mmap-perl, ffmpeg | libav-tools, libnetpbm10-dev, libavdevice-dev, libdevice-serialport-perl, libpcre3, libarchive-zip-perl, libmime-lite-perl, dh-autoreconf, libvlccore-dev, libvlc-dev, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libgcrypt11-dev, libpolkit-gobject-1-dev
Build-Depends: debhelper (>= 9), autoconf, automake, quilt, libphp-serialization-perl, libgnutls-dev, libmysqlclient-dev | libmariadbclient-dev, libdbd-mysql-perl, libdate-manip-perl, libwww-perl, libjpeg8-dev|libjpeg9-dev|libjpeg62-turbo-dev, libpcre3-dev, libavcodec-dev, libavformat-dev (>= 3:0.svn20090204), libswscale-dev (>= 3:0.svn20090204), libavutil-dev, libv4l-dev (>= 0.8.3), libbz2-dev, libtool, libsys-mmap-perl, ffmpeg | libav-tools, libavdevice-dev, libdevice-serialport-perl, libpcre3, libarchive-zip-perl, libmime-lite-perl, dh-autoreconf, libvlccore-dev, libvlc-dev, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libgcrypt11-dev, libpolkit-gobject-1-dev
Standards-Version: 3.9.4
Package: zoneminder
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client|mysql-client-5.6, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice53 | libavdevice55, libjpeg8|libjpeg9|libjpeg62-turbo, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7 | libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0, liburi-encode-perl
Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client|mysql-client-5.6, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, libavdevice53 | libavdevice55, libjpeg8|libjpeg9|libjpeg62-turbo, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7 | libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0, liburi-encode-perl
Recommends: mysql-server|mariadb-server
Description: Video camera security and surveillance solution
ZoneMinder is intended for use in single or multi-camera video security

View File

@ -1,39 +0,0 @@
{
"abstract" : "unknown",
"author" : [
"Jan Hochstein"
],
"dynamic_config" : 0,
"generated_by" : "ExtUtils::MakeMaker version 6.72, CPAN::Meta::Converter version 2.141520",
"license" : [
"unknown"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version" : "2"
},
"name" : "ONVIF",
"no_index" : {
"directory" : [
"t",
"inc"
]
},
"prereqs" : {
"build" : {
"requires" : {
"ExtUtils::MakeMaker" : "0"
}
},
"configure" : {
"requires" : {
"ExtUtils::MakeMaker" : "0"
}
},
"runtime" : {
"requires" : {}
}
},
"release_status" : "stable",
"version" : ""
}

View File

@ -1,21 +0,0 @@
---
abstract: unknown
author:
- 'Jan Hochstein'
build_requires:
ExtUtils::MakeMaker: '0'
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 0
generated_by: 'ExtUtils::MakeMaker version 6.72, CPAN::Meta::Converter version 2.141520'
license: unknown
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
name: ONVIF
no_index:
directory:
- t
- inc
requires: {}
version: ''

View File

@ -1,39 +0,0 @@
{
"abstract" : "unknown",
"author" : [
"Jan Hochstein"
],
"dynamic_config" : 0,
"generated_by" : "ExtUtils::MakeMaker version 6.72, CPAN::Meta::Converter version 2.141520",
"license" : [
"unknown"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version" : "2"
},
"name" : "ONVIF",
"no_index" : {
"directory" : [
"t",
"inc"
]
},
"prereqs" : {
"build" : {
"requires" : {
"ExtUtils::MakeMaker" : "0"
}
},
"configure" : {
"requires" : {
"ExtUtils::MakeMaker" : "0"
}
},
"runtime" : {
"requires" : {}
}
},
"release_status" : "stable",
"version" : ""
}

View File

@ -1,21 +0,0 @@
---
abstract: unknown
author:
- 'Jan Hochstein'
build_requires:
ExtUtils::MakeMaker: '0'
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 0
generated_by: 'ExtUtils::MakeMaker version 6.72, CPAN::Meta::Converter version 2.141520'
license: unknown
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
name: ONVIF
no_index:
directory:
- t
- inc
requires: {}
version: ''

View File

View File

@ -195,6 +195,8 @@ Loads existing configuration from the database (if any) and merges it with the d
Saves configuration held in memory to the database. The act of loading and saving configuration is a convenient way to ensure that the configuration held in the database corresponds with the most recent definitions and that all components are using the same set of configuration.
=back
=head2 EXPORT
None by default.

View File

@ -2012,6 +2012,8 @@ Loads existing configuration from the database (if any) and merges it with the d
Saves configuration held in memory to the database. The act of loading and saving configuration is a convenient way to ensure that the configuration held in the database corresponds with the most recent definitions and that all components are using the same set of configuration.
=back
=head2 EXPORT
None by default.

View File

@ -658,9 +658,9 @@ sub presetGoto
__END__
# Below is stub documentation for your module. You'd better edit it!
=head1 FI-8608W
=head1 NAME
ZoneMinder::Database - Perl extension for FOSCAM FI-8608W by Christophe_Y2k
ZoneMinder::Control::FI-8608W - Perl extension for FOSCAM FI-8608W by Christophe_Y2k
=head1 SYNOPSIS

View File

@ -734,9 +734,9 @@ sub presetGoto
__END__
# Below is stub documentation for your module. You'd better edit it!
=head1 FI8620
=head1 NAME
ZoneMinder::Database - Perl extension for FOSCAM FI8620
ZoneMinder::Control::FI8620 - Perl extension for FOSCAM FI8620
=head1 SYNOPSIS

View File

@ -220,6 +220,10 @@ sub presetHome
__END__
=pod
=head1 NAME
ZoneMinder::Control::FI8908W - Foscam FI8908W camera control
=head1 DESCRIPTION
This module contains the implementation of the Foscam FI8908W / FI8918W IP camera control

View File

@ -696,9 +696,9 @@ sub presetGoto
__END__
# Below is stub documentation for your module. You'd better edit it!
=head1 FI9821W
=head1 NAME
ZoneMinder::Database - Perl extension for FOSCAM FI9821W
ZoneMinder::Control::FI9821W - Perl extension for FOSCAM FI9821W
=head1 SYNOPSIS

View File

@ -827,6 +827,8 @@ This method will output a fatal error message and then die if the current debug
This method will output a panic error message and then die with a stack trace if the current debug level permits it, otherwise does nothing. This message will be tagged with the PNC string in the logs.
=back
=head2 EXPORT
None by default.

View File

@ -733,10 +733,10 @@ The core elements of ZoneMinder used mapped memory to allow multiple access to r
All the methods listed below require a 'monitor' parameter. This must be a reference to a hash with at least the 'Id' field set to the monitor id of the mapped memory you wish to access. Using database methods to select the monitor details will also return this kind of data. Some of the mapped memory methods will add and amend new fields to this hash.
=over 4
=head1 METHODS
=over 4
=item zmMemVerify ( $monitor );
Verify that the mapped memory of the monitor given exists and is valid. It will return an undefined value if it is not valid. You should generally call this method first before using any of the other methods, but most of the remaining methods will also do so if the memory has not already been verified.
@ -809,6 +809,8 @@ Cancel any previous trigger on or off requests. This stops a triggered alarm if
Indicate that the given text should be displayed in the timestamp annotation on any images captured, if the format of the annotation string defined for the monitor permits.
=back
=head1 DATA
The data fields in mapped memory that may be accessed are as follows. There are two main sections, shared_data which is general data and trigger_data which is used for event triggering. Whilst reading from these fields is harmless, extreme care must be taken when writing to mapped memory, especially in the shared_data section as this is normally written to only by monitor capture and analysis processes.
@ -844,6 +846,8 @@ The data fields in mapped memory that may be accessed are as follows. There are
The following constants are used by the methods above, but can also be used by user scripts if required.
=over 4
=item STATE_IDLE STATE_PREALARM STATE_ALARM STATE_ALERT STATE_TAPE
These constants define the state of the monitor with respect to alarms and events. They are used in the shared_data:state field.
@ -852,10 +856,12 @@ These constants define the state of the monitor with respect to alarms and event
These constants defines the various values that can exist in the shared_data:action field. This is a bitmask which when non-zero defines an action that an executing monitor process should take. ACTION_GET requires that the current values of brightness, contrast, colour and hue are taken from the camera and written to the equivalent mapped memory fields. ACTION_SET implies the reverse, that the values in mapped memory should be written to the camera. ACTION_RELOAD signal that the monitor process should reload itself from the database in case any settings have changed there. ACTION_SUSPEND signals that a monitor should stop exaiming images for motion, though other alarms may still occur. ACTION_RESUME sigansl that a monitor should resume motion detectiom.
=item TRIGGER_CANCEL TRIGGER_ON TRIGGER_OFF
=item TRIGGER_CANCEL TRIGGER_ON TRIGGER_OFF
These constants are used in the definition of external triggers. TRIGGER_CANCEL is used to indicated that any previous trigger settings should be cancelled, TRIGGER_ON signals that an alarm should be created (or continued)) as a result of the current trigger and TRIGGER_OFF signals that the trigger should prevent any alarms from being generated. See the trigger methods above for further details.
=back
=head1 EXPORT
None by default.

View File

@ -20,11 +20,33 @@
# 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.
#
=head1 NAME
zmupdate.pl - check and upgrade Zoneminer database
=head1 SYNOPSIS
zmupdate.pl -c,--check | -f,--freshen | -v<version>,--version=<version> [-u<dbuser> -p<dbpass>]
=head1 DESCRIPTION
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.
=head1 OPTIONS
-c, --check - Check for updated versions of ZoneMinder
-f, --freshen - Freshen the configuration in the database. Equivalent of old zmconfig.pl -noi
-v<version>, --version=<version> - Force upgrade to the current version from <version>
-u<dbuser>, --user=<dbuser> - Alternate DB user with privileges to alter DB
-p<dbpass>, --pass=<dbpass> - Password of alternate DB user with privileges to alter DB
-d<dir>,--dir=<dir> - Directory containing update files if not in default build location
-interactive - interact with the user
-nointeractive - do not interact with the user
=cut
use strict;
use bytes;
@ -52,6 +74,7 @@ use ZoneMinder::ConfigAdmin qw( :functions );
use POSIX;
use DBI;
use Getopt::Long;
use autouse 'Pod::Usage'=>qw(pod2usage);
use Data::Dumper;
use constant EVENT_PATH => ($Config{ZM_DIR_EVENTS}=~m|/|)?$Config{ZM_DIR_EVENTS}:($Config{ZM_PATH_WEB}.'/'.$Config{ZM_DIR_EVENTS});
@ -78,27 +101,19 @@ my $version = '';
my $dbUser = $Config{ZM_DB_USER};
my $dbPass = $Config{ZM_DB_PASS};
my $updateDir = '';
sub Usage
{
print( "
Usage: zmupdate.pl <-c,--check|-f,--freshen|-v<version>,--version=<version>> [-u<dbuser> -p<dbpass>]>
Parameters are :-
-c, --check - Check for updated versions of ZoneMinder
-f, --freshen - Freshen the configuration in the database. Equivalent of old zmconfig.pl -noi
-v<version>, --version=<version> - Force upgrade to the current version from <version>
-u<dbuser>, --user=<dbuser> - Alternate DB user with privileges to alter DB
-p<dbpass>, --pass=<dbpass> - Password of alternate DB user with privileges to alter DB
-d<dir>,--dir=<dir> - Directory containing update files if not in default build location
-interactive - interact with the user
-nointeractive - do not interact with the user
");
exit( -1 );
}
if ( !GetOptions( 'check'=>\$check, 'freshen'=>\$freshen, 'rename'=>\$rename, 'zone-fix'=>\$zoneFix, 'migrate-events'=>\$migrateEvents, 'version=s'=>\$version, 'interactive!'=>\$interactive, 'user:s'=>\$dbUser, 'pass:s'=>\$dbPass, 'dir:s'=>\$updateDir ) )
{
Usage();
}
GetOptions(
'check' =>\$check,
'freshen' =>\$freshen,
'rename' =>\$rename,
'zone-fix' =>\$zoneFix,
'migrate-events' =>\$migrateEvents,
'version=s' =>\$version,
'interactive!' =>\$interactive,
'user:s' =>\$dbUser,
'pass:s' =>\$dbPass,
'dir:s' =>\$updateDir
) or pod2usage(-exitstatus => -1);
my $dbh = zmDbConnect();
$Config{ZM_DB_USER} = $dbUser;
@ -113,14 +128,14 @@ if ( ! ($check || $freshen || $rename || $zoneFix || $migrateEvents || $version)
else
{
print( STDERR "Please give a valid option\n" );
Usage();
pod2usage(-exitstatus => -1);
}
}
if ( ($check + $freshen + $rename + $zoneFix + $migrateEvents + ($version?1:0)) > 1 )
{
print( STDERR "Please give only one option\n" );
Usage();
pod2usage(-exitstatus => -1);
}
if ( $check && $Config{ZM_CHECK_FOR_UPDATES} )

View File

@ -109,7 +109,7 @@ void VideoStream::SetupFormat( )
if(filename)
{
snprintf( s->filename, sizeof(s->filename), filename );
snprintf( s->filename, sizeof(s->filename), "%s", filename );
}
ofc = s;

View File

@ -340,8 +340,19 @@ int RtspThread::run()
message = "OPTIONS "+mUrl+" RTSP/1.0\r\n";
if ( !sendCommand( message ) )
return( -1 );
if ( !recvResponse( response ) )
return( -1 );
// A negative return here may indicate auth failure, but we will have setup the auth mechanisms so we need to retry.
if ( !recvResponse( response ) ) {
if ( mNeedAuth ) {
Debug( 2, "Resending OPTIONS due to possible auth requirement" );
if ( !sendCommand( message ) )
return( -1 );
if ( !recvResponse( response ) )
return( -1 );
} else {
return( -1 );
}
} // end if failed response maybe due to auth
char publicLine[256] = "";
StringVector lines = split( response, "\r\n" );
@ -440,7 +451,11 @@ int RtspThread::run()
}
else
{
trackUrl += "/" + controlUrl;
if ( *trackUrl.rbegin() != '/') {
trackUrl += "/" + controlUrl;
} else {
trackUrl += controlUrl;
}
}
rtpClock = mediaDesc->getClock();
codecId = mFormatContext->streams[i]->codec->codec_id;

View File

@ -274,21 +274,21 @@ int main( int argc, char *argv[] )
{
if ( monitors[i]->PreCapture() < 0 )
{
Error( "Failed to pre-capture monitor %d (%d/%d)", monitors[i]->Id(), i, n_monitors );
Error( "Failed to pre-capture monitor %d %d (%d/%d)", monitors[i]->Id(), monitors[i]->Name(), i+1, n_monitors );
zm_terminate = true;
result = -1;
break;
}
if ( monitors[i]->Capture() < 0 )
{
Error( "Failed to capture image from monitor %d (%d/%d)", monitors[i]->Id(), i, n_monitors );
Error( "Failed to capture image from monitor %d %s (%d/%d)", monitors[i]->Id(), monitors[i]->Name(), i+1, n_monitors );
zm_terminate = true;
result = -1;
break;
}
if ( monitors[i]->PostCapture() < 0 )
{
Error( "Failed to post-capture monitor %d (%d/%d)", monitors[i]->Id(), i, n_monitors );
Error( "Failed to post-capture monitor %d %s (%d/%d)", monitors[i]->Id(), monitors[i]->Name(), i+1, n_monitors );
zm_terminate = true;
result = -1;
break;

View File

@ -1 +1 @@
1.28.0
1.28.1

View File

@ -1144,14 +1144,6 @@ $OLANG = array(
'Prompt' => "Op&#355;iuni adi&#355;ionale pentru ffmpeg",
'Help' => "Ffmpeg suport&#259; multe op&#355;iuni pentru controlul calit&#259;&#355;ii secven&#355;ei video produse. Aceast&#259; op&#355;iune v&#259; permite s&#259; specifica&#355;i propriile op&#355;iuni. Citi&#355;i documenta&#355;ia ffmpeg pentru mai multe detalii."
),
'OPT_NETPBM' => array(
'Prompt' => "Sunt instalate utilitarele Netpbm (op&#355;ional)",
'Help' => "&#206;n cazul la&#355;imii de band&#259; redus&#259; ZoneMinder va miniaturiza imaginile &#238;nainte de a le direc&#355;iona spre browser pentru a reduce traficul. Pentru aceasta folose&#351;te pachetul Netpbm; aceast&#259; op&#355;iune ar trebuie s&#259; direc&#355;ioneze ZoneMinder spre binarele pachetului. Dac&#259; nu ave&#355;i pachetul Netpbm instalat imaginilor vor fi &#238;ntotdeauna trimise la scar&#259; real&#259; &#351;i redimensionate &#238;n browser."
),
'PATH_NETPBM' => array(
'Prompt' => "Cale la utilitarele Netpbm (op&#355;ional)",
'Help' => "Calea la utilitarele Netpbm (op&#355;ional)"
),
'OPT_TRIGGERS' => array(
'Prompt' => "Interac&#355;ioneaz&#259; cu declan&#351;atoare externe via socket sau fi&#351;ierele dispozitivelor",
'Help' => "ZoneMinder poate interac&#355;iona cu sisteme externe care ac&#355;ioneaz&#259; sau revoc&#259; o alarm&#259;. Acest lucru este realizat prin intermediului script-ului zmtrigger.pl. Aceast&#259; op&#355;iune indic&#259; folosirea declan&#351;atoarelor externe, majoritatea vor alege nu aici."

View File

@ -46,11 +46,11 @@
*/
.ptzControls .controlsPanel .upBtn {
background: url("../graphics/arrow-l-u.gif") no-repeat 0 0;
background: url("../../graphics/arrow-l-u.gif") no-repeat 0 0;
}
.ptzControls .controlsPanel .downBtn {
background: url("../graphics/arrow-l-d.gif") no-repeat 0 0;
background: url("../../graphics/arrow-l-d.gif") no-repeat 0 0;
}
.ptzControls .controlsPanel .focusControls {

View File

@ -46,11 +46,11 @@
*/
.ptzControls .controlsPanel .upBtn {
background: url("../graphics/arrow-l-u.gif") no-repeat 0 0;
background: url("../../graphics/arrow-l-u.gif") no-repeat 0 0;
}
.ptzControls .controlsPanel .downBtn {
background: url("../graphics/arrow-l-d.gif") no-repeat 0 0;
background: url("../../graphics/arrow-l-d.gif") no-repeat 0 0;
}
.ptzControls .controlsPanel .focusControls {

View File

@ -1 +1 @@
@import url(../css/control.css);
@import url(../control.css);

View File

@ -1,4 +1,4 @@
@import url(../css/control.css);
@import url(../control.css);
#menuBar {
margin: 6px auto 4px;

View File

@ -27,13 +27,15 @@ if ( !canView( 'Events' ) )
$eid = validInt( $_REQUEST['eid'] );
$fid = !empty($_REQUEST['fid'])?validInt($_REQUEST['fid']):1;
if ( $user['MonitorIds'] )
$midSql = " and MonitorId in (".join( ",", preg_split( '/["\'\s]*,["\'\s]*/', dbEscape($user['MonitorIds']) ) ).")";
else
$midSql = '';
$sql = 'SELECT E.*,M.Name AS MonitorName,M.Width,M.Height,M.DefaultRate,M.DefaultScale FROM Events AS E INNER JOIN Monitors AS M ON E.MonitorId = M.Id WHERE E.Id = ?';
$sql_values = array( $eid );
$sql = 'SELECT E.*,M.Name AS MonitorName,M.DefaultRate,M.DefaultScale FROM Events AS E INNER JOIN Monitors AS M ON E.MonitorId = M.Id WHERE E.Id = ?'.$midSql;
$event = dbFetchOne( $sql, NULL, array($eid) );
if ( $user['MonitorIds'] ) {
$monitor_ids = explode( ',', $user['MonitorIds'] );
$sql .= ' AND MonitorId IN (' .implode( ',', array_fill(0,count($monitor_ids),'?') ) . ')';
$sql_values = array_merge( $sql_values, $monitor_ids );
}
$event = dbFetchOne( $sql, NULL, $sql_values );
if ( isset( $_REQUEST['rate'] ) )
$rate = validInt($_REQUEST['rate']);

View File

@ -32,7 +32,7 @@ if ( !empty($_REQUEST['execute']) )
$countSql = 'SELECT count(E.Id) AS EventCount FROM Monitors AS M INNER JOIN Events AS E ON (M.Id = E.MonitorId) WHERE';
$eventsSql = 'SELECT E.Id,E.MonitorId,M.Name AS MonitorName,M.DefaultScale,E.Name,E.Width,E.Height,E.Cause,E.Notes,E.StartTime,E.Length,E.Frames,E.AlarmFrames,E.TotScore,E.AvgScore,E.MaxScore,E.Archived FROM Monitors AS M INNER JOIN Events AS E on (M.Id = E.MonitorId) WHERE';
if ( $user['MonitorIds'] ) {
$user_monitor_ids = " M.Id in (".join( ",", preg_split( '/["\'\s]*,["\'\s]*/', $user['MonitorIds'] ) ).")";
$user_monitor_ids = ' M.Id in ('.$user['MonitorIds'].')';
$countSql .= $user_monitor_ids;
$eventsSql .= $user_monitor_ids;
} else {

View File

@ -147,7 +147,7 @@ $eventsSql = "select E.Id,E.Name,E.StartTime,E.EndTime,E.Length,E.Frames,E.MaxSc
if ( !empty($user['MonitorIds']) )
{
$monFilterSql = " and M.Id in (".join( ",", preg_split( '/["\'\s]*,["\'\s]*/', $user['MonitorIds'] ) ).")";
$monFilterSql = ' AND M.Id IN ('.$user['MonitorIds'].')';
$rangeSql .= $monFilterSql;
$eventsSql .= $monFilterSql;

View File

@ -24,13 +24,17 @@ if ( !canView( 'Events' ) )
return;
}
if ( !empty($user['MonitorIds']) )
$midSql = " and MonitorId in (".join( ",", preg_split( '/["\'\s]*,["\'\s]*/', $user['MonitorIds'] ) ).")";
else
$midSql = '';
$eid = validInt($_REQUEST['eid']);
$sql = 'SELECT E.*,M.Name AS MonitorName,M.DefaultRate,M.DefaultScale FROM Events AS E INNER JOIN Monitors AS M ON E.MonitorId = M.Id WHERE E.Id = ?'.$midSql;
$event = dbFetchOne( $sql, NULL, array( $_REQUEST['eid'] ) );
$sql = 'SELECT E.*,M.Name AS MonitorName,M.DefaultRate,M.DefaultScale FROM Events AS E INNER JOIN Monitors AS M ON E.MonitorId = M.Id WHERE E.Id = ?';
$sql_values = array( $eid );
if ( $user['MonitorIds'] ) {
$monitor_ids = explode( ',', $user['MonitorIds'] );
$sql .= ' AND MonitorId IN (' .implode( ',', array_fill(0,count($monitor_ids),'?') ) . ')';
$sql_values = array_merge( $sql_values, $monitor_ids );
}
$event = dbFetchOne( $sql, NULL, $sql_values );
if ( isset( $_REQUEST['rate'] ) )
$rate = validInt($_REQUEST['rate']);