Merge branch 'master' into feature-h264-videostorage

This commit is contained in:
Isaac Connor 2016-11-03 16:26:18 -04:00
commit a2f782d61a
25 changed files with 269 additions and 134 deletions

View File

@ -77,6 +77,8 @@ my %soap_version_of :ATTR(:default<('1.1')>);
sub service sub service
{ {
my ($self, $serviceName, $attr) = @_; my ($self, $serviceName, $attr) = @_;
#print "service: " . $services_of{${$self}}{$serviceName}{$attr} . "\n";
# Please note that the Std::Class::Fast docs say not to use ident.
$services_of{ident $self}{$serviceName}{$attr}; $services_of{ident $self}{$serviceName}{$attr};
} }
@ -113,18 +115,14 @@ sub set_soap_version
delete $serializer_of{ ident $self }; delete $serializer_of{ ident $self };
} }
sub get_service_urls sub get_service_urls {
{
my ($self) = @_; my ($self) = @_;
my $result = $self->service('device', 'ep')->GetServices( { my $result = $self->service('device', 'ep')->GetServices( {
IncludeCapability => 'true', # boolean IncludeCapability => 'true', # boolean
},, },,
); );
if ( $result ) {
die $result if not $result;
# print $result . "\n";
foreach my $svc ( @{ $result->get_Service() } ) { foreach my $svc ( @{ $result->get_Service() } ) {
my $short_name = $namespace_map{$svc->get_Namespace()}; my $short_name = $namespace_map{$svc->get_Namespace()};
my $url_svc = $svc->get_XAddr()->get_value(); my $url_svc = $svc->get_XAddr()->get_value();
@ -133,8 +131,44 @@ sub get_service_urls
$self->set_service($short_name, 'url', $url_svc); $self->set_service($short_name, 'url', $url_svc);
} }
} }
# } else {
#print "No results from GetServices: $result\n";
} }
# Some devices do not support getServices, so we have to try getCapabilities
$result = $self->service('device', 'ep')->GetCapabilities( {}, , );
if ( ! $result ) {
print "No results from GetCapabilities: $result\n";
return;
}
# Result is a GetCapabilitiesResponse
foreach my $capabilities ( @{ $result->get_Capabilities() } ) {
foreach my $capability ( 'PTZ', 'Media', 'Imaging', 'Events', 'Device' ) {
if ( my $function = $capabilities->can( "get_$capability" ) ) {
my $Services = $function->( $capabilities );
if ( ! $Services ) {
print "Nothing returned ffrom get_$capability\n";
} else {
foreach my $svc ( @{ $Services } ) {
# The capability versions don't have a namespace, so just lowercase them.
my $short_name = lc $capability;
my $url_svc = $svc->get_XAddr()->get_value();
if( defined $url_svc) {
# print "Got $short_name service\n";
$self->set_service($short_name, 'url', $url_svc);
}
} # end foreach svr
}
} else {
print "No $capability function\n";
} # end if has a get_ function
} # end foreach capability
} # end foreach capabilities
} # end sub get_service_urls
sub http_digest { sub http_digest {
my ($service, $username, $password) = @_; my ($service, $username, $password) = @_;

View File

@ -272,7 +272,11 @@ sub _initialize {
# #
$_method =~s{\.}{__}xg; $_method =~s{\.}{__}xg;
$_method =~s{\-}{_}xg; $_method =~s{\-}{_}xg;
if ( $list->[-1]->can( $_method ) ) {
$list->[-1]->$_method( $current ); $list->[-1]->$_method( $current );
} else {
print ( "ERror " . $list->[-1] . " cannot $_method\n" );
}
$current = pop @$list; # step up in object hierarchy $current = pop @$list; # step up in object hierarchy

View File

@ -15,6 +15,7 @@ __PACKAGE__->__set_ref();
use base qw( use base qw(
SOAP::WSDL::XSD::Typelib::Element SOAP::WSDL::XSD::Typelib::Element
WSDiscovery10::Types::ProbeType WSDiscovery10::Types::ProbeType
WSDiscovery10::Types::ProbeMatchesType
); );
} }

View File

@ -1,4 +1,5 @@
#!/usr/bin/perl -w #!/usr/bin/perl -w
use strict;
# #
# ========================================================================== # ==========================================================================
# #
@ -41,6 +42,7 @@ require WSDiscovery::TransportUDP;
# Globals # Globals
my $verbose = 0; my $verbose = 0;
my $soap_version = undef;
my $client; my $client;
# ========================================================================= # =========================================================================
@ -172,6 +174,8 @@ sub discover
my $uuid_gen = Data::UUID->new(); my $uuid_gen = Data::UUID->new();
if ( ( ! $soap_version ) or ( $soap_version eq '1.1' ) ) {
if($verbose) { if($verbose) {
print "Probing for SOAP 1.1\n" print "Probing for SOAP 1.1\n"
} }
@ -193,28 +197,30 @@ sub discover
To => { value => 'urn:schemas-xmlsoap-org:ws:2005:04:discovery' }, To => { value => 'urn:schemas-xmlsoap-org:ws:2005:04:discovery' },
}) })
); );
# print $result . "\n"; print $result . "\n" if $verbose;
interpret_messages($svc_discover, \%services, @responses); interpret_messages($svc_discover, \%services, @responses);
@responses = (); @responses = ();
} # end if doing soap 1.1
if ( ( ! $soap_version ) or ( $soap_version eq '1.2' ) ) {
if($verbose) { if($verbose) {
print "Probing for SOAP 1.2\n" print "Probing for SOAP 1.2\n"
} }
$svc_discover = WSDiscovery10::Interfaces::WSDiscovery::WSDiscoveryPort->new({ my $svc_discover = WSDiscovery10::Interfaces::WSDiscovery::WSDiscoveryPort->new({
# no_dispatch => '1', # no_dispatch => '1',
}); });
$svc_discover->set_soap_version('1.2'); $svc_discover->set_soap_version('1.2');
# copies of the same Probe message must have the same MessageID. # copies of the same Probe message must have the same MessageID.
# This is not a copy. So we generate a new uuid. # This is not a copy. So we generate a new uuid.
$uuid = $uuid_gen->create_str(); my $uuid = $uuid_gen->create_str();
$result = $svc_discover->ProbeOp( # Everyone else, like the nodejs onvif code and odm only ask for NetworkVideoTransmitter
my $result = $svc_discover->ProbeOp(
{ # WSDiscovery::Types::ProbeType { # WSDiscovery::Types::ProbeType
xmlattr => { 'xmlns:dn' => 'http://www.onvif.org/ver10/network/wsdl', xmlattr => { 'xmlns:dn' => 'http://www.onvif.org/ver10/network/wsdl', },
'xmlns:tds' => 'http://www.onvif.org/ver10/device/wsdl', }, Types => 'dn:NetworkVideoTransmitter', # QNameListType
Types => 'dn:NetworkVideoTransmitter tds:Device', # QNameListType
Scopes => { value => '' }, Scopes => { value => '' },
}, },
WSDiscovery10::Elements::Header->new({ WSDiscovery10::Elements::Header->new({
@ -223,9 +229,10 @@ sub discover
To => { value => 'urn:schemas-xmlsoap-org:ws:2005:04:discovery' }, To => { value => 'urn:schemas-xmlsoap-org:ws:2005:04:discovery' },
}) })
); );
# print $result . "\n"; print $result . "\n" if $verbose;
interpret_messages($svc_discover, \%services, @responses); interpret_messages($svc_discover, \%services, @responses);
} # end if doing soap 1.2
} }
@ -321,7 +328,7 @@ my $OPTIONS = "v";
sub HELP_MESSAGE sub HELP_MESSAGE
{ {
my ($fh, $pkg, $ver, $opts) = @_; my ($fh, $pkg, $ver, $opts) = @_;
print $fh "Usage: " . __FILE__ . " [-v] probe \n"; print $fh "Usage: " . __FILE__ . " [-v] probe <soap version>\n";
print $fh " " . __FILE__ . " [-v] <command> <device URI> <soap version> <user> <password>\n"; print $fh " " . __FILE__ . " [-v] <command> <device URI> <soap version> <user> <password>\n";
print $fh <<EOF print $fh <<EOF
Commands are: Commands are:
@ -359,14 +366,15 @@ if(!defined $action) {
} }
if($action eq "probe") { if($action eq "probe") {
$soap_version = shift;
discover(); discover();
} }
else { else {
# all other actions need URI and credentials # all other actions need URI and credentials
my $url_svc_device = shift; my $url_svc_device = shift @ARGV;
my $soap_version = shift; $soap_version = shift @ARGV;
my $username = shift; my $username = @ARGV ? shift @ARGV : '';
my $password = shift; my $password = @ARGV ? shift @ARGV: '';
$client = ONVIF::Client->new( { $client = ONVIF::Client->new( {
'url_svc_device' => $url_svc_device, 'url_svc_device' => $url_svc_device,

View File

@ -1700,7 +1700,7 @@ our @options =
}, },
{ {
name => "ZM_OPT_FAST_DELETE", name => "ZM_OPT_FAST_DELETE",
default => "yes", default => "no",
description => "Delete only event database records for speed", description => "Delete only event database records for speed",
help => qqq(" help => qqq("
Normally an event created as the result of an alarm consists of Normally an event created as the result of an alarm consists of
@ -1711,7 +1711,8 @@ our @options =
option which means that the browser client only deletes the key option which means that the browser client only deletes the key
entries in the events table, which means the events will no entries in the events table, which means the events will no
longer appear in the listing, and leaves the zmaudit daemon to longer appear in the listing, and leaves the zmaudit daemon to
clear up the rest later. clear up the rest later. Note that this feature is less relevant
with modern hardware. Recommend this feature be left off.
"), "),
type => $types{boolean}, type => $types{boolean},
category => "system", category => "system",

View File

@ -152,11 +152,13 @@ Image::Image( const Image &p_image )
strncpy( text, p_image.text, sizeof(text) ); strncpy( text, p_image.text, sizeof(text) );
} }
Image::~Image() Image::~Image() {
{
DumpImgBuffer(); DumpImgBuffer();
if ( initialised ) }
{
/* Should be called as part of program shutdown to free everything */
void Image::Deinitialise() {
if ( initialised ) {
/* /*
delete[] y_table; delete[] y_table;
delete[] uv_table; delete[] uv_table;
@ -166,9 +168,7 @@ Image::~Image()
delete[] b_u_table; delete[] b_u_table;
*/ */
initialised = false; initialised = false;
} if ( readjpg_dcinfo ) {
if ( readjpg_dcinfo )
{
jpeg_destroy_decompress( readjpg_dcinfo ); jpeg_destroy_decompress( readjpg_dcinfo );
delete readjpg_dcinfo; delete readjpg_dcinfo;
readjpg_dcinfo = 0; readjpg_dcinfo = 0;
@ -179,6 +179,14 @@ Image::~Image()
delete decodejpg_dcinfo; delete decodejpg_dcinfo;
decodejpg_dcinfo = 0; decodejpg_dcinfo = 0;
} }
for ( unsigned int quality=0; quality <= 100; quality += 1 ) {
if ( writejpg_ccinfo[quality] ) {
jpeg_destroy_compress( writejpg_ccinfo[quality] );
delete writejpg_ccinfo[quality];
writejpg_ccinfo[quality] = NULL;
}
} // end foreach quality
}
} }
void Image::Initialise() void Image::Initialise()
@ -187,14 +195,14 @@ void Image::Initialise()
if(config.fast_image_blends) { if(config.fast_image_blends) {
if(config.cpu_extensions && sseversion >= 20) { if(config.cpu_extensions && sseversion >= 20) {
fptr_blend = &sse2_fastblend; /* SSE2 fast blend */ fptr_blend = &sse2_fastblend; /* SSE2 fast blend */
Debug(2,"Blend: Using SSE2 fast blend function"); Debug(4,"Blend: Using SSE2 fast blend function");
} else { } else {
fptr_blend = &std_fastblend; /* standard fast blend */ fptr_blend = &std_fastblend; /* standard fast blend */
Debug(2,"Blend: Using fast blend function"); Debug(4,"Blend: Using fast blend function");
} }
} else { } else {
fptr_blend = &std_blend; fptr_blend = &std_blend;
Debug(2,"Blend: Using standard blend function"); Debug(4,"Blend: Using standard blend function");
} }
__attribute__((aligned(16))) uint8_t blend1[16] = {142,255,159,91,88,227,0,52,37,80,152,97,104,252,90,82}; __attribute__((aligned(16))) uint8_t blend1[16] = {142,255,159,91,88,227,0,52,37,80,152,97,104,252,90,82};
@ -223,7 +231,7 @@ void Image::Initialise()
fptr_delta8_argb = &ssse3_delta8_argb; fptr_delta8_argb = &ssse3_delta8_argb;
fptr_delta8_abgr = &ssse3_delta8_abgr; fptr_delta8_abgr = &ssse3_delta8_abgr;
fptr_delta8_gray8 = &sse2_delta8_gray8; fptr_delta8_gray8 = &sse2_delta8_gray8;
Debug(2,"Delta: Using SSSE3 delta functions"); Debug(4,"Delta: Using SSSE3 delta functions");
} else if(sseversion >= 20) { } else if(sseversion >= 20) {
/* SSE2 available */ /* SSE2 available */
fptr_delta8_rgba = &sse2_delta8_rgba; fptr_delta8_rgba = &sse2_delta8_rgba;
@ -240,7 +248,7 @@ void Image::Initialise()
// fptr_delta8_argb = &std_delta8_argb; // fptr_delta8_argb = &std_delta8_argb;
// fptr_delta8_abgr = &std_delta8_abgr; // fptr_delta8_abgr = &std_delta8_abgr;
fptr_delta8_gray8 = &sse2_delta8_gray8; fptr_delta8_gray8 = &sse2_delta8_gray8;
Debug(2,"Delta: Using SSE2 delta functions"); Debug(4,"Delta: Using SSE2 delta functions");
} else { } else {
/* No suitable SSE version available */ /* No suitable SSE version available */
fptr_delta8_rgba = &std_delta8_rgba; fptr_delta8_rgba = &std_delta8_rgba;
@ -248,7 +256,7 @@ void Image::Initialise()
fptr_delta8_argb = &std_delta8_argb; fptr_delta8_argb = &std_delta8_argb;
fptr_delta8_abgr = &std_delta8_abgr; fptr_delta8_abgr = &std_delta8_abgr;
fptr_delta8_gray8 = &std_delta8_gray8; fptr_delta8_gray8 = &std_delta8_gray8;
Debug(2,"Delta: Using standard delta functions"); Debug(4,"Delta: Using standard delta functions");
} }
} else { } else {
/* CPU extensions disabled */ /* CPU extensions disabled */
@ -257,7 +265,7 @@ void Image::Initialise()
fptr_delta8_argb = &std_delta8_argb; fptr_delta8_argb = &std_delta8_argb;
fptr_delta8_abgr = &std_delta8_abgr; fptr_delta8_abgr = &std_delta8_abgr;
fptr_delta8_gray8 = &std_delta8_gray8; fptr_delta8_gray8 = &std_delta8_gray8;
Debug(2,"Delta: CPU extensions disabled, using standard delta functions"); Debug(4,"Delta: CPU extensions disabled, using standard delta functions");
} }
/* Use SSSE3 deinterlace functions? */ /* Use SSSE3 deinterlace functions? */
@ -267,23 +275,23 @@ void Image::Initialise()
fptr_deinterlace_4field_argb = &ssse3_deinterlace_4field_argb; fptr_deinterlace_4field_argb = &ssse3_deinterlace_4field_argb;
fptr_deinterlace_4field_abgr = &ssse3_deinterlace_4field_abgr; fptr_deinterlace_4field_abgr = &ssse3_deinterlace_4field_abgr;
fptr_deinterlace_4field_gray8 = &ssse3_deinterlace_4field_gray8; fptr_deinterlace_4field_gray8 = &ssse3_deinterlace_4field_gray8;
Debug(2,"Deinterlace: Using SSSE3 delta functions"); Debug(4,"Deinterlace: Using SSSE3 delta functions");
} else { } else {
fptr_deinterlace_4field_rgba = &std_deinterlace_4field_rgba; fptr_deinterlace_4field_rgba = &std_deinterlace_4field_rgba;
fptr_deinterlace_4field_bgra = &std_deinterlace_4field_bgra; fptr_deinterlace_4field_bgra = &std_deinterlace_4field_bgra;
fptr_deinterlace_4field_argb = &std_deinterlace_4field_argb; fptr_deinterlace_4field_argb = &std_deinterlace_4field_argb;
fptr_deinterlace_4field_abgr = &std_deinterlace_4field_abgr; fptr_deinterlace_4field_abgr = &std_deinterlace_4field_abgr;
fptr_deinterlace_4field_gray8 = &std_deinterlace_4field_gray8; fptr_deinterlace_4field_gray8 = &std_deinterlace_4field_gray8;
Debug(2,"Deinterlace: Using standard delta functions"); Debug(4,"Deinterlace: Using standard delta functions");
} }
/* Use SSE2 aligned memory copy? */ /* Use SSE2 aligned memory copy? */
if(config.cpu_extensions && sseversion >= 20) { if(config.cpu_extensions && sseversion >= 20) {
fptr_imgbufcpy = &sse2_aligned_memcpy; fptr_imgbufcpy = &sse2_aligned_memcpy;
Debug(2,"Image buffer copy: Using SSE2 aligned memcpy"); Debug(4,"Image buffer copy: Using SSE2 aligned memcpy");
} else { } else {
fptr_imgbufcpy = &memcpy; fptr_imgbufcpy = &memcpy;
Debug(2,"Image buffer copy: Using standard memcpy"); Debug(4,"Image buffer copy: Using standard memcpy");
} }
/* Code below relocated from zm_local_camera */ /* Code below relocated from zm_local_camera */

View File

@ -137,7 +137,6 @@ protected:
static jpeg_decompress_struct *decodejpg_dcinfo; static jpeg_decompress_struct *decodejpg_dcinfo;
static struct zm_error_mgr jpg_err; static struct zm_error_mgr jpg_err;
protected:
unsigned int width; unsigned int width;
unsigned int height; unsigned int height;
unsigned int pixels; unsigned int pixels;
@ -150,8 +149,6 @@ protected:
int holdbuffer; /* Hold the buffer instead of replacing it with new one */ int holdbuffer; /* Hold the buffer instead of replacing it with new one */
char text[1024]; char text[1024];
protected:
static void Initialise();
public: public:
Image(); Image();
@ -159,6 +156,8 @@ public:
Image( int p_width, int p_height, int p_colours, int p_subpixelorder, uint8_t *p_buffer=0); Image( int p_width, int p_height, int p_colours, int p_subpixelorder, uint8_t *p_buffer=0);
Image( const Image &p_image ); Image( const Image &p_image );
~Image(); ~Image();
static void Initialise();
static void Deinitialise();
inline unsigned int Width() const { return( width ); } inline unsigned int Width() const { return( width ); }
inline unsigned int Height() const { return( height ); } inline unsigned int Height() const { return( height ); }

View File

@ -198,6 +198,7 @@ int main( int argc, char *argv[] )
{ {
fprintf( stderr, "Can't find monitor with id of %d\n", id ); fprintf( stderr, "Can't find monitor with id of %d\n", id );
} }
Image::Deinitialise();
logTerm(); logTerm();
zmDbClose(); zmDbClose();
return( 0 ); return( 0 );

View File

@ -357,6 +357,7 @@ int main( int argc, char *argv[] )
delete [] next_delays; delete [] next_delays;
delete [] last_capture_times; delete [] last_capture_times;
Image::Deinitialise();
logTerm(); logTerm();
zmDbClose(); zmDbClose();

View File

@ -1,5 +1,5 @@
<VirtualHost *:80> <VirtualHost *:80>
DocumentRoot /var/www/zm DocumentRoot /usr/local/share/zoneminder
DirectoryIndex index.php DirectoryIndex index.php
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

View File

@ -53,10 +53,10 @@ escaped="$(echo $temp | sed 's/\//\\\//g')"
} }
# Assign variables once they are properly escaped # Assign variables once they are properly escaped
escape $1 escape "$1"
variable=$escaped variable="$escaped"
escape $2 escape "$2"
default=$escaped default="$escaped"
# Set the path to ConfigData # Set the path to ConfigData
if [ -n "$3" ]; then if [ -n "$3" ]; then
@ -82,7 +82,7 @@ fi
# Don't stare too closely. You will burn your eyes out. # Don't stare too closely. You will burn your eyes out.
sed -i '/.*'${variable}'.*/{ sed -i '/.*'${variable}'.*/{
$!{ N $!{ N
s/\(.*'${variable}'.*\n.*\)\"\(.*\)\"/\1\"'${default}'\"/ s/\(.*'${variable}'.*\n.*\)\"\(.*\)\"/\1\"'"${default}"'\"/
t yes t yes
P P
D D

View File

@ -71,7 +71,7 @@ class DATABASE_CONFIG {
'password' => ZM_DB_PASS, 'password' => ZM_DB_PASS,
'database' => ZM_DB_NAME, 'database' => ZM_DB_NAME,
'prefix' => '', 'prefix' => '',
//'encoding' => 'utf8', 'encoding' => 'utf8',
); );
public $test = array( public $test = array(

View File

@ -99,7 +99,18 @@ class HostController extends AppController {
)); ));
} }
function getTimeZone()
{
//http://php.net/manual/en/function.date-default-timezone-get.php
$tz = date_default_timezone_get();
$this->set(array(
'tz' => $tz,
'_serialize' => array('tz')
));
}
function getVersion() { function getVersion() {
//throw new UnauthorizedException(__('API Disabled'));
$version = Configure::read('ZM_VERSION'); $version = Configure::read('ZM_VERSION');
// not going to use the ZM_API_VERSION // not going to use the ZM_API_VERSION
// requires recompilation and dependency on ZM upgrade // requires recompilation and dependency on ZM upgrade

View File

@ -338,7 +338,9 @@ if ( !empty($action) )
$monitor = dbFetchOne( "SELECT * FROM Monitors WHERE Id=?", NULL, array($mid) ); $monitor = dbFetchOne( "SELECT * FROM Monitors WHERE Id=?", NULL, array($mid) );
$newFunction = validStr($_REQUEST['newFunction']); $newFunction = validStr($_REQUEST['newFunction']);
$newEnabled = isset( $_REQUEST['newEnabled'] ) and $_REQUEST['newEnabled'] != "1" ? "0" : "1"; # Because we use a checkbox, it won't get passed in the request. So not being in _REQUEST means 0
$newEnabled = ( !isset( $_REQUEST['newEnabled'] ) or $_REQUEST['newEnabled'] != '1' ) ? '0' : '1';
$oldFunction = $monitor['Function']; $oldFunction = $monitor['Function'];
$oldEnabled = $monitor['Enabled']; $oldEnabled = $monitor['Enabled'];
if ( $newFunction != $oldFunction || $newEnabled != $oldEnabled ) if ( $newFunction != $oldFunction || $newEnabled != $oldEnabled )

View File

@ -547,6 +547,28 @@ function makePopupButton( $url, $winName, $winSize, $buttonValue, $condition=1,
return( $string ); return( $string );
} }
function htmlSelect( $name, $contents, $values, $behaviours=false ) {
$behaviourText = "";
if ( !empty($behaviours) ) {
if ( is_array($behaviours) ) {
foreach ( $behaviours as $event=>$action ) {
$behaviourText .= ' '.$event.'="'.$action.'"';
}
} else {
$behaviourText = ' onchange="'.$behaviours.'"';
}
}
$html = "<select name=\"$name\" id=\"$name\"$behaviourText>";
foreach ( $contents as $value=>$text ) {
$selected = is_array( $values ) ? in_array( $value, $values ) : $value==$values;
$html .= "<option value=\"$value\"".($selected?" selected=\"selected\"":'').">$text</option>";
}
$html .= "</select>";
return $html;
}
function truncText( $text, $length, $deslash=1 ) { function truncText( $text, $length, $deslash=1 ) {
return( preg_replace( "/^(.{".$length.",}?)\b.*$/", "\\1&hellip;", ($deslash?stripslashes($text):$text) ) ); return( preg_replace( "/^(.{".$length.",}?)\b.*$/", "\\1&hellip;", ($deslash?stripslashes($text):$text) ) );
} }

View File

@ -519,6 +519,7 @@ $SLANG = array(
'NewUser' => 'New User', 'NewUser' => 'New User',
'Next' => 'Next', 'Next' => 'Next',
'NoDetectedCameras' => 'No Detected Cameras', 'NoDetectedCameras' => 'No Detected Cameras',
'NoDetectedProfiles' => 'No Detected Profiles',
'NoFramesRecorded' => 'There are no frames recorded for this event', 'NoFramesRecorded' => 'There are no frames recorded for this event',
'NoGroup' => 'No Group', 'NoGroup' => 'No Group',
'NoneAvailable' => 'None available', 'NoneAvailable' => 'None available',

View File

@ -1,4 +1,3 @@
<?php <?php
// //
// ZoneMinder web UK English language file, $Date$, $Revision$ // ZoneMinder web UK English language file, $Date$, $Revision$

View File

@ -102,8 +102,13 @@ function getPopupSize( tag, width, height )
function zmWindow() function zmWindow()
{ {
var zmWin = window.open( 'http://www.zoneminder.com', 'ZoneMinder' ); var zmWin = window.open( 'http://www.zoneminder.com', 'ZoneMinder' );
if ( ! zmWin ) {
// if popup blocking is enabled, the popup won't be defined.
console.log("Please disable popup blocking.");
} else {
zmWin.focus(); zmWin.focus();
} }
}
function createPopup( url, name, tag, width, height ) function createPopup( url, name, tag, width, height )
{ {
@ -114,8 +119,13 @@ function createPopup( url, name, tag, width, height )
if ( popupSize.height > 0 ) if ( popupSize.height > 0 )
popupDimensions += ",height="+popupSize.height; popupDimensions += ",height="+popupSize.height;
var popup = window.open( url, name, popupOptions+popupDimensions ); var popup = window.open( url, name, popupOptions+popupDimensions );
if ( ! popup ) {
// if popup blocking is enabled, the popup won't be defined.
console.log("Please disable popup blocking.");
} else {
popup.focus(); popup.focus();
} }
}
function createEventPopup( eventId, eventFilter, width, height ) function createEventPopup( eventId, eventFilter, width, height )
{ {
@ -125,8 +135,13 @@ function createEventPopup( eventId, eventFilter, width, height )
var name = 'zmEvent'; var name = 'zmEvent';
var popupSize = getPopupSize( 'event', width, height ); var popupSize = getPopupSize( 'event', width, height );
var popup = window.open( url, name, popupOptions+",width="+popupSize.width+",height="+popupSize.height ); var popup = window.open( url, name, popupOptions+",width="+popupSize.width+",height="+popupSize.height );
if ( ! popup ) {
// if popup blocking is enabled, the popup won't be defined.
console.log("Please disable popup blocking.");
} else {
popup.focus(); popup.focus();
} }
}
function createFramesPopup( eventId, width, height ) function createFramesPopup( eventId, width, height )
{ {
@ -134,8 +149,13 @@ function createFramesPopup( eventId, width, height )
var name = 'zmFrames'; var name = 'zmFrames';
var popupSize = getPopupSize( 'frames', width, height ); var popupSize = getPopupSize( 'frames', width, height );
var popup = window.open( url, name, popupOptions+",width="+popupSize.width+",height="+popupSize.height ); var popup = window.open( url, name, popupOptions+",width="+popupSize.width+",height="+popupSize.height );
if ( ! popup ) {
// if popup blocking is enabled, the popup won't be defined.
console.log("Please disable popup blocking.");
} else {
popup.focus(); popup.focus();
} }
}
function createFramePopup( eventId, frameId, width, height ) function createFramePopup( eventId, frameId, width, height )
{ {
@ -143,8 +163,13 @@ function createFramePopup( eventId, frameId, width, height )
var name = 'zmFrame'; var name = 'zmFrame';
var popupSize = getPopupSize( 'frame', width, height ); var popupSize = getPopupSize( 'frame', width, height );
var popup = window.open( url, name, popupOptions+",width="+popupSize.width+",height="+popupSize.height ); var popup = window.open( url, name, popupOptions+",width="+popupSize.width+",height="+popupSize.height );
if ( ! popup ) {
// if popup blocking is enabled, the popup won't be defined.
console.log("Please disable popup blocking.");
} else {
popup.focus(); popup.focus();
} }
}
function windowToFront() function windowToFront()
{ {

View File

@ -41,10 +41,14 @@ if ( isset( $_REQUEST['rate'] ) )
$rate = validInt($_REQUEST['rate']); $rate = validInt($_REQUEST['rate']);
else else
$rate = reScale( RATE_BASE, $event['DefaultRate'], ZM_WEB_DEFAULT_RATE ); $rate = reScale( RATE_BASE, $event['DefaultRate'], ZM_WEB_DEFAULT_RATE );
if ( isset( $_REQUEST['scale'] ) )
if ( isset( $_REQUEST['scale'] ) ) {
$scale = validInt($_REQUEST['scale']); $scale = validInt($_REQUEST['scale']);
else } else if ( isset( $_COOKIE['zmEventScale'.$event['MonitorId']] ) ) {
$scale = $_COOKIE['zmEventScale'.$event['MonitorId']];
} else {
$scale = reScale( SCALE_BASE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE ); $scale = reScale( SCALE_BASE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
}
$replayModes = array( $replayModes = array(
'single' => translate('ReplaySingle'), 'single' => translate('ReplaySingle'),

View File

@ -17,6 +17,8 @@ function changeScale()
vid.height = newHeight; vid.height = newHeight;
} else { } else {
streamScale( scale ); streamScale( scale );
Cookie.write( 'zmEventScale'+eventData.MonitorId, scale, { duration: 10*365 } );
/*Stream could be an applet so can't use moo tools*/
var streamImg = document.getElementById('evtStream'); var streamImg = document.getElementById('evtStream');
streamImg.style.width = newWidth + "px"; streamImg.style.width = newWidth + "px";
streamImg.style.height = newHeight + "px"; streamImg.style.height = newHeight + "px";

View File

@ -27,6 +27,7 @@ var connKey = '<?php echo $connkey ?>';
var eventData = { var eventData = {
Id: <?php echo $event['Id'] ?>, Id: <?php echo $event['Id'] ?>,
MonitorId: <?php echo $event['MonitorId'] ?>,
Width: <?php echo $event['Width'] ?>, Width: <?php echo $event['Width'] ?>,
Height: <?php echo $event['Height'] ?>, Height: <?php echo $event['Height'] ?>,
Length: <?php echo $event['Length'] ?> Length: <?php echo $event['Length'] ?>

View File

@ -32,8 +32,7 @@ function changeScale()
var newWidth = ( monitorWidth * scale ) / SCALE_BASE; var newWidth = ( monitorWidth * scale ) / SCALE_BASE;
var newHeight = ( monitorHeight * scale ) / SCALE_BASE; var newHeight = ( monitorHeight * scale ) / SCALE_BASE;
// This causes FF3 to kill the stream now, ok with FF2 Cookie.write( 'zmWatchScale'+monitorId, scale, { duration: 10*365 } );
//streamCmdScale( scale );
/*Stream could be an applet so can't use moo tools*/ /*Stream could be an applet so can't use moo tools*/
var streamImg = document.getElementById('liveStream'); var streamImg = document.getElementById('liveStream');

View File

@ -41,7 +41,7 @@ xhtmlHeaders(__FILE__, translate('Login') );
<tbody> <tbody>
<tr> <tr>
<td class="colLeft"><?php echo translate('Username') ?></td> <td class="colLeft"><?php echo translate('Username') ?></td>
<td class="colRight"><input type="text" name="username" value="<?php echo isset($_REQUEST['username'])?validHtmlStr($_REQUEST['username']):"" ?>" size="12"/></td> <td class="colRight"><input type="text" name="username" autocorrect="off" autocapitalize="off" spellcheck="false" value="<?php echo isset($_REQUEST['username'])?validHtmlStr($_REQUEST['username']):"" ?>" size="12"/></td>
</tr> </tr>
<tr> <tr>
<td class="colLeft"><?php echo translate('Password') ?></td> <td class="colLeft"><?php echo translate('Password') ?></td>

View File

@ -27,13 +27,21 @@ if ( !canEdit( 'Monitors' ) )
$cameras = array(); $cameras = array();
$cameras[0] = translate('ChooseDetectedCamera'); $cameras[0] = translate('ChooseDetectedCamera');
$profiles = array();
$profiles[0] = translate('ChooseDetectedProfile');
function execONVIF( $cmd ) function execONVIF( $cmd ) {
{ $shell_command = escapeshellcmd(ZM_PATH_BIN . "/zmonvif-probe.pl $cmd");
exec( escapeshellcmd(ZM_PATH_BIN . "/zmonvif-probe.pl $cmd"), $output, $status );
if ( $status ) exec( $shell_command, $output, $status );
Fatal( "Unable to probe network cameras, status is '$status'" );
if ( $status ) {
$html_output = implode( '<br/>', $output );
Fatal( "Unable to probe network cameras, status is '$status'. Output was:<br/><br/>
$html_output<br/><br/>
Please the following command from a command line for more information:<br/><br/>$shell_command"
);
}
return $output; return $output;
} }
@ -216,9 +224,10 @@ if( !isset($_REQUEST['step']) || ($_REQUEST['step'] == "1")) {
} }
else if($_REQUEST['step'] == "2") else if($_REQUEST['step'] == "2")
{ {
if ( empty($_REQUEST['probe']) || empty($_REQUEST['username']) || if ( empty($_REQUEST['probe']) )
empty($_REQUEST['password']) ) Fatal("No probe passed in request. Please go back and try again.");
Fatal("Internal error. Please re-open this page."); #|| empty($_REQUEST['username']) ||
#empty($_REQUEST['password']) )
$probe = unserialize(base64_decode($_REQUEST['probe'])); $probe = unserialize(base64_decode($_REQUEST['probe']));
foreach ( $probe as $name=>$value ) foreach ( $probe as $name=>$value )
@ -248,11 +257,11 @@ else if($_REQUEST['step'] == "2")
$monitor['Path'] = $profile['Path']; $monitor['Path'] = $profile['Path'];
// $sourceDesc = htmlspecialchars(serialize($monitor)); // $sourceDesc = htmlspecialchars(serialize($monitor));
$sourceDesc = base64_encode(serialize($monitor)); $sourceDesc = base64_encode(serialize($monitor));
$cameras[$sourceDesc] = $sourceString; $profiles[$sourceDesc] = $sourceString;
} }
if ( count($cameras) <= 0 ) if ( count($profiles) <= 0 )
$cameras[0] = translate('NoDetectedCameras'); $profiles[0] = translate('NoDetectedProfiles');
?> ?>
<body> <body>
@ -269,7 +278,7 @@ else if($_REQUEST['step'] == "2")
<?php echo translate('ProfileProbeIntro') ?> <?php echo translate('ProfileProbeIntro') ?>
</p> </p>
<p> <p>
<label for="probe"><?php echo translate('DetectedProfiles') ?></label><?php echo buildSelect( "probe", $cameras, 'configureButtons( this )' ); ?> <label for="probe"><?php echo translate('DetectedProfiles') ?></label><?php echo buildSelect( 'probe', $profiles, 'configureButtons( this )' ); ?>
</p> </p>
<div id="contentButtons"> <div id="contentButtons">
<input type="button" name="prevBtn" value="<?php echo translate('Prev') ?>" onclick="gotoStep1( this )"/> <input type="button" name="prevBtn" value="<?php echo translate('Prev') ?>" onclick="gotoStep1( this )"/>

View File

@ -44,10 +44,13 @@ else
$showPtzControls = ( ZM_OPT_CONTROL && $monitor->Controllable() && canView( 'Control' ) ); $showPtzControls = ( ZM_OPT_CONTROL && $monitor->Controllable() && canView( 'Control' ) );
if ( isset( $_REQUEST['scale'] ) ) if ( isset( $_REQUEST['scale'] ) ) {
$scale = validInt($_REQUEST['scale']); $scale = validInt($_REQUEST['scale']);
else } else if ( isset( $_COOKIE['zmWatchScale'.$mid] ) ) {
$scale = $_COOKIE['zmWatchScale'.$mid];
} else {
$scale = reScale( SCALE_BASE, $monitor->DefaultScale, ZM_WEB_DEFAULT_SCALE ); $scale = reScale( SCALE_BASE, $monitor->DefaultScale, ZM_WEB_DEFAULT_SCALE );
}
$connkey = generateConnKey(); $connkey = generateConnKey();