Merge branch 'master' into feature-h264-videostorage
This commit is contained in:
commit
3a8a04c213
|
@ -58,8 +58,10 @@ override_dh_auto_install:
|
|||
|
||||
override_dh_fixperms:
|
||||
dh_fixperms
|
||||
## 637685
|
||||
chmod -c o-r $(CURDIR)/debian/zoneminder/etc/zm/zm.conf
|
||||
#
|
||||
# As requested by the Debian Webapps Policy Manual §3.2.1
|
||||
chown root:www-data $(CURDIR)/debian/zoneminder/etc/zm/zm.conf
|
||||
chmod 640 $(CURDIR)/debian/zoneminder/etc/zm/zm.conf
|
||||
|
||||
override_dh_installinit:
|
||||
dh_installinit --no-start
|
||||
|
|
|
@ -58,8 +58,10 @@ override_dh_auto_install:
|
|||
|
||||
override_dh_fixperms:
|
||||
dh_fixperms
|
||||
## 637685
|
||||
chmod -c o-r $(CURDIR)/debian/zoneminder/etc/zm/zm.conf
|
||||
#
|
||||
# As requested by the Debian Webapps Policy Manual §3.2.1
|
||||
chown root:www-data $(CURDIR)/debian/zoneminder/etc/zm/zm.conf
|
||||
chmod 640 $(CURDIR)/debian/zoneminder/etc/zm/zm.conf
|
||||
|
||||
override_dh_installinit:
|
||||
dh_installinit --no-start
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#
|
||||
# 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.
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ==========================================================================
|
||||
#
|
||||
|
|
|
@ -1,27 +1,34 @@
|
|||
# ==========================================================================
|
||||
#
|
||||
# ZoneMinder SunEyes SP-P1802SWPTZ IP Control Protocol Module, $Date: 2017-03-19 23:00:00 +1000 (Sat, 19 March 2017) $, $Revision: 0002 $
|
||||
# Copyright (C) 2001-2008 Philip Coombes
|
||||
# Modified for use with Foscam FI8918W IP Camera by Dave Harris
|
||||
# Modified Feb 2011 by Howard Durdle (http://durdl.es/x) to:
|
||||
# fix horizontal panning, add presets and IR on/off
|
||||
# use Control Device field to pass username and password
|
||||
# Modified May 2014 by Arun Horne (http://arunhorne.co.uk) to:
|
||||
# use HTTP basic auth as required by firmware 11.37.x.x upward
|
||||
# Modified on Sep 28 2015 by Bobby Billingsley
|
||||
# Changes made
|
||||
# - Copied FI8918W.pm to SPP1802SWPTZ.pm
|
||||
# - modified to control a SunEyes SP-P1802SWPTZ
|
||||
|
||||
# ==========================================================================
|
||||
# ZoneMinder SunEyes SP-P1802SWPTZ IP Control Protocol Module
|
||||
# Modified on 13 March 2017 by Steve Gilvarry
|
||||
# -Address license and copyright issues
|
||||
#
|
||||
# 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 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.
|
||||
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# ==========================================================================
|
||||
#
|
||||
# This module contains the implementation of the SunEyes SP-P1802SWPTZ IP
|
||||
# camera control protocol
|
||||
#
|
||||
|
|
|
@ -43,8 +43,8 @@ our @ISA = qw(Exporter ZoneMinder::Base);
|
|||
# will save memory.
|
||||
our %EXPORT_TAGS = (
|
||||
'functions' => [ qw(
|
||||
) ]
|
||||
);
|
||||
) ]
|
||||
);
|
||||
push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS;
|
||||
|
||||
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
|
||||
|
@ -88,7 +88,7 @@ sub load {
|
|||
if ( ! $data ) {
|
||||
Error( "Failure to load Filter record for $$self{Id}: Reason: " . $$self{dbh}->errstr );
|
||||
} else {
|
||||
Debug( 3, "Loaded Filter $$self{Id}" );
|
||||
Debug( 3, "Loaded Filter $$self{Id}" );
|
||||
} # end if
|
||||
} # end if ! $data
|
||||
if ( $data and %$data ) {
|
||||
|
@ -130,6 +130,8 @@ sub find {
|
|||
my $filter = new ZoneMinder::Filter( $$db_filter{Id}, $db_filter );
|
||||
push @results, $filter;
|
||||
} # end while
|
||||
$sth->finish();
|
||||
|
||||
return @results;
|
||||
}
|
||||
|
||||
|
@ -176,78 +178,74 @@ sub Sql {
|
|||
my $self = $_[0];
|
||||
if ( ! $$self{Sql} ) {
|
||||
my $filter_expr = ZoneMinder::General::jsonDecode( $self->{Query} );
|
||||
my $sql = "SELECT E.Id,
|
||||
E.MonitorId,
|
||||
my $sql = "SELECT E.*,
|
||||
unix_timestamp(E.StartTime) as Time,
|
||||
M.Name as MonitorName,
|
||||
M.DefaultRate,
|
||||
M.DefaultScale,
|
||||
E.Name,
|
||||
E.Cause,
|
||||
E.Notes,
|
||||
E.StartTime,
|
||||
unix_timestamp(E.StartTime) as Time,
|
||||
E.Length,
|
||||
E.Frames,
|
||||
E.AlarmFrames,
|
||||
E.TotScore,
|
||||
E.AvgScore,
|
||||
E.MaxScore,
|
||||
E.Archived,
|
||||
E.Videoed,
|
||||
E.Uploaded,
|
||||
E.Emailed,
|
||||
E.Messaged,
|
||||
E.Executed
|
||||
M.DefaultScale
|
||||
FROM Events as E
|
||||
INNER JOIN Monitors as M on M.Id = E.MonitorId
|
||||
";
|
||||
$self->{Sql} = '';
|
||||
|
||||
if ( $filter_expr->{terms} ) {
|
||||
for ( my $i = 0; $i < @{$filter_expr->{terms}}; $i++ ) {
|
||||
if ( exists($filter_expr->{terms}[$i]->{cnj}) ) {
|
||||
$self->{Sql} .= " ".$filter_expr->{terms}[$i]->{cnj}." ";
|
||||
foreach my $term ( @{$filter_expr->{terms}} ) {
|
||||
|
||||
if ( exists($term->{cnj}) ) {
|
||||
$self->{Sql} .= " ".$term->{cnj}." ";
|
||||
}
|
||||
if ( exists($filter_expr->{terms}[$i]->{obr}) ) {
|
||||
$self->{Sql} .= " ".str_repeat( "(", $filter_expr->{terms}[$i]->{obr} )." ";
|
||||
if ( exists($term->{obr}) ) {
|
||||
$self->{Sql} .= " ".str_repeat( "(", $term->{obr} )." ";
|
||||
}
|
||||
my $value = $filter_expr->{terms}[$i]->{val};
|
||||
my $value = $term->{val};
|
||||
my @value_list;
|
||||
if ( $filter_expr->{terms}[$i]->{attr} ) {
|
||||
if ( $filter_expr->{terms}[$i]->{attr} =~ /^Monitor/ ) {
|
||||
my ( $temp_attr_name ) = $filter_expr->{terms}[$i]->{attr} =~ /^Monitor(.+)$/;
|
||||
if ( $term->{attr} ) {
|
||||
if ( $term->{attr} =~ /^Monitor/ ) {
|
||||
my ( $temp_attr_name ) = $term->{attr} =~ /^Monitor(.+)$/;
|
||||
$self->{Sql} .= "M.".$temp_attr_name;
|
||||
} elsif ( $filter_expr->{terms}[$i]->{attr} eq 'DateTime' ) {
|
||||
} elsif ( $term->{attr} =~ /^Server/ ) {
|
||||
$self->{Sql} .= "M.".$term->{attr};
|
||||
} elsif ( $term->{attr} eq 'DateTime' ) {
|
||||
$self->{Sql} .= "E.StartTime";
|
||||
} elsif ( $filter_expr->{terms}[$i]->{attr} eq 'Date' ) {
|
||||
} elsif ( $term->{attr} eq 'Date' ) {
|
||||
$self->{Sql} .= "to_days( E.StartTime )";
|
||||
} elsif ( $filter_expr->{terms}[$i]->{attr} eq 'Time' ) {
|
||||
} elsif ( $term->{attr} eq 'Time' ) {
|
||||
$self->{Sql} .= "extract( hour_second from E.StartTime )";
|
||||
} elsif ( $filter_expr->{terms}[$i]->{attr} eq 'Weekday' ) {
|
||||
} elsif ( $term->{attr} eq 'Weekday' ) {
|
||||
$self->{Sql} .= "weekday( E.StartTime )";
|
||||
} elsif ( $filter_expr->{terms}[$i]->{attr} eq 'DiskPercent' ) {
|
||||
} elsif ( $term->{attr} eq 'DiskPercent' ) {
|
||||
$self->{Sql} .= "zmDiskPercent";
|
||||
$self->{HasDiskPercent} = !undef;
|
||||
} elsif ( $filter_expr->{terms}[$i]->{attr} eq 'DiskBlocks' ) {
|
||||
} elsif ( $term->{attr} eq 'DiskBlocks' ) {
|
||||
$self->{Sql} .= "zmDiskBlocks";
|
||||
$self->{HasDiskBlocks} = !undef;
|
||||
} elsif ( $filter_expr->{terms}[$i]->{attr} eq 'SystemLoad' ) {
|
||||
} elsif ( $term->{attr} eq 'SystemLoad' ) {
|
||||
$self->{Sql} .= "zmSystemLoad";
|
||||
$self->{HasSystemLoad} = !undef;
|
||||
} else {
|
||||
$self->{Sql} .= "E.".$filter_expr->{terms}[$i]->{attr};
|
||||
$self->{Sql} .= "E.".$term->{attr};
|
||||
}
|
||||
|
||||
( my $stripped_value = $value ) =~ s/^["\']+?(.+)["\']+?$/$1/;
|
||||
foreach my $temp_value ( split( /["'\s]*?,["'\s]*?/, $stripped_value ) ) {
|
||||
if ( $filter_expr->{terms}[$i]->{attr} =~ /^Monitor/ ) {
|
||||
if ( $term->{attr} =~ /^Monitor/ ) {
|
||||
$value = "'$temp_value'";
|
||||
} elsif ( $filter_expr->{terms}[$i]->{attr} eq 'Name'
|
||||
|| $filter_expr->{terms}[$i]->{attr} eq 'Cause'
|
||||
|| $filter_expr->{terms}[$i]->{attr} eq 'Notes'
|
||||
} elsif ( $term->{attr} eq 'ServerId' ) {
|
||||
if ( $temp_value eq 'ZM_SERVER_ID' ) {
|
||||
$value = "'$Config{ZM_SERVER_ID}'";
|
||||
# This gets used later, I forget for what
|
||||
$$self{Server} = new ZoneMinder::Server( $Config{ZM_SERVER_ID} );
|
||||
} else {
|
||||
$value = "'$temp_value'";
|
||||
# This gets used later, I forget for what
|
||||
$$self{Server} = new ZoneMinder::Server( $temp_value );
|
||||
}
|
||||
} elsif ( $term->{attr} eq 'Name'
|
||||
|| $term->{attr} eq 'Cause'
|
||||
|| $term->{attr} eq 'Notes'
|
||||
) {
|
||||
$value = "'$temp_value'";
|
||||
} elsif ( $filter_expr->{terms}[$i]->{attr} eq 'DateTime' ) {
|
||||
} elsif ( $term->{attr} eq 'DateTime' ) {
|
||||
$value = DateTimeToSQL( $temp_value );
|
||||
if ( !$value ) {
|
||||
Error( "Error parsing date/time '$temp_value', "
|
||||
|
@ -255,7 +253,7 @@ sub Sql {
|
|||
return;
|
||||
}
|
||||
$value = "'$value'";
|
||||
} elsif ( $filter_expr->{terms}[$i]->{attr} eq 'Date' ) {
|
||||
} elsif ( $term->{attr} eq 'Date' ) {
|
||||
$value = DateTimeToSQL( $temp_value );
|
||||
if ( !$value ) {
|
||||
Error( "Error parsing date/time '$temp_value', "
|
||||
|
@ -263,7 +261,7 @@ sub Sql {
|
|||
return;
|
||||
}
|
||||
$value = "to_days( '$value' )";
|
||||
} elsif ( $filter_expr->{terms}[$i]->{attr} eq 'Time' ) {
|
||||
} elsif ( $term->{attr} eq 'Time' ) {
|
||||
$value = DateTimeToSQL( $temp_value );
|
||||
if ( !$value ) {
|
||||
Error( "Error parsing date/time '$temp_value', "
|
||||
|
@ -277,21 +275,21 @@ sub Sql {
|
|||
push( @value_list, $value );
|
||||
} # end foreach temp_value
|
||||
} # end if has an attr
|
||||
if ( $filter_expr->{terms}[$i]->{op} ) {
|
||||
if ( $filter_expr->{terms}[$i]->{op} eq '=~' ) {
|
||||
if ( $term->{op} ) {
|
||||
if ( $term->{op} eq '=~' ) {
|
||||
$self->{Sql} .= " regexp $value";
|
||||
} elsif ( $filter_expr->{terms}[$i]->{op} eq '!~' ) {
|
||||
} elsif ( $term->{op} eq '!~' ) {
|
||||
$self->{Sql} .= " not regexp $value";
|
||||
} elsif ( $filter_expr->{terms}[$i]->{op} eq '=[]' ) {
|
||||
} elsif ( $term->{op} eq '=[]' ) {
|
||||
$self->{Sql} .= " in (".join( ",", @value_list ).")";
|
||||
} elsif ( $filter_expr->{terms}[$i]->{op} eq '!~' ) {
|
||||
} elsif ( $term->{op} eq '!~' ) {
|
||||
$self->{Sql} .= " not in (".join( ",", @value_list ).")";
|
||||
} else {
|
||||
$self->{Sql} .= " ".$filter_expr->{terms}[$i]->{op}." $value";
|
||||
$self->{Sql} .= " ".$term->{op}." $value";
|
||||
}
|
||||
} # end if has an operator
|
||||
if ( exists($filter_expr->{terms}[$i]->{cbr}) ) {
|
||||
$self->{Sql} .= " ".str_repeat( ")", $filter_expr->{terms}[$i]->{cbr} )." ";
|
||||
if ( exists($term->{cbr}) ) {
|
||||
$self->{Sql} .= " ".str_repeat( ")", $term->{cbr} )." ";
|
||||
}
|
||||
} # end foreach term
|
||||
} # end if terms
|
||||
|
@ -308,22 +306,22 @@ sub Sql {
|
|||
}
|
||||
my @auto_terms;
|
||||
if ( $self->{AutoArchive} ) {
|
||||
push( @auto_terms, "E.Archived = 0" )
|
||||
push @auto_terms, "E.Archived = 0";
|
||||
}
|
||||
if ( $self->{AutoVideo} ) {
|
||||
push( @auto_terms, "E.Videoed = 0" )
|
||||
push @auto_terms, "E.Videoed = 0";
|
||||
}
|
||||
if ( $self->{AutoUpload} ) {
|
||||
push( @auto_terms, "E.Uploaded = 0" )
|
||||
push @auto_terms, "E.Uploaded = 0";
|
||||
}
|
||||
if ( $self->{AutoEmail} ) {
|
||||
push( @auto_terms, "E.Emailed = 0" )
|
||||
push @auto_terms, "E.Emailed = 0";
|
||||
}
|
||||
if ( $self->{AutoMessage} ) {
|
||||
push( @auto_terms, "E.Messaged = 0" )
|
||||
push @auto_terms, "E.Messaged = 0";
|
||||
}
|
||||
if ( $self->{AutoExecute} ) {
|
||||
push( @auto_terms, "E.Executed = 0" )
|
||||
push @auto_terms, "E.Executed = 0";
|
||||
}
|
||||
if ( @auto_terms ) {
|
||||
$sql .= " and ( ".join( " or ", @auto_terms )." )";
|
||||
|
|
|
@ -1768,7 +1768,7 @@ const Coord Image::centreCoord( const char *text ) const
|
|||
line = text+index;
|
||||
line_no++;
|
||||
}
|
||||
int x = (width - (max_line_len * CHAR_WIDTH) ) / 2;
|
||||
int x = (width - (max_line_len * ZM_CHAR_WIDTH) ) / 2;
|
||||
int y = (height - (line_no * LINE_HEIGHT) ) / 2;
|
||||
return( Coord( x, y ) );
|
||||
}
|
||||
|
@ -1858,7 +1858,7 @@ void Image::Annotate( const char *p_text, const Coord &coord, const unsigned int
|
|||
while ( (index < text_len) && (line_len = strcspn( line, "\n" )) )
|
||||
{
|
||||
|
||||
unsigned int line_width = line_len * CHAR_WIDTH * size;
|
||||
unsigned int line_width = line_len * ZM_CHAR_WIDTH * size;
|
||||
|
||||
unsigned int lo_line_x = coord.X();
|
||||
unsigned int lo_line_y = coord.Y() + (line_no * LINE_HEIGHT * size);
|
||||
|
@ -1889,17 +1889,17 @@ void Image::Annotate( const char *p_text, const Coord &coord, const unsigned int
|
|||
if ( colours == ZM_COLOUR_GRAY8 )
|
||||
{
|
||||
unsigned char *ptr = &buffer[(lo_line_y*width)+lo_line_x];
|
||||
for ( unsigned int y = lo_line_y, r = 0; y < hi_line_y && r < (CHAR_HEIGHT * size); y++, r++, ptr += width )
|
||||
for ( unsigned int y = lo_line_y, r = 0; y < hi_line_y && r < (ZM_CHAR_HEIGHT * size); y++, r++, ptr += width )
|
||||
{
|
||||
unsigned char *temp_ptr = ptr;
|
||||
for ( unsigned int x = lo_line_x, c = 0; x < hi_line_x && c < line_len; c++ )
|
||||
{
|
||||
int f;
|
||||
if (size == 2)
|
||||
f = bigfontdata[(line[c] * CHAR_HEIGHT * size) + r];
|
||||
f = bigfontdata[(line[c] * ZM_CHAR_HEIGHT * size) + r];
|
||||
else
|
||||
f = fontdata[(line[c] * CHAR_HEIGHT) + r];
|
||||
for ( unsigned int i = 0; i < (CHAR_WIDTH * size) && x < hi_line_x; i++, x++, temp_ptr++ )
|
||||
f = fontdata[(line[c] * ZM_CHAR_HEIGHT) + r];
|
||||
for ( unsigned int i = 0; i < (ZM_CHAR_WIDTH * size) && x < hi_line_x; i++, x++, temp_ptr++ )
|
||||
{
|
||||
if ( f & (zm_text_bitmask >> i) )
|
||||
{
|
||||
|
@ -1919,17 +1919,17 @@ void Image::Annotate( const char *p_text, const Coord &coord, const unsigned int
|
|||
unsigned int wc = width * colours;
|
||||
|
||||
unsigned char *ptr = &buffer[((lo_line_y*width)+lo_line_x)*colours];
|
||||
for ( unsigned int y = lo_line_y, r = 0; y < hi_line_y && r < (CHAR_HEIGHT * size); y++, r++, ptr += wc )
|
||||
for ( unsigned int y = lo_line_y, r = 0; y < hi_line_y && r < (ZM_CHAR_HEIGHT * size); y++, r++, ptr += wc )
|
||||
{
|
||||
unsigned char *temp_ptr = ptr;
|
||||
for ( unsigned int x = lo_line_x, c = 0; x < hi_line_x && c < line_len; c++ )
|
||||
{
|
||||
int f;
|
||||
if (size == 2)
|
||||
f = bigfontdata[(line[c] * CHAR_HEIGHT * size) + r];
|
||||
f = bigfontdata[(line[c] * ZM_CHAR_HEIGHT * size) + r];
|
||||
else
|
||||
f = fontdata[(line[c] * CHAR_HEIGHT) + r];
|
||||
for ( unsigned int i = 0; i < (CHAR_WIDTH * size) && x < hi_line_x; i++, x++, temp_ptr += colours )
|
||||
f = fontdata[(line[c] * ZM_CHAR_HEIGHT) + r];
|
||||
for ( unsigned int i = 0; i < (ZM_CHAR_WIDTH * size) && x < hi_line_x; i++, x++, temp_ptr += colours )
|
||||
{
|
||||
if ( f & (zm_text_bitmask >> i) )
|
||||
{
|
||||
|
@ -1955,17 +1955,17 @@ void Image::Annotate( const char *p_text, const Coord &coord, const unsigned int
|
|||
unsigned int wc = width * colours;
|
||||
|
||||
uint8_t *ptr = &buffer[((lo_line_y*width)+lo_line_x)<<2];
|
||||
for ( unsigned int y = lo_line_y, r = 0; y < hi_line_y && r < (CHAR_HEIGHT * size); y++, r++, ptr += wc )
|
||||
for ( unsigned int y = lo_line_y, r = 0; y < hi_line_y && r < (ZM_CHAR_HEIGHT * size); y++, r++, ptr += wc )
|
||||
{
|
||||
Rgb* temp_ptr = (Rgb*)ptr;
|
||||
for ( unsigned int x = lo_line_x, c = 0; x < hi_line_x && c < line_len; c++ )
|
||||
{
|
||||
int f;
|
||||
if (size == 2)
|
||||
f = bigfontdata[(line[c] * CHAR_HEIGHT * size) + r];
|
||||
f = bigfontdata[(line[c] * ZM_CHAR_HEIGHT * size) + r];
|
||||
else
|
||||
f = fontdata[(line[c] * CHAR_HEIGHT) + r];
|
||||
for ( unsigned int i = 0; i < (CHAR_WIDTH * size) && x < hi_line_x; i++, x++, temp_ptr++ )
|
||||
f = fontdata[(line[c] * ZM_CHAR_HEIGHT) + r];
|
||||
for ( unsigned int i = 0; i < (ZM_CHAR_WIDTH * size) && x < hi_line_x; i++, x++, temp_ptr++ )
|
||||
{
|
||||
if ( f & (zm_text_bitmask >> i) )
|
||||
{
|
||||
|
|
|
@ -122,8 +122,8 @@ protected:
|
|||
}
|
||||
|
||||
public:
|
||||
enum { CHAR_HEIGHT=11, CHAR_WIDTH=6 };
|
||||
enum { LINE_HEIGHT=CHAR_HEIGHT+0 };
|
||||
enum { ZM_CHAR_HEIGHT=11, ZM_CHAR_WIDTH=6 };
|
||||
enum { LINE_HEIGHT=ZM_CHAR_HEIGHT+0 };
|
||||
|
||||
protected:
|
||||
static bool initialised;
|
||||
|
|
|
@ -990,12 +990,14 @@ int Zone::Load( Monitor *monitor, Zone **&zones )
|
|||
Polygon polygon;
|
||||
if ( !ParsePolygonString( Coords, polygon ) ) {
|
||||
Error( "Unable to parse polygon string '%s' for zone %d/%s for monitor %s, ignoring", Coords, Id, Name, monitor->Name() );
|
||||
n_zones -= 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( polygon.LoX() < 0 || polygon.HiX() >= (int)monitor->Width()
|
||||
|| polygon.LoY() < 0 || polygon.HiY() >= (int)monitor->Height() ) {
|
||||
Error( "Zone %d/%s for monitor %s extends outside of image dimensions, (%d,%d), (%d,%d), ignoring", Id, Name, monitor->Name(), polygon.LoX(), polygon.LoY(), polygon.HiX(), polygon.HiY() );
|
||||
n_zones -= 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ class AppController extends Controller {
|
|||
if( ! $this->Session->Read('user.Username') ) {
|
||||
throw new UnauthorizedException(__('Not Authenticated'));
|
||||
return;
|
||||
} else if ( ! $this->Session->Read('user.Username') ) {
|
||||
} else if ( ! $this->Session->Read('user.Enabled') ) {
|
||||
throw new UnauthorizedException(__('User is not enabled'));
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -835,9 +835,9 @@ function packageControl( $command ) {
|
|||
function daemonControl( $command, $daemon=false, $args=false ) {
|
||||
$string = ZM_PATH_BIN."/zmdc.pl $command";
|
||||
if ( $daemon ) {
|
||||
$string .= " $daemon";
|
||||
$string .= escapeshellarg(" $daemon");
|
||||
if ( $args ) {
|
||||
$string .= " $args";
|
||||
$string .= escapeshellarg(" $args");
|
||||
}
|
||||
}
|
||||
$string .= " 2>/dev/null >&- <&- >/dev/null";
|
||||
|
@ -947,9 +947,9 @@ function zmaStatus( $monitor ) {
|
|||
function daemonCheck( $daemon=false, $args=false ) {
|
||||
$string = ZM_PATH_BIN."/zmdc.pl check";
|
||||
if ( $daemon ) {
|
||||
$string .= " $daemon";
|
||||
$string .= escapeshellarg(" $daemon");
|
||||
if ( $args )
|
||||
$string .= " $args";
|
||||
$string .= escapeshellarg(" $args");
|
||||
}
|
||||
$result = exec( $string );
|
||||
return( preg_match( '/running/', $result ) );
|
||||
|
@ -1232,6 +1232,9 @@ function parseFilter( &$filter, $saveToSession=false, $querySep='&' ) {
|
|||
case 'MonitorName':
|
||||
$filter['sql'] .= 'M.'.preg_replace( '/^Monitor/', '', $filter['terms'][$i]['attr'] );
|
||||
break;
|
||||
case 'ServerId':
|
||||
$filter['sql'] .= 'M.ServerId';
|
||||
break;
|
||||
case 'DateTime':
|
||||
$filter['sql'] .= "E.StartTime";
|
||||
break;
|
||||
|
@ -1277,6 +1280,13 @@ function parseFilter( &$filter, $saveToSession=false, $querySep='&' ) {
|
|||
case 'Notes':
|
||||
$value = dbEscape($value);
|
||||
break;
|
||||
case 'ServerId':
|
||||
if ( $value == 'ZM_SERVER_ID' ) {
|
||||
$value = ZM_SERVER_ID;
|
||||
} else {
|
||||
$value = dbEscape($value);
|
||||
}
|
||||
break;
|
||||
case 'DateTime':
|
||||
$value = "'".strftime( STRF_FMT_DATETIME_DB, strtotime( $value ) )."'";
|
||||
break;
|
||||
|
@ -1461,7 +1471,7 @@ function getDiskPercent($path = ZM_DIR_EVENTS) {
|
|||
}
|
||||
|
||||
function getDiskBlocks() {
|
||||
$df = shell_exec( 'df '.ZM_DIR_EVENTS );
|
||||
$df = shell_exec( 'df '.escapeshellarg(ZM_DIR_EVENTS) );
|
||||
$space = -1;
|
||||
if ( preg_match( '/\s(\d+)\s+\d+\s+\d+%/ms', $df, $matches ) )
|
||||
$space = $matches[1];
|
||||
|
|
|
@ -125,8 +125,7 @@ $SLANG = array(
|
|||
'AttrMaxScore' => 'Max. Score',
|
||||
'AttrMonitorId' => 'Monitor Id',
|
||||
'AttrMonitorName' => 'Monitor Name',
|
||||
'AttrServerId' => 'Server Id',
|
||||
'AttrServerName' => 'Server Name',
|
||||
'AttrServer' => 'Server',
|
||||
'AttrName' => 'Name',
|
||||
'AttrNotes' => 'Notes',
|
||||
'AttrSystemLoad' => 'System Load',
|
||||
|
@ -616,6 +615,7 @@ $SLANG = array(
|
|||
'Rewind' => 'Rewind',
|
||||
'RotateLeft' => 'Rotate Left',
|
||||
'RotateRight' => 'Rotate Right',
|
||||
'RTSPTransport' => 'RTSP Transport Protocol',
|
||||
'RunLocalUpdate' => 'Please run zmupdate.pl to update',
|
||||
'RunMode' => 'Run Mode',
|
||||
'Running' => 'Running',
|
||||
|
@ -907,6 +907,13 @@ $OLANG = array(
|
|||
"\"reorder_queue_size=nnn\" Set number of packets to buffer for handling of reordered packets~~~~".
|
||||
"\"loglevel=debug\" Set verbosity of FFmpeg (quiet, panic, fatal, error, warning, info, verbose, debug)"
|
||||
),
|
||||
'OPTIONS_RTSPTrans' => array(
|
||||
'Help' => "This sets the RTSP Transport Protocol for FFmpeg.~~ ".
|
||||
"TCP - Use TCP (interleaving within the RTSP control channel) as transport protocol.~~".
|
||||
"UDP - Use UDP as transport protocol. Higher resolution cameras have experienced some 'smearing' while using UDP, if so try TCP~~".
|
||||
"UDP Multicast - Use UDP Multicast as transport protocol~~".
|
||||
"HTTP - Use HTTP tunneling as transport protocol, which is useful for passing proxies.~~"
|
||||
),
|
||||
'OPTIONS_LIBVLC' => array(
|
||||
'Help' => "Parameters in this field are passed on to libVLC. Multiple parameters can be separated by ,~~ ".
|
||||
"Examples (do not enter quotes)~~~~".
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
// Javascript window sizes
|
||||
var popupSizes = {
|
||||
'bandwidth': { 'width': 300, 'height': 120 },
|
||||
'bandwidth': { 'width': 300, 'height': 140 },
|
||||
'console': { 'width': 750, 'height': 312 },
|
||||
'control': { 'width': 380, 'height': 480 },
|
||||
'controlcaps': { 'width': 780, 'height': 320 },
|
||||
|
@ -49,20 +49,20 @@ var popupSizes = {
|
|||
'login': { 'width': 720, 'height': 480 },
|
||||
'logout': { 'width': 260, 'height': 150 },
|
||||
'monitor': { 'width': 550, 'height': 700 },
|
||||
'monitorpreset':{ 'width': 440, 'height': 200 },
|
||||
'monitorprobe': { 'width': 500, 'height': 240 },
|
||||
'monitorpreset':{ 'width': 440, 'height': 210 },
|
||||
'monitorprobe': { 'width': 500, 'height': 275 },
|
||||
'monitorselect':{ 'width': 160, 'height': 200 },
|
||||
'montage': { 'width': -1, 'height': -1 },
|
||||
'onvifprobe': { 'width': 500, 'height': 300 },
|
||||
'optionhelp': { 'width': 400, 'height': 320 },
|
||||
'options': { 'width': 1000, 'height': 660 },
|
||||
'preset': { 'width': 300, 'height': 120 },
|
||||
'settings': { 'width': 220, 'height': 225 },
|
||||
'settings': { 'width': 220, 'height': 235 },
|
||||
'state': { 'width': 400, 'height': 170 },
|
||||
'stats': { 'width': 840, 'height': 200 },
|
||||
'timeline': { 'width': 760, 'height': 540 },
|
||||
'user': { 'width': 360, 'height': 420 },
|
||||
'version': { 'width': 360, 'height': 140 },
|
||||
'version': { 'width': 360, 'height': 185 },
|
||||
'video': { 'width': 420, 'height': 360 },
|
||||
'videoview': { 'addWidth': 48, 'addHeight': 80 },
|
||||
'watch': { 'addWidth': 96, 'minWidth': 420, 'addHeight': 384 },
|
||||
|
|
|
@ -97,8 +97,7 @@ $attrTypes = array(
|
|||
'DiskPercent' => translate('AttrDiskPercent'),
|
||||
'DiskBlocks' => translate('AttrDiskBlocks'),
|
||||
'SystemLoad' => translate('AttrSystemLoad'),
|
||||
'ServerId' => translate('AttrServerId'),
|
||||
'ServerName' => translate('AttrServerName'),
|
||||
'ServerId' => translate('AttrServer'),
|
||||
);
|
||||
$opTypes = array(
|
||||
'=' => translate('OpEq'),
|
||||
|
@ -239,6 +238,18 @@ for ( $i = 0; isset($_REQUEST['filter']) && $i < count($_REQUEST['filter']['term
|
|||
?>
|
||||
<td><?php echo buildSelect( "filter[terms][$i][op]", $opTypes ); ?></td>
|
||||
<td><?php echo buildSelect( "filter[terms][$i][val]", $monitors ); ?></td>
|
||||
<?php
|
||||
}
|
||||
elseif ( $_REQUEST['filter']['terms'][$i]['attr'] == "ServerId" )
|
||||
{
|
||||
$servers = array();
|
||||
$servers['ZM_SERVER_ID'] = 'Current Server';
|
||||
foreach ( dbFetchAll( "SELECT Id,Name FROM Servers ORDER BY lower(Name) ASC" ) as $server ) {
|
||||
$servers[$server['Id']] = $server['Name'];
|
||||
}
|
||||
?>
|
||||
<td><?php echo buildSelect( "filter[terms][$i][op]", $opTypes ); ?></td>
|
||||
<td><?php echo buildSelect( "filter[terms][$i][val]", $servers ); ?></td>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
|
|
|
@ -9,12 +9,14 @@
|
|||
?>
|
||||
|
||||
(
|
||||
function ()
|
||||
function ()
|
||||
{
|
||||
// Append '?(GET query)' to URL if the GET query is not empty.
|
||||
var querySuffix = "<?php
|
||||
if (!empty($_POST["postLoginQuery"]))
|
||||
echo "?".$_POST["postLoginQuery"];
|
||||
if (!empty($_POST["postLoginQuery"])) {
|
||||
parse_str($_POST["postLoginQuery"], $queryParams);
|
||||
echo "?" . http_build_query($queryParams);
|
||||
}
|
||||
?>";
|
||||
|
||||
var newUrl = thisUrl + querySuffix;
|
||||
|
|
|
@ -6,7 +6,7 @@ xhtmlHeaders(__FILE__, translate('Login') );
|
|||
<form class="center-block" name="loginForm" id="loginForm" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
|
||||
<input type="hidden" name="action" value="login"/>
|
||||
<input type="hidden" name="view" value="postlogin"/>
|
||||
<input type="hidden" name="postLoginQuery" value="<?php echo $_SERVER['QUERY_STRING'] ?>">
|
||||
<input type="hidden" name="postLoginQuery" value="<?php echo htmlspecialchars($_SERVER['QUERY_STRING']) ?>">
|
||||
|
||||
<div id="loginError" class="hidden alarm" role="alert">
|
||||
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
|
||||
|
|
|
@ -247,6 +247,13 @@ $rtspMethods = array(
|
|||
"rtpRtspHttp" => "RTP/RTSP/HTTP"
|
||||
);
|
||||
|
||||
$rtspFFMpegMethods = array(
|
||||
"rtpRtsp" => "TCP",
|
||||
"rtpUni" => "UDP",
|
||||
"rtpMulti" => "UDP Multicast",
|
||||
"rtpRtspHttp" => "HTTP Tunnel"
|
||||
);
|
||||
|
||||
$httpMethods = array(
|
||||
"simple" => "Simple",
|
||||
"regexp" => "Regexp",
|
||||
|
@ -886,7 +893,7 @@ switch ( $tab )
|
|||
{
|
||||
?>
|
||||
<tr><td><?php echo translate('SourcePath') ?></td><td><input type="text" name="newMonitor[Path]" value="<?php echo validHtmlStr($newMonitor['Path']) ?>" size="36"/></td></tr>
|
||||
<tr><td><?php echo translate('RemoteMethod') ?></td><td><?php echo buildSelect( "newMonitor[Method]", $rtspMethods ); ?></td></tr>
|
||||
<tr><td><?php echo translate('RemoteMethod') ?> (<?php echo makePopupLink('?view=optionhelp&option=OPTIONS_RTSPTrans', 'zmOptionHelp', 'optionhelp', '?' ) ?>)</td><td><?php echo buildSelect( "newMonitor[Method]", $rtspFFMpegMethods ); ?></td></tr>
|
||||
<tr><td><?php echo translate('Options') ?> (<?php echo makePopupLink( '?view=optionhelp&option=OPTIONS_'.strtoupper($newMonitor['Type']), 'zmOptionHelp', 'optionhelp', '?' ) ?>)</td><td><input type="text" name="newMonitor[Options]" value="<?php echo validHtmlStr($newMonitor['Options']) ?>" size="36"/></td></tr>
|
||||
<?php
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue