Merge branch 'master' of github.com:ZoneMinder/ZoneMinder
This commit is contained in:
commit
fbc47359eb
|
@ -23,9 +23,11 @@ env:
|
|||
compiler:
|
||||
- gcc
|
||||
- clang
|
||||
services:
|
||||
- mysql
|
||||
before_install:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -y -qq libpolkit-gobject-1-dev zlib1g-dev apache2 mysql-server php5 php5-mysql build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm automake autoconf cmake libjpeg-turbo8-dev apache2-mpm-prefork libapache2-mod-php5 php5-cli libtheora-dev libvorbis-dev libvpx-dev libx264-dev libvlccore-dev libvlc-dev 2>&1 > /dev/null
|
||||
- sudo apt-get install -y libpolkit-gobject-1-dev zlib1g-dev apache2 php5 php5-mysql build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm automake autoconf cmake libjpeg-turbo8-dev apache2-mpm-prefork libapache2-mod-php5 php5-cli libtheora-dev libvorbis-dev libvpx-dev libx264-dev libvlccore-dev libvlc-dev
|
||||
install:
|
||||
- git clone -b n3.0 --depth=1 git://source.ffmpeg.org/ffmpeg.git
|
||||
- cd ffmpeg
|
||||
|
|
|
@ -147,10 +147,10 @@ set(ZM_PERL_SEARCH_PATH "" CACHE PATH
|
|||
where ZM_PERL_MM_PARMS has been modified such that ZoneMinder's Perl modules are
|
||||
installed outside Perl's default search path.")
|
||||
set(ZM_TARGET_DISTRO "" CACHE STRING
|
||||
"Build ZoneMinder for a specific distribution. Currently, valid names are: f23, f24, el6, el7, OS13, FreeBSD")
|
||||
"Build ZoneMinder for a specific distribution. Currently, valid names are: fc24, fc25, el6, el7, OS13, FreeBSD")
|
||||
|
||||
# Reassign some variables if a target distro has been specified
|
||||
if((ZM_TARGET_DISTRO STREQUAL "f23") OR (ZM_TARGET_DISTRO STREQUAL "f24"))
|
||||
if((ZM_TARGET_DISTRO STREQUAL "fc24") OR (ZM_TARGET_DISTRO STREQUAL "fc25"))
|
||||
set(ZM_RUNDIR "/var/run/zoneminder")
|
||||
set(ZM_SOCKDIR "/var/lib/zoneminder/sock")
|
||||
set(ZM_TMPDIR "/var/lib/zoneminder/temp")
|
||||
|
@ -193,7 +193,7 @@ elseif(ZM_TARGET_DISTRO STREQUAL "FreeBSD")
|
|||
set(ZM_WEBDIR "/usr/local/share/zoneminder/www")
|
||||
set(ZM_CGIDIR "/usr/local/libexec/zoneminder/cgi-bin")
|
||||
set(ZM_PERL_MM_PARMS "INSTALLDIRS=site")
|
||||
endif((ZM_TARGET_DISTRO STREQUAL "f23") OR (ZM_TARGET_DISTRO STREQUAL "f24"))
|
||||
endif((ZM_TARGET_DISTRO STREQUAL "fc24") OR (ZM_TARGET_DISTRO STREQUAL "fc25"))
|
||||
|
||||
# Required for certain checks to work
|
||||
set(CMAKE_EXTRA_INCLUDE_FILES
|
||||
|
@ -708,13 +708,13 @@ if(ZM_ONVIF)
|
|||
endif(ZM_ONVIF)
|
||||
|
||||
# Process distro subdirectories
|
||||
if((ZM_TARGET_DISTRO STREQUAL "f23") OR (ZM_TARGET_DISTRO STREQUAL "f24"))
|
||||
if((ZM_TARGET_DISTRO STREQUAL "fc24") OR (ZM_TARGET_DISTRO STREQUAL "fc25"))
|
||||
add_subdirectory(distros/fedora)
|
||||
elseif((ZM_TARGET_DISTRO STREQUAL "el6") OR (ZM_TARGET_DISTRO STREQUAL "el7"))
|
||||
add_subdirectory(distros/redhat)
|
||||
elseif(ZM_TARGET_DISTRO STREQUAL "OS13")
|
||||
add_subdirectory(distros/opensuse)
|
||||
endif((ZM_TARGET_DISTRO STREQUAL "f23") OR (ZM_TARGET_DISTRO STREQUAL "f24"))
|
||||
endif((ZM_TARGET_DISTRO STREQUAL "fc24") OR (ZM_TARGET_DISTRO STREQUAL "fc25"))
|
||||
|
||||
# Print optional libraries detection status
|
||||
message(STATUS "Optional libraries found:${optlibsfound}")
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Alias /zm /usr/share/zoneminder/www
|
||||
|
||||
<Directory /usr/share/zoneminder/www>
|
||||
Options Indexes FollowSymLinks
|
||||
Options -Indexes +FollowSymLinks
|
||||
<IfModule mod_dir.c>
|
||||
DirectoryIndex index.php
|
||||
</IfModule>
|
||||
|
|
|
@ -4,15 +4,16 @@
|
|||
message([STATUS] "Starting Fedora Build Options" ...)
|
||||
|
||||
# Process config files
|
||||
configure_file(zoneminder.service.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.service @ONLY)
|
||||
configure_file(zoneminder.tmpfiles.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.tmpfiles @ONLY)
|
||||
configure_file(zoneminder.logrotate.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.logrotate @ONLY)
|
||||
if(ZM_WEB_USER STREQUAL "nginx")
|
||||
configure_file(nginx/zoneminder.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.conf @ONLY)
|
||||
configure_file(nginx/zoneminder.service.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.service @ONLY)
|
||||
configure_file(nginx/zoneminder.php-fpm.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.php-fpm.conf @ONLY)
|
||||
configure_file(nginx/README.Fedora ${CMAKE_CURRENT_SOURCE_DIR}/README.Fedora COPYONLY)
|
||||
else(ZM_WEB_USER STREQUAL "nginx")
|
||||
configure_file(zoneminder.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.conf @ONLY)
|
||||
configure_file(zoneminder.service.in ${CMAKE_CURRENT_SOURCE_DIR}/zoneminder.service @ONLY)
|
||||
endif(ZM_WEB_USER STREQUAL "nginx")
|
||||
|
||||
# Unpack jscalendar & move files into position
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
# ZoneMinder systemd unit file for Fedora
|
||||
# Replace mariadb with community-mysql if using mysql service instead of mariadb
|
||||
|
||||
[Unit]
|
||||
Description=ZoneMinder CCTV recording and security system
|
||||
After=network.target mariadb.service nginx.service php-fpm.service fcgiwrap.service
|
||||
Requires=mariadb.service nginx.service php-fpm.service fcgiwrap.service
|
||||
|
||||
[Service]
|
||||
User=@WEB_USER@
|
||||
Type=forking
|
||||
ExecStart=@BINDIR@/zmpkg.pl start
|
||||
ExecReload=@BINDIR@/zmpkg.pl restart
|
||||
ExecStop=@BINDIR@/zmpkg.pl stop
|
||||
PIDFile="@ZM_RUNDIR@/zm.pid"
|
||||
Environment=TZ=/etc/localtime
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1 +0,0 @@
|
|||
zoneminder.f24.spec
|
|
@ -1,429 +0,0 @@
|
|||
%define zmuid $(id -un)
|
||||
%define zmgid $(id -gn)
|
||||
%define zmuid_final apache
|
||||
%define zmgid_final apache
|
||||
|
||||
%global _hardened_build 1
|
||||
|
||||
### Delete the lines below to build with ffmpeg and/or x10
|
||||
%define _without_ffmpeg 1
|
||||
%define _without_x10 1
|
||||
|
||||
Name: zoneminder
|
||||
Version: 1.30.0
|
||||
Release: 1%{?dist}
|
||||
Summary: A camera monitoring and analysis tool
|
||||
Group: System Environment/Daemons
|
||||
# jscalendar is LGPL (any version): http://www.dynarch.com/projects/calendar/
|
||||
# Mootools is inder the MIT license: http://mootools.net/
|
||||
License: GPLv2+ and LGPLv2+ and MIT
|
||||
URL: http://www.zoneminder.com/
|
||||
|
||||
#Source: https://github.com/ZoneMinder/ZoneMinder/archive/v%{version}.tar.gz
|
||||
Source: ZoneMinder-%{version}.tar.gz
|
||||
|
||||
BuildRequires: cmake gnutls-devel systemd-units bzip2-devel
|
||||
BuildRequires: mariadb-devel pcre-devel libjpeg-turbo-devel
|
||||
BuildRequires: perl(Archive::Tar) perl(Archive::Zip) perl-podlators
|
||||
BuildRequires: perl(Date::Manip) perl(DBD::mysql)
|
||||
BuildRequires: perl(ExtUtils::MakeMaker) perl(LWP::UserAgent)
|
||||
BuildRequires: perl(MIME::Entity) perl(MIME::Lite)
|
||||
BuildRequires: perl(PHP::Serialization) perl(Sys::Mmap)
|
||||
BuildRequires: perl(Time::HiRes) perl(Net::SFTP::Foreign)
|
||||
BuildRequires: perl(Expect) perl(Sys::Syslog)
|
||||
BuildRequires: gcc gcc-c++ vlc-devel libcurl-devel libv4l-devel
|
||||
%{!?_without_ffmpeg:BuildRequires: ffmpeg-devel}
|
||||
%{!?_without_x10:BuildRequires: perl(X10::ActiveHome) perl(Astro::SunTime)}
|
||||
# cmake needs the following installed at build time due to the way it auto-detects certain parameters
|
||||
BuildRequires: httpd polkit-devel
|
||||
%{!?_without_ffmpeg:BuildRequires: ffmpeg}
|
||||
|
||||
Requires: httpd php php-gd php-mysql cambozola polkit net-tools psmisc
|
||||
Requires: libjpeg-turbo vlc-core libcurl
|
||||
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
|
||||
Requires: perl(DBD::mysql) perl(Archive::Tar) perl(Archive::Zip)
|
||||
Requires: perl(MIME::Entity) perl(MIME::Lite) perl(Net::SMTP) perl(Net::FTP)
|
||||
Requires: perl(LWP::Protocol::https)
|
||||
%{!?_without_ffmpeg:Requires: ffmpeg}
|
||||
|
||||
Requires(post): systemd-units systemd-sysv
|
||||
Requires(post): /usr/bin/gpasswd
|
||||
Requires(post): /usr/bin/less
|
||||
Requires(preun): systemd-units
|
||||
Requires(postun): systemd-units
|
||||
|
||||
%description
|
||||
ZoneMinder is a set of applications which is intended to provide a complete
|
||||
solution allowing you to capture, analyse, record and monitor any cameras you
|
||||
have attached to a Linux based machine. It is designed to run on kernels which
|
||||
support the Video For Linux (V4L) interface and has been tested with cameras
|
||||
attached to BTTV cards, various USB cameras and IP network cameras. It is
|
||||
designed to support as many cameras as you can attach to your computer without
|
||||
too much degradation of performance.
|
||||
|
||||
%prep
|
||||
%setup -q -n ZoneMinder-%{version}
|
||||
|
||||
# Change the following default values
|
||||
./utils/zmeditconfigdata.sh ZM_PATH_ZMS /cgi-bin-zm/nph-zms
|
||||
./utils/zmeditconfigdata.sh ZM_OPT_CAMBOZOLA yes
|
||||
./utils/zmeditconfigdata.sh ZM_PATH_SWAP /dev/shm
|
||||
./utils/zmeditconfigdata.sh ZM_UPLOAD_FTP_LOC_DIR /var/spool/zoneminder-upload
|
||||
./utils/zmeditconfigdata.sh ZM_OPT_CONTROL yes
|
||||
./utils/zmeditconfigdata.sh ZM_CHECK_FOR_UPDATES no
|
||||
./utils/zmeditconfigdata.sh ZM_DYN_SHOW_DONATE_REMINDER no
|
||||
./utils/zmeditconfigdata.sh ZM_OPT_FAST_DELETE no
|
||||
|
||||
%build
|
||||
%cmake \
|
||||
-DZM_TARGET_DISTRO="f23" \
|
||||
%{?_without_ffmpeg:-DZM_NO_FFMPEG=ON} \
|
||||
%{?_without_x10:-DZM_NO_X10=ON} \
|
||||
.
|
||||
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
export DESTDIR=%{buildroot}
|
||||
make install
|
||||
|
||||
%post
|
||||
|
||||
# Add any new PTZ control configurations to the database (will not overwrite)
|
||||
%{_bindir}/zmcamtool.pl --import >/dev/null 2>&1 || :
|
||||
|
||||
if [ $1 -eq 1 ] ; then
|
||||
# Initial installation
|
||||
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
fi
|
||||
|
||||
# Allow zoneminder access to local video sources, serial ports, and x10
|
||||
/usr/bin/gpasswd -a %{zmuid_final} video
|
||||
/usr/bin/gpasswd -a %{zmuid_final} dialout
|
||||
|
||||
# Upgrade from a previous version of zoneminder
|
||||
if [ $1 -eq 2 ] ; then
|
||||
|
||||
# Add any new PTZ control configurations to the database (will not overwrite)
|
||||
%{_bindir}/zmcamtool.pl --import >/dev/null 2>&1 || :
|
||||
|
||||
# Freshen the database
|
||||
%{_bindir}/zmupdate.pl -f >/dev/null 2>&1 || :
|
||||
|
||||
# We can't run this automatically when new sql account permissions need to
|
||||
# be manually added first
|
||||
# Run zmupdate non-interactively
|
||||
#/usr/bin/zmupdate.pl --nointeractive
|
||||
fi
|
||||
|
||||
# Warn the end user to read the README file
|
||||
echo -e "\nVERY IMPORTANT: Before starting ZoneMinder, read README.Fedora to finish the\ninstallation or upgrade!\n"
|
||||
echo -e "\nThe README file is located here: %{_docdir}/%{name}\n"
|
||||
|
||||
%preun
|
||||
if [ $1 -eq 0 ] ; then
|
||||
# Package removal, not upgrade
|
||||
/bin/systemctl --no-reload disable zoneminder.service > /dev/null 2>&1 || :
|
||||
/bin/systemctl stop zoneminder.service > /dev/null 2>&1 || :
|
||||
fi
|
||||
|
||||
%postun
|
||||
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
if [ $1 -ge 1 ] ; then
|
||||
# Package upgrade, not uninstall
|
||||
/bin/systemctl try-restart zoneminder.service >/dev/null 2>&1 || :
|
||||
fi
|
||||
|
||||
%triggerun -- zoneminder < 1.25.0-4
|
||||
# Save the current service runlevel info
|
||||
# User must manually run systemd-sysv-convert --apply zoneminder
|
||||
# to migrate them to systemd targets
|
||||
/usr/bin/systemd-sysv-convert --save zoneminder >/dev/null 2>&1 ||:
|
||||
|
||||
# Run these because the SysV package being removed won't do them
|
||||
/sbin/chkconfig --del zoneminder >/dev/null 2>&1 || :
|
||||
/bin/systemctl try-restart zoneminder.service >/dev/null 2>&1 || :
|
||||
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc AUTHORS COPYING README.md distros/fedora/README.Fedora distros/fedora/README.https distros/fedora/jscalendar-doc
|
||||
%config %attr(640,root,%{zmgid_final}) /etc/zm/zm.conf
|
||||
%config(noreplace) %attr(644,root,root) /etc/httpd/conf.d/zoneminder.conf
|
||||
%config(noreplace) /etc/tmpfiles.d/zoneminder.conf
|
||||
%config(noreplace) /etc/logrotate.d/zoneminder
|
||||
|
||||
%{_unitdir}/zoneminder.service
|
||||
|
||||
%{_bindir}/zma
|
||||
%{_bindir}/zmaudit.pl
|
||||
%{_bindir}/zmc
|
||||
%{_bindir}/zmcontrol.pl
|
||||
%{_bindir}/zmdc.pl
|
||||
%{_bindir}/zmf
|
||||
%{_bindir}/zmfilter.pl
|
||||
%{_bindir}/zmpkg.pl
|
||||
%{_bindir}/zmtrack.pl
|
||||
%{_bindir}/zmtrigger.pl
|
||||
%{_bindir}/zmu
|
||||
%{_bindir}/zmupdate.pl
|
||||
%{_bindir}/zmvideo.pl
|
||||
%{_bindir}/zmwatch.pl
|
||||
%{_bindir}/zmcamtool.pl
|
||||
%{_bindir}/zmsystemctl.pl
|
||||
%{_bindir}/zmtelemetry.pl
|
||||
%{!?_without_x10:%{_bindir}/zmx10.pl}
|
||||
%{_bindir}/zmonvif-probe.pl
|
||||
|
||||
%{perl_vendorlib}/ZoneMinder*
|
||||
%{perl_vendorlib}/ONVIF*
|
||||
%{perl_vendorlib}/WSDiscovery*
|
||||
%{perl_vendorlib}/WSSecurity*
|
||||
%{perl_vendorlib}/WSNotification*
|
||||
%{_mandir}/man*/*
|
||||
%dir %{_libexecdir}/zoneminder
|
||||
%{_libexecdir}/zoneminder/cgi-bin
|
||||
%dir %{_datadir}/zoneminder
|
||||
%{_datadir}/zoneminder/db
|
||||
%{_datadir}/zoneminder/www
|
||||
|
||||
%{_datadir}/polkit-1/actions/com.zoneminder.systemctl.policy
|
||||
%{_datadir}/polkit-1/rules.d/com.zoneminder.systemctl.rules
|
||||
|
||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder
|
||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/events
|
||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/images
|
||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/sock
|
||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/swap
|
||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/temp
|
||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/log/zoneminder
|
||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/spool/zoneminder-upload
|
||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /run/zoneminder
|
||||
|
||||
|
||||
%changelog
|
||||
* Thu Mar 3 2016 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.30.0
|
||||
- Bump version fo 1.30.0 release.
|
||||
|
||||
* Sat Nov 21 2015 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.29.0
|
||||
- Bump version for 1.29.0 release on Fedora 23.
|
||||
|
||||
* Sat Feb 14 2015 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.28.1
|
||||
- Bump version for 1.28.1 release on Fedora 21.
|
||||
|
||||
* Sun Oct 5 2014 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.28.0
|
||||
- Bump version for 1.28.0 release.
|
||||
|
||||
* Fri Mar 14 2014 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.27
|
||||
- Tweak build requirements for cmake
|
||||
|
||||
* Sat Feb 01 2014 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.27
|
||||
- Add zmcamtool.pl. Bump version for 1.27 release.
|
||||
|
||||
* Mon Dec 16 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.5
|
||||
- This is a bug fixe release
|
||||
- RTSP fixes, cmake enhancements, couple other misc fixes
|
||||
|
||||
* Mon Oct 07 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.4
|
||||
- Initial cmake build.
|
||||
|
||||
* Sat Oct 05 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.4
|
||||
- Fedora specific path changes have been moved to zoneminder-1.26.0-defaults.patch
|
||||
- All files are now part of the zoneminder source tree. Update specfile accordingly.
|
||||
|
||||
* Sat Sep 21 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.3
|
||||
- Initial rebuild for ZoneMinder 1.26.3 release.
|
||||
|
||||
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.25.0-13
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
||||
|
||||
* Mon Jan 21 2013 Adam Tkac <atkac redhat com> - 1.25.0-12
|
||||
- rebuild due to "jpeg8-ABI" feature drop
|
||||
|
||||
* Mon Jan 7 2013 Remi Collet <rcollet@redhat.com> - 1.25.0-11
|
||||
- fix configuration file for httpd 2.4, #871502
|
||||
|
||||
* Fri Dec 21 2012 Adam Tkac <atkac redhat com> - 1.25.0-10
|
||||
- rebuild against new libjpeg
|
||||
|
||||
* Thu Aug 09 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-9
|
||||
- Add patch to work around v4l2 api breakage in 3.5 kernel.
|
||||
|
||||
* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.25.0-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||
|
||||
* Sat Jun 23 2012 Petr Pisar <ppisar@redhat.com> - 1.25.0-7
|
||||
- Perl 5.16 rebuild
|
||||
|
||||
* Wed Mar 21 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-6
|
||||
- Fix stupid thinko in sql modifications.
|
||||
|
||||
* Sat Feb 25 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-5
|
||||
- Clean up macro usage.
|
||||
|
||||
* Sat Feb 25 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-4
|
||||
- Convert to systemd.
|
||||
- Add tmpfiles.d configuration since the initscript isn't around to create
|
||||
/run/zoneminder.
|
||||
- Remove some pointless executable permissions.
|
||||
- Add logrotate file.
|
||||
|
||||
* Wed Feb 22 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-3
|
||||
- Update README.Fedora to reference systemctl and mention timezone info in
|
||||
php.ini.
|
||||
- Add proper default for EYEZM_LOG_TO_FILE.
|
||||
|
||||
|
||||
* Thu Feb 09 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-2
|
||||
- Rebuild for new pcre.
|
||||
|
||||
* Thu Jan 19 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-1
|
||||
- Update to 1.25.0
|
||||
- Fix gcc4.7 build problems.
|
||||
- Drop gcc4.4 build fixes; for whatever reason they now break the build.
|
||||
- Clean up old patches.
|
||||
- Force setting of ZM_TMPDIR and ZM_RUNDIR.
|
||||
|
||||
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.24.4-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||
|
||||
* Thu Sep 15 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.4-3
|
||||
- Re-add the dist-tag that somehow got lost.
|
||||
|
||||
* Thu Sep 15 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.4-2
|
||||
- Add patch for bug 711780 - fix syntax issue in Mapped.pm.
|
||||
- Undo that patch, and undo another which was the cause of the whole mess.
|
||||
- Fix up other patches so ZM_PATH_BUILD is both defined and useful.
|
||||
- Make sure database creation mods actually take.
|
||||
- Update Fedora-specific docs with some additional info.
|
||||
- Use bundled mootools (javascript, so no guideline violation).
|
||||
- Update download location.
|
||||
- Update the gcrypt patch to actually work.
|
||||
- Upstream changed the tarball without changing the version to patch a
|
||||
vulnerability, so redownload.
|
||||
|
||||
* Sun Aug 14 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.4-1
|
||||
- Initial attempt to upgrade to 1.24.4.
|
||||
- Add patch from BZ 460310 to build against libgcrypt instead of requiring the
|
||||
gnutls openssl libs.
|
||||
|
||||
* Thu Jul 21 2011 Petr Sabata <contyk@redhat.com> - 1.24.3-7.20110324svn3310
|
||||
- Perl mass rebuild
|
||||
|
||||
* Wed Jul 20 2011 Petr Sabata <contyk@redhat.com> - 1.24.3-6.20110324svn3310
|
||||
- Perl mass rebuild
|
||||
|
||||
* Mon May 09 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.3-5.20110324svn3310
|
||||
- Bump for gnutls update.
|
||||
|
||||
* Thu Mar 24 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.3-4.20110324svn3310
|
||||
- Update to latest 1.24.3 subversion. Turns out that what upstream was calling
|
||||
1.24.3 is really just an occasionally updated devel snapshot.
|
||||
- Rebase various patches.
|
||||
|
||||
* Wed Mar 23 2011 Dan Horák <dan@danny.cz> - 1.24.3-3
|
||||
- rebuilt for mysql 5.5.10 (soname bump in libmysqlclient)
|
||||
|
||||
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.24.3-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
||||
|
||||
* Tue Jan 25 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.3-1
|
||||
- Update to latest upstream version.
|
||||
- Rebase patches.
|
||||
- Initial incomplete attempt to disable v4l1 support.
|
||||
|
||||
* Fri Jan 21 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.2-6
|
||||
- Unbundle cambozola; instead link to the separately pacakged copy.
|
||||
- Remove BuildRoot:, %%clean and buildroot cleaning in %%install.
|
||||
- Git rid of mixed space/tab usage by removing all tabs.
|
||||
- Remove unnecessary Conflicts: line.
|
||||
- Attempt to force short_open_tag on for the code directories.
|
||||
- Move default location of sockets, swaps, logfiles and some temporary files to
|
||||
make more sense and allow things to work better with a future selinux policy.
|
||||
- Fix errors in README.Fedora.
|
||||
|
||||
* Wed Jun 02 2010 Marcela Maslanova <mmaslano@redhat.com> - 1.24.2-5
|
||||
- Mass rebuild with perl-5.12.0
|
||||
|
||||
* Fri Dec 4 2009 Stepan Kasal <skasal@redhat.com> - 1.24.2-4
|
||||
- rebuild against perl 5.10.1
|
||||
- use Perl vendorarch and archlib variables correctly
|
||||
|
||||
* Mon Jul 27 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.24.2-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
|
||||
|
||||
* Wed Jul 22 2009 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.2-2
|
||||
- Bump release since 1.24.2-1 was mistakenly tagged a few months ago.
|
||||
|
||||
* Wed Jul 22 2009 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.2-1
|
||||
- Initial update to 1.24.2.
|
||||
- Rebase patches.
|
||||
- Update mootools download location.
|
||||
- Update to mootools 1.2.3.
|
||||
- Add additional dependencies for some optional features.
|
||||
|
||||
* Sat Apr 11 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-3
|
||||
- Remove unused Sys::Mmap perl dependency RPM is finding
|
||||
|
||||
* Sat Apr 11 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-2
|
||||
- Update gcc44 patch to disable -frepo, seems to be broken with gcc44
|
||||
- Added noffmpeg patch to make building outside mock easier
|
||||
|
||||
* Sat Mar 21 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-1
|
||||
- Patch for gcc 4.4 compilation errors
|
||||
- Upgrade to 1.24.1
|
||||
|
||||
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.23.3-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
|
||||
|
||||
* Sat Jan 24 2009 Caolán McNamara <caolanm@redhat.com> - 1.23.3-3
|
||||
- rebuild for dependencies
|
||||
|
||||
* Mon Dec 15 2008 Martin Ebourne <martin@zepler.org> - 1.23.3-2
|
||||
- Fix permissions on zm.conf
|
||||
|
||||
* Fri Jul 11 2008 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.23.3-1
|
||||
- Initial attempt at packaging 1.23.
|
||||
|
||||
* Tue Jul 1 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-15
|
||||
- Add perl module compat dependency, bz #453590
|
||||
|
||||
* Tue May 6 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-14
|
||||
- Remove default runlevel, bz #441315
|
||||
|
||||
* Mon Apr 28 2008 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.22.3-13
|
||||
- Backport patch for CVE-2008-1381 from 1.23.3 to 1.22.3.
|
||||
|
||||
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.22.3-12
|
||||
- Autorebuild for GCC 4.3
|
||||
|
||||
* Thu Jan 3 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-11
|
||||
- Fix compilation on gcc 4.3
|
||||
|
||||
* Thu Dec 6 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-10
|
||||
- Rebuild for new openssl
|
||||
|
||||
* Thu Aug 2 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-8
|
||||
- Fix licence tag
|
||||
|
||||
* Thu Jul 12 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-7
|
||||
- Fixes from testing by Jitz including missing dependencies and database creation
|
||||
|
||||
* Sat Jun 30 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-6
|
||||
- Disable crashtrace on ppc
|
||||
|
||||
* Sat Jun 30 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-5
|
||||
- Fix uid for directories in /var/lib/zoneminder
|
||||
|
||||
* Tue Jun 26 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-4
|
||||
- Added perl Archive::Tar dependency
|
||||
- Disabled web interface due to lack of access control on the event images
|
||||
|
||||
* Sun Jun 10 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-3
|
||||
- Changes recommended in review by Jason Tibbitts
|
||||
|
||||
* Mon Apr 2 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-2
|
||||
- Standardised on package name of zoneminder
|
||||
|
||||
* Thu Dec 28 2006 Martin Ebourne <martin@zepler.org> - 1.22.3-1
|
||||
- First version. Uses some parts from zm-1.20.1 by Corey DeLasaux and Serg Oskin
|
|
@ -0,0 +1 @@
|
|||
zoneminder.f25.spec
|
|
@ -0,0 +1,436 @@
|
|||
%define zmuid $(id -un)
|
||||
%define zmgid $(id -gn)
|
||||
%define zmuid_final apache
|
||||
%define zmgid_final apache
|
||||
|
||||
%global _hardened_build 1
|
||||
|
||||
### Delete the lines below to build with ffmpeg and/or x10
|
||||
%define _without_ffmpeg 1
|
||||
%define _without_x10 1
|
||||
|
||||
Name: zoneminder
|
||||
Version: 1.30.0
|
||||
Release: 1%{?dist}
|
||||
Summary: A camera monitoring and analysis tool
|
||||
Group: System Environment/Daemons
|
||||
# jscalendar is LGPL (any version): http://www.dynarch.com/projects/calendar/
|
||||
# Mootools is inder the MIT license: http://mootools.net/
|
||||
License: GPLv2+ and LGPLv2+ and MIT
|
||||
URL: http://www.zoneminder.com/
|
||||
|
||||
#Source: https://github.com/ZoneMinder/ZoneMinder/archive/v%{version}.tar.gz
|
||||
Source: ZoneMinder-%{version}.tar.gz
|
||||
|
||||
BuildRequires: cmake gnutls-devel systemd-units bzip2-devel
|
||||
BuildRequires: mariadb-devel pcre-devel libjpeg-turbo-devel
|
||||
BuildRequires: perl(Archive::Tar) perl(Archive::Zip) perl-podlators
|
||||
BuildRequires: perl(Date::Manip) perl(DBD::mysql)
|
||||
BuildRequires: perl(ExtUtils::MakeMaker) perl(LWP::UserAgent)
|
||||
BuildRequires: perl(MIME::Entity) perl(MIME::Lite)
|
||||
BuildRequires: perl(PHP::Serialization) perl(Sys::Mmap)
|
||||
BuildRequires: perl(Time::HiRes) perl(Net::SFTP::Foreign)
|
||||
BuildRequires: perl(Expect) perl(Sys::Syslog)
|
||||
BuildRequires: gcc gcc-c++ vlc-devel libcurl-devel libv4l-devel
|
||||
%{!?_without_ffmpeg:BuildRequires: ffmpeg-devel}
|
||||
%{!?_without_x10:BuildRequires: perl(X10::ActiveHome) perl(Astro::SunTime)}
|
||||
# cmake needs the following installed at build time due to the way it auto-detects certain parameters
|
||||
BuildRequires: httpd polkit-devel
|
||||
%{!?_without_ffmpeg:BuildRequires: ffmpeg}
|
||||
|
||||
# php-mysql was deprecated beginning with f25
|
||||
%if 0%{?fedora} >= 25
|
||||
Requires: php-mysqlnd
|
||||
%else
|
||||
Requires: php-mysql
|
||||
%endif
|
||||
|
||||
Requires: httpd php php-gd cambozola polkit net-tools psmisc
|
||||
Requires: libjpeg-turbo vlc-core libcurl
|
||||
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
|
||||
Requires: perl(DBD::mysql) perl(Archive::Tar) perl(Archive::Zip)
|
||||
Requires: perl(MIME::Entity) perl(MIME::Lite) perl(Net::SMTP) perl(Net::FTP)
|
||||
Requires: perl(LWP::Protocol::https)
|
||||
%{!?_without_ffmpeg:Requires: ffmpeg}
|
||||
|
||||
Requires(post): systemd-units systemd-sysv
|
||||
Requires(post): /usr/bin/gpasswd
|
||||
Requires(post): /usr/bin/less
|
||||
Requires(preun): systemd-units
|
||||
Requires(postun): systemd-units
|
||||
|
||||
%description
|
||||
ZoneMinder is a set of applications which is intended to provide a complete
|
||||
solution allowing you to capture, analyse, record and monitor any cameras you
|
||||
have attached to a Linux based machine. It is designed to run on kernels which
|
||||
support the Video For Linux (V4L) interface and has been tested with cameras
|
||||
attached to BTTV cards, various USB cameras and IP network cameras. It is
|
||||
designed to support as many cameras as you can attach to your computer without
|
||||
too much degradation of performance.
|
||||
|
||||
%prep
|
||||
%setup -q -n ZoneMinder-%{version}
|
||||
|
||||
# Change the following default values
|
||||
./utils/zmeditconfigdata.sh ZM_PATH_ZMS /cgi-bin-zm/nph-zms
|
||||
./utils/zmeditconfigdata.sh ZM_OPT_CAMBOZOLA yes
|
||||
./utils/zmeditconfigdata.sh ZM_PATH_SWAP /dev/shm
|
||||
./utils/zmeditconfigdata.sh ZM_UPLOAD_FTP_LOC_DIR /var/spool/zoneminder-upload
|
||||
./utils/zmeditconfigdata.sh ZM_OPT_CONTROL yes
|
||||
./utils/zmeditconfigdata.sh ZM_CHECK_FOR_UPDATES no
|
||||
./utils/zmeditconfigdata.sh ZM_DYN_SHOW_DONATE_REMINDER no
|
||||
./utils/zmeditconfigdata.sh ZM_OPT_FAST_DELETE no
|
||||
|
||||
%build
|
||||
%cmake \
|
||||
-DZM_TARGET_DISTRO="%{dist}" \
|
||||
%{?_without_ffmpeg:-DZM_NO_FFMPEG=ON} \
|
||||
%{?_without_x10:-DZM_NO_X10=ON} \
|
||||
.
|
||||
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
export DESTDIR=%{buildroot}
|
||||
make install
|
||||
|
||||
%post
|
||||
|
||||
# Add any new PTZ control configurations to the database (will not overwrite)
|
||||
%{_bindir}/zmcamtool.pl --import >/dev/null 2>&1 || :
|
||||
|
||||
if [ $1 -eq 1 ] ; then
|
||||
# Initial installation
|
||||
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
fi
|
||||
|
||||
# Allow zoneminder access to local video sources, serial ports, and x10
|
||||
/usr/bin/gpasswd -a %{zmuid_final} video
|
||||
/usr/bin/gpasswd -a %{zmuid_final} dialout
|
||||
|
||||
# Upgrade from a previous version of zoneminder
|
||||
if [ $1 -eq 2 ] ; then
|
||||
|
||||
# Add any new PTZ control configurations to the database (will not overwrite)
|
||||
%{_bindir}/zmcamtool.pl --import >/dev/null 2>&1 || :
|
||||
|
||||
# Freshen the database
|
||||
%{_bindir}/zmupdate.pl -f >/dev/null 2>&1 || :
|
||||
|
||||
# We can't run this automatically when new sql account permissions need to
|
||||
# be manually added first
|
||||
# Run zmupdate non-interactively
|
||||
#/usr/bin/zmupdate.pl --nointeractive
|
||||
fi
|
||||
|
||||
# Warn the end user to read the README file
|
||||
echo -e "\nVERY IMPORTANT: Before starting ZoneMinder, read README.Fedora to finish the\ninstallation or upgrade!\n"
|
||||
echo -e "\nThe README file is located here: %{_docdir}/%{name}\n"
|
||||
|
||||
%preun
|
||||
if [ $1 -eq 0 ] ; then
|
||||
# Package removal, not upgrade
|
||||
/bin/systemctl --no-reload disable zoneminder.service > /dev/null 2>&1 || :
|
||||
/bin/systemctl stop zoneminder.service > /dev/null 2>&1 || :
|
||||
fi
|
||||
|
||||
%postun
|
||||
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
if [ $1 -ge 1 ] ; then
|
||||
# Package upgrade, not uninstall
|
||||
/bin/systemctl try-restart zoneminder.service >/dev/null 2>&1 || :
|
||||
fi
|
||||
|
||||
%triggerun -- zoneminder < 1.25.0-4
|
||||
# Save the current service runlevel info
|
||||
# User must manually run systemd-sysv-convert --apply zoneminder
|
||||
# to migrate them to systemd targets
|
||||
/usr/bin/systemd-sysv-convert --save zoneminder >/dev/null 2>&1 ||:
|
||||
|
||||
# Run these because the SysV package being removed won't do them
|
||||
/sbin/chkconfig --del zoneminder >/dev/null 2>&1 || :
|
||||
/bin/systemctl try-restart zoneminder.service >/dev/null 2>&1 || :
|
||||
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc AUTHORS COPYING README.md distros/fedora/README.Fedora distros/fedora/README.https distros/fedora/jscalendar-doc
|
||||
%config %attr(640,root,%{zmgid_final}) /etc/zm/zm.conf
|
||||
%config(noreplace) %attr(644,root,root) /etc/httpd/conf.d/zoneminder.conf
|
||||
%config(noreplace) /etc/tmpfiles.d/zoneminder.conf
|
||||
%config(noreplace) /etc/logrotate.d/zoneminder
|
||||
|
||||
%{_unitdir}/zoneminder.service
|
||||
|
||||
%{_bindir}/zma
|
||||
%{_bindir}/zmaudit.pl
|
||||
%{_bindir}/zmc
|
||||
%{_bindir}/zmcontrol.pl
|
||||
%{_bindir}/zmdc.pl
|
||||
%{_bindir}/zmf
|
||||
%{_bindir}/zmfilter.pl
|
||||
%{_bindir}/zmpkg.pl
|
||||
%{_bindir}/zmtrack.pl
|
||||
%{_bindir}/zmtrigger.pl
|
||||
%{_bindir}/zmu
|
||||
%{_bindir}/zmupdate.pl
|
||||
%{_bindir}/zmvideo.pl
|
||||
%{_bindir}/zmwatch.pl
|
||||
%{_bindir}/zmcamtool.pl
|
||||
%{_bindir}/zmsystemctl.pl
|
||||
%{_bindir}/zmtelemetry.pl
|
||||
%{!?_without_x10:%{_bindir}/zmx10.pl}
|
||||
%{_bindir}/zmonvif-probe.pl
|
||||
|
||||
%{perl_vendorlib}/ZoneMinder*
|
||||
%{perl_vendorlib}/ONVIF*
|
||||
%{perl_vendorlib}/WSDiscovery*
|
||||
%{perl_vendorlib}/WSSecurity*
|
||||
%{perl_vendorlib}/WSNotification*
|
||||
%{_mandir}/man*/*
|
||||
%dir %{_libexecdir}/zoneminder
|
||||
%{_libexecdir}/zoneminder/cgi-bin
|
||||
%dir %{_datadir}/zoneminder
|
||||
%{_datadir}/zoneminder/db
|
||||
%{_datadir}/zoneminder/www
|
||||
|
||||
%{_datadir}/polkit-1/actions/com.zoneminder.systemctl.policy
|
||||
%{_datadir}/polkit-1/rules.d/com.zoneminder.systemctl.rules
|
||||
|
||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder
|
||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/events
|
||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/images
|
||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/sock
|
||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/swap
|
||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/temp
|
||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/log/zoneminder
|
||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/spool/zoneminder-upload
|
||||
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /run/zoneminder
|
||||
|
||||
|
||||
%changelog
|
||||
* Thu Mar 3 2016 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.30.0
|
||||
- Bump version fo 1.30.0 release.
|
||||
|
||||
* Sat Nov 21 2015 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.29.0
|
||||
- Bump version for 1.29.0 release on Fedora 23.
|
||||
|
||||
* Sat Feb 14 2015 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.28.1
|
||||
- Bump version for 1.28.1 release on Fedora 21.
|
||||
|
||||
* Sun Oct 5 2014 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.28.0
|
||||
- Bump version for 1.28.0 release.
|
||||
|
||||
* Fri Mar 14 2014 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.27
|
||||
- Tweak build requirements for cmake
|
||||
|
||||
* Sat Feb 01 2014 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.27
|
||||
- Add zmcamtool.pl. Bump version for 1.27 release.
|
||||
|
||||
* Mon Dec 16 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.5
|
||||
- This is a bug fixe release
|
||||
- RTSP fixes, cmake enhancements, couple other misc fixes
|
||||
|
||||
* Mon Oct 07 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.4
|
||||
- Initial cmake build.
|
||||
|
||||
* Sat Oct 05 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.4
|
||||
- Fedora specific path changes have been moved to zoneminder-1.26.0-defaults.patch
|
||||
- All files are now part of the zoneminder source tree. Update specfile accordingly.
|
||||
|
||||
* Sat Sep 21 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.3
|
||||
- Initial rebuild for ZoneMinder 1.26.3 release.
|
||||
|
||||
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.25.0-13
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
||||
|
||||
* Mon Jan 21 2013 Adam Tkac <atkac redhat com> - 1.25.0-12
|
||||
- rebuild due to "jpeg8-ABI" feature drop
|
||||
|
||||
* Mon Jan 7 2013 Remi Collet <rcollet@redhat.com> - 1.25.0-11
|
||||
- fix configuration file for httpd 2.4, #871502
|
||||
|
||||
* Fri Dec 21 2012 Adam Tkac <atkac redhat com> - 1.25.0-10
|
||||
- rebuild against new libjpeg
|
||||
|
||||
* Thu Aug 09 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-9
|
||||
- Add patch to work around v4l2 api breakage in 3.5 kernel.
|
||||
|
||||
* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.25.0-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||
|
||||
* Sat Jun 23 2012 Petr Pisar <ppisar@redhat.com> - 1.25.0-7
|
||||
- Perl 5.16 rebuild
|
||||
|
||||
* Wed Mar 21 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-6
|
||||
- Fix stupid thinko in sql modifications.
|
||||
|
||||
* Sat Feb 25 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-5
|
||||
- Clean up macro usage.
|
||||
|
||||
* Sat Feb 25 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-4
|
||||
- Convert to systemd.
|
||||
- Add tmpfiles.d configuration since the initscript isn't around to create
|
||||
/run/zoneminder.
|
||||
- Remove some pointless executable permissions.
|
||||
- Add logrotate file.
|
||||
|
||||
* Wed Feb 22 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-3
|
||||
- Update README.Fedora to reference systemctl and mention timezone info in
|
||||
php.ini.
|
||||
- Add proper default for EYEZM_LOG_TO_FILE.
|
||||
|
||||
|
||||
* Thu Feb 09 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-2
|
||||
- Rebuild for new pcre.
|
||||
|
||||
* Thu Jan 19 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-1
|
||||
- Update to 1.25.0
|
||||
- Fix gcc4.7 build problems.
|
||||
- Drop gcc4.4 build fixes; for whatever reason they now break the build.
|
||||
- Clean up old patches.
|
||||
- Force setting of ZM_TMPDIR and ZM_RUNDIR.
|
||||
|
||||
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.24.4-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||
|
||||
* Thu Sep 15 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.4-3
|
||||
- Re-add the dist-tag that somehow got lost.
|
||||
|
||||
* Thu Sep 15 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.4-2
|
||||
- Add patch for bug 711780 - fix syntax issue in Mapped.pm.
|
||||
- Undo that patch, and undo another which was the cause of the whole mess.
|
||||
- Fix up other patches so ZM_PATH_BUILD is both defined and useful.
|
||||
- Make sure database creation mods actually take.
|
||||
- Update Fedora-specific docs with some additional info.
|
||||
- Use bundled mootools (javascript, so no guideline violation).
|
||||
- Update download location.
|
||||
- Update the gcrypt patch to actually work.
|
||||
- Upstream changed the tarball without changing the version to patch a
|
||||
vulnerability, so redownload.
|
||||
|
||||
* Sun Aug 14 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.4-1
|
||||
- Initial attempt to upgrade to 1.24.4.
|
||||
- Add patch from BZ 460310 to build against libgcrypt instead of requiring the
|
||||
gnutls openssl libs.
|
||||
|
||||
* Thu Jul 21 2011 Petr Sabata <contyk@redhat.com> - 1.24.3-7.20110324svn3310
|
||||
- Perl mass rebuild
|
||||
|
||||
* Wed Jul 20 2011 Petr Sabata <contyk@redhat.com> - 1.24.3-6.20110324svn3310
|
||||
- Perl mass rebuild
|
||||
|
||||
* Mon May 09 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.3-5.20110324svn3310
|
||||
- Bump for gnutls update.
|
||||
|
||||
* Thu Mar 24 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.3-4.20110324svn3310
|
||||
- Update to latest 1.24.3 subversion. Turns out that what upstream was calling
|
||||
1.24.3 is really just an occasionally updated devel snapshot.
|
||||
- Rebase various patches.
|
||||
|
||||
* Wed Mar 23 2011 Dan Horák <dan@danny.cz> - 1.24.3-3
|
||||
- rebuilt for mysql 5.5.10 (soname bump in libmysqlclient)
|
||||
|
||||
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.24.3-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
||||
|
||||
* Tue Jan 25 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.3-1
|
||||
- Update to latest upstream version.
|
||||
- Rebase patches.
|
||||
- Initial incomplete attempt to disable v4l1 support.
|
||||
|
||||
* Fri Jan 21 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.2-6
|
||||
- Unbundle cambozola; instead link to the separately pacakged copy.
|
||||
- Remove BuildRoot:, %%clean and buildroot cleaning in %%install.
|
||||
- Git rid of mixed space/tab usage by removing all tabs.
|
||||
- Remove unnecessary Conflicts: line.
|
||||
- Attempt to force short_open_tag on for the code directories.
|
||||
- Move default location of sockets, swaps, logfiles and some temporary files to
|
||||
make more sense and allow things to work better with a future selinux policy.
|
||||
- Fix errors in README.Fedora.
|
||||
|
||||
* Wed Jun 02 2010 Marcela Maslanova <mmaslano@redhat.com> - 1.24.2-5
|
||||
- Mass rebuild with perl-5.12.0
|
||||
|
||||
* Fri Dec 4 2009 Stepan Kasal <skasal@redhat.com> - 1.24.2-4
|
||||
- rebuild against perl 5.10.1
|
||||
- use Perl vendorarch and archlib variables correctly
|
||||
|
||||
* Mon Jul 27 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.24.2-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
|
||||
|
||||
* Wed Jul 22 2009 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.2-2
|
||||
- Bump release since 1.24.2-1 was mistakenly tagged a few months ago.
|
||||
|
||||
* Wed Jul 22 2009 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.2-1
|
||||
- Initial update to 1.24.2.
|
||||
- Rebase patches.
|
||||
- Update mootools download location.
|
||||
- Update to mootools 1.2.3.
|
||||
- Add additional dependencies for some optional features.
|
||||
|
||||
* Sat Apr 11 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-3
|
||||
- Remove unused Sys::Mmap perl dependency RPM is finding
|
||||
|
||||
* Sat Apr 11 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-2
|
||||
- Update gcc44 patch to disable -frepo, seems to be broken with gcc44
|
||||
- Added noffmpeg patch to make building outside mock easier
|
||||
|
||||
* Sat Mar 21 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-1
|
||||
- Patch for gcc 4.4 compilation errors
|
||||
- Upgrade to 1.24.1
|
||||
|
||||
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.23.3-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
|
||||
|
||||
* Sat Jan 24 2009 Caolán McNamara <caolanm@redhat.com> - 1.23.3-3
|
||||
- rebuild for dependencies
|
||||
|
||||
* Mon Dec 15 2008 Martin Ebourne <martin@zepler.org> - 1.23.3-2
|
||||
- Fix permissions on zm.conf
|
||||
|
||||
* Fri Jul 11 2008 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.23.3-1
|
||||
- Initial attempt at packaging 1.23.
|
||||
|
||||
* Tue Jul 1 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-15
|
||||
- Add perl module compat dependency, bz #453590
|
||||
|
||||
* Tue May 6 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-14
|
||||
- Remove default runlevel, bz #441315
|
||||
|
||||
* Mon Apr 28 2008 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.22.3-13
|
||||
- Backport patch for CVE-2008-1381 from 1.23.3 to 1.22.3.
|
||||
|
||||
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.22.3-12
|
||||
- Autorebuild for GCC 4.3
|
||||
|
||||
* Thu Jan 3 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-11
|
||||
- Fix compilation on gcc 4.3
|
||||
|
||||
* Thu Dec 6 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-10
|
||||
- Rebuild for new openssl
|
||||
|
||||
* Thu Aug 2 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-8
|
||||
- Fix licence tag
|
||||
|
||||
* Thu Jul 12 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-7
|
||||
- Fixes from testing by Jitz including missing dependencies and database creation
|
||||
|
||||
* Sat Jun 30 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-6
|
||||
- Disable crashtrace on ppc
|
||||
|
||||
* Sat Jun 30 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-5
|
||||
- Fix uid for directories in /var/lib/zoneminder
|
||||
|
||||
* Tue Jun 26 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-4
|
||||
- Added perl Archive::Tar dependency
|
||||
- Disabled web interface due to lack of access control on the event images
|
||||
|
||||
* Sun Jun 10 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-3
|
||||
- Changes recommended in review by Jason Tibbitts
|
||||
|
||||
* Mon Apr 2 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-2
|
||||
- Standardised on package name of zoneminder
|
||||
|
||||
* Thu Dec 28 2006 Martin Ebourne <martin@zepler.org> - 1.22.3-1
|
||||
- First version. Uses some parts from zm-1.20.1 by Corey DeLasaux and Serg Oskin
|
|
@ -13,6 +13,7 @@ ExecStart=@BINDIR@/zmpkg.pl start
|
|||
ExecReload=@BINDIR@/zmpkg.pl restart
|
||||
ExecStop=@BINDIR@/zmpkg.pl stop
|
||||
PIDFile="@ZM_RUNDIR@/zm.pid"
|
||||
Environment=TZ=/etc/localtime
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
|
@ -12,6 +12,7 @@ ExecStart=@BINDIR@/zmpkg.pl start
|
|||
ExecReload=@BINDIR@/zmpkg.pl restart
|
||||
ExecStop=@BINDIR@/zmpkg.pl stop
|
||||
PIDFile="@ZM_RUNDIR@/zm.pid"
|
||||
Environment=TZ=/etc/localtime
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
|
@ -9,7 +9,7 @@ ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin"
|
|||
Alias /zm /usr/share/zoneminder/www
|
||||
<Directory /usr/share/zoneminder/www>
|
||||
php_flag register_globals off
|
||||
Options Indexes FollowSymLinks
|
||||
Options -Indexes +FollowSymLinks
|
||||
<IfModule mod_dir.c>
|
||||
DirectoryIndex index.php
|
||||
</IfModule>
|
||||
|
|
|
@ -1,8 +1,19 @@
|
|||
Alias /zm /usr/share/zoneminder/www
|
||||
# Remember to enable cgi mod (i.e. "a2enmod cgi").
|
||||
ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin"
|
||||
<Directory "/usr/lib/zoneminder/cgi-bin">
|
||||
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
Alias /zm /usr/share/zoneminder/www
|
||||
<Directory /usr/share/zoneminder/www>
|
||||
Options Indexes FollowSymLinks
|
||||
Options -Indexes +ollowSymLinks
|
||||
<IfModule mod_dir.c>
|
||||
DirectoryIndex index.php
|
||||
</IfModule>
|
||||
</Directory>
|
||||
|
||||
<Directory /usr/share/zoneminder/www/api>
|
||||
AllowOverride All
|
||||
</Directory>
|
||||
|
|
|
@ -8,7 +8,7 @@ ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin"
|
|||
|
||||
Alias /zm /usr/share/zoneminder/www
|
||||
<Directory /usr/share/zoneminder/www>
|
||||
Options Indexes FollowSymLinks
|
||||
Options -Indexes +FollowSymLinks
|
||||
<IfModule mod_dir.c>
|
||||
DirectoryIndex index.php
|
||||
</IfModule>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
DocumentRoot "@WEB_PREFIX@"
|
||||
<Directory "@WEB_PREFIX@">
|
||||
Options FollowSymLinks
|
||||
Options -Indexes +FollowSymLinks
|
||||
AllowOverride All
|
||||
</Directory>
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ require Exporter;
|
|||
|
||||
our @ISA = qw(Exporter);
|
||||
|
||||
use constant ZM_VERSION => "@VERSION@";
|
||||
use constant ZM_VERSION => '@VERSION@';
|
||||
|
||||
# Items to export into callers namespace by default. Note: do not export
|
||||
# names by default without a very good reason. Use EXPORT_OK instead.
|
||||
|
@ -47,7 +47,7 @@ our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
|
|||
|
||||
our @EXPORT = qw();
|
||||
|
||||
our $VERSION = "@VERSION@";
|
||||
our $VERSION = '@VERSION@';
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
|
|
@ -69,13 +69,11 @@ use constant ZM_CONFIG => "@ZM_CONFIG@"; # Path to the ZoneMinder config file
|
|||
use Carp;
|
||||
|
||||
# Load the config from the database into the symbol table
|
||||
BEGIN
|
||||
{
|
||||
BEGIN {
|
||||
my $config_file = ZM_CONFIG;
|
||||
open( my $CONFIG, "<", $config_file )
|
||||
or croak( "Can't open config file '$config_file': $!" );
|
||||
foreach my $str ( <$CONFIG> )
|
||||
{
|
||||
foreach my $str ( <$CONFIG> ) {
|
||||
next if ( $str =~ /^\s*$/ );
|
||||
next if ( $str =~ /^\s*#/ );
|
||||
my ( $name, $value ) = $str =~ /^\s*([^=\s]+)\s*=\s*(.*?)\s*$/;
|
||||
|
@ -92,19 +90,13 @@ BEGIN
|
|||
my $socket;
|
||||
my ( $host, $portOrSocket ) = ( $Config{ZM_DB_HOST} =~ /^([^:]+)(?::(.+))?$/ );
|
||||
|
||||
if ( defined($portOrSocket) )
|
||||
{
|
||||
if ( $portOrSocket =~ /^\// )
|
||||
{
|
||||
if ( defined($portOrSocket) ) {
|
||||
if ( $portOrSocket =~ /^\// ) {
|
||||
$socket = ";mysql_socket=".$portOrSocket;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$socket = ";host=".$host.";port=".$portOrSocket;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$socket = ";host=".$Config{ZM_DB_HOST};
|
||||
}
|
||||
my $dbh = DBI->connect( "DBI:mysql:database=".$Config{ZM_DB_NAME}
|
||||
|
@ -134,7 +126,7 @@ BEGIN
|
|||
}
|
||||
$sth->finish();
|
||||
}
|
||||
}
|
||||
} # end BEGIN
|
||||
|
||||
sub loadConfigFromDB {
|
||||
print( "Loading config from DB\n" );
|
||||
|
@ -169,13 +161,12 @@ sub loadConfigFromDB {
|
|||
}
|
||||
$sth->finish();
|
||||
return( $option_count );
|
||||
}
|
||||
} # end sub loadConfigFromDB
|
||||
|
||||
sub saveConfigToDB {
|
||||
print( "Saving config to DB\n" );
|
||||
my $dbh = ZoneMinder::Database::zmDbConnect();
|
||||
if ( !$dbh )
|
||||
{
|
||||
if ( !$dbh ) {
|
||||
print( "Error: unable to save options to database: $DBI::errstr\n" );
|
||||
return( 0 );
|
||||
}
|
||||
|
@ -193,41 +184,27 @@ sub saveConfigToDB {
|
|||
$sql = "replace into Config set Id = ?, Name = ?, Value = ?, Type = ?, DefaultValue = ?, Hint = ?, Pattern = ?, Format = ?, Prompt = ?, Help = ?, Category = ?, Readonly = ?, Requires = ?";
|
||||
my $sth = $dbh->prepare_cached( $sql )
|
||||
or croak( "Can't prepare '$sql': ".$dbh->errstr() );
|
||||
foreach my $option ( @options )
|
||||
{
|
||||
foreach my $option ( @options ) {
|
||||
#next if ( $option->{category} eq 'hidden' );
|
||||
#print( $option->{name}."\n" ) if ( !$option->{category} );
|
||||
$option->{db_type} = $option->{type}->{db_type};
|
||||
$option->{db_hint} = $option->{type}->{hint};
|
||||
$option->{db_pattern} = $option->{type}->{pattern};
|
||||
$option->{db_format} = $option->{type}->{format};
|
||||
if ( $option->{db_type} eq "boolean" )
|
||||
{
|
||||
$option->{db_value} = ($option->{value} eq "yes")
|
||||
? "1"
|
||||
: "0"
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $option->{db_type} eq "boolean" ) {
|
||||
$option->{db_value} = ($option->{value} eq "yes") ? "1" : "0";
|
||||
} else {
|
||||
$option->{db_value} = $option->{value};
|
||||
}
|
||||
if ( my $requires = $option->{requires} )
|
||||
{
|
||||
if ( my $requires = $option->{requires} ) {
|
||||
$option->{db_requires} = join( ";",
|
||||
map {
|
||||
my $value = $_->{value};
|
||||
$value = ($value eq "yes")
|
||||
? 1
|
||||
: 0
|
||||
if ( $options_hash{$_->{name}}->{db_type} eq "boolean" )
|
||||
; ( "$_->{name}=$value" )
|
||||
$value = ($value eq "yes") ? 1 : 0 if ( $options_hash{$_->{name}}->{db_type} eq "boolean" );
|
||||
( "$_->{name}=$value" )
|
||||
} @$requires
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
my $res = $sth->execute(
|
||||
$option->{id},
|
||||
$option->{name},
|
||||
|
@ -243,12 +220,12 @@ sub saveConfigToDB {
|
|||
$option->{readonly} ? 1 : 0,
|
||||
$option->{db_requires}
|
||||
) or croak( "Can't execute: ".$sth->errstr() );
|
||||
}
|
||||
} # end foreach option
|
||||
$sth->finish();
|
||||
|
||||
$dbh->do('UNLOCK TABLES');
|
||||
$dbh->{AutoCommit} = $ac;
|
||||
}
|
||||
} # end sub saveConfigToDB
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
|
|
@ -65,14 +65,12 @@ use Carp;
|
|||
|
||||
our $configInitialised = 0;
|
||||
|
||||
sub INIT
|
||||
{
|
||||
sub INIT {
|
||||
initialiseConfig();
|
||||
}
|
||||
|
||||
# Types
|
||||
our %types =
|
||||
(
|
||||
our %types = (
|
||||
string => {
|
||||
db_type => "string",
|
||||
hint => "string",
|
||||
|
@ -96,10 +94,7 @@ our %types =
|
|||
hint => "yes|no",
|
||||
pattern => qr|^([yn])|i,
|
||||
check => q( $1 ),
|
||||
format => q( ($1 =~ /^y/)
|
||||
? "yes"
|
||||
: "no"
|
||||
)
|
||||
format => q( ($1 =~ /^y/) ? "yes" : "no" )
|
||||
},
|
||||
integer => {
|
||||
db_type => "integer",
|
||||
|
@ -123,10 +118,7 @@ our %types =
|
|||
db_type => "string",
|
||||
hint => "auto|yes|no",
|
||||
pattern => qr|^([ayn])|i, check=>q( $1 ),
|
||||
format => q( ($1 =~ /^y/)
|
||||
? "yes"
|
||||
: ($1 =~ /^n/ ? "no" : "auto" )
|
||||
)
|
||||
format => q( ($1 =~ /^y/) ? "yes" : ($1 =~ /^n/ ? "no" : "auto" ) )
|
||||
},
|
||||
abs_path => {
|
||||
db_type => "string",
|
||||
|
@ -178,8 +170,7 @@ sub qqq { ## Un-pad paragraph of text.
|
|||
return $_;
|
||||
}
|
||||
|
||||
our @options =
|
||||
(
|
||||
our @options = (
|
||||
{
|
||||
name => "ZM_SKIN_DEFAULT",
|
||||
default => "classic",
|
||||
|
@ -283,10 +274,7 @@ our @options =
|
|||
db_type => "string",
|
||||
hint => "hashed|plain|none",
|
||||
pattern => qr|^([hpn])|i,
|
||||
format => q( ($1 =~ /^h/)
|
||||
? "hashed"
|
||||
: ($1 =~ /^p/ ? "plain" : "none" )
|
||||
)
|
||||
format => q( ($1 =~ /^h/) ? "hashed" : ($1 =~ /^p/ ? "plain" : "none" ) )
|
||||
},
|
||||
category => "system",
|
||||
},
|
||||
|
@ -3902,21 +3890,16 @@ our %options_hash = map { ( $_->{name}, $_ ) } @options;
|
|||
|
||||
# This function should never need to be called explicitly, except if
|
||||
# this module is 'require'd rather than 'use'd. See zmconfgen.pl.
|
||||
sub initialiseConfig
|
||||
{
|
||||
sub initialiseConfig {
|
||||
return if ( $configInitialised );
|
||||
|
||||
# Do some initial data munging to finish the data structures
|
||||
# Create option ids
|
||||
my $option_id = 0;
|
||||
foreach my $option ( @options )
|
||||
{
|
||||
if ( defined($option->{default}) )
|
||||
{
|
||||
foreach my $option ( @options ) {
|
||||
if ( defined($option->{default}) ) {
|
||||
$option->{value} = $option->{default}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$option->{value} = '';
|
||||
}
|
||||
#next if ( $option->{category} eq 'hidden' );
|
||||
|
|
|
@ -43,14 +43,12 @@ use ZoneMinder::Database qw(:all);
|
|||
|
||||
our $AUTOLOAD;
|
||||
|
||||
sub new
|
||||
{
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $id = shift;
|
||||
my $self = {};
|
||||
$self->{name} = "PelcoD";
|
||||
if ( !defined($id) )
|
||||
{
|
||||
if ( !defined($id) ) {
|
||||
Fatal( "No monitor defined when invoking protocol ".$self->{name} );
|
||||
}
|
||||
$self->{id} = $id;
|
||||
|
@ -58,12 +56,10 @@ sub new
|
|||
return $self;
|
||||
}
|
||||
|
||||
sub DESTROY
|
||||
{
|
||||
sub DESTROY {
|
||||
}
|
||||
|
||||
sub AUTOLOAD
|
||||
{
|
||||
sub AUTOLOAD {
|
||||
my $self = shift;
|
||||
my $class = ref($self) || croak( "$self not object" );
|
||||
my $name = $AUTOLOAD;
|
||||
|
@ -75,61 +71,49 @@ sub AUTOLOAD
|
|||
croak( "Can't access $name member of object of class $class" );
|
||||
}
|
||||
|
||||
sub getKey
|
||||
{
|
||||
sub getKey {
|
||||
my $self = shift;
|
||||
return( $self->{id} );
|
||||
}
|
||||
|
||||
sub open
|
||||
{
|
||||
sub open {
|
||||
my $self = shift;
|
||||
Fatal( "No open method defined for protocol ".$self->{name} );
|
||||
}
|
||||
|
||||
sub close
|
||||
{
|
||||
sub close {
|
||||
my $self = shift;
|
||||
Fatal( "No close method defined for protocol ".$self->{name} );
|
||||
}
|
||||
|
||||
sub loadMonitor
|
||||
{
|
||||
sub loadMonitor {
|
||||
my $self = shift;
|
||||
if ( !$self->{Monitor} )
|
||||
{
|
||||
if ( !($self->{Monitor} = zmDbGetMonitor( $self->{id} )) )
|
||||
{
|
||||
if ( !$self->{Monitor} ) {
|
||||
if ( !($self->{Monitor} = zmDbGetMonitor( $self->{id} )) ) {
|
||||
Fatal( "Monitor id ".$self->{id}." not found or not controllable" );
|
||||
}
|
||||
if ( defined($self->{Monitor}->{AutoStopTimeout}) )
|
||||
{
|
||||
if ( defined($self->{Monitor}->{AutoStopTimeout}) ) {
|
||||
# Convert to microseconds.
|
||||
$self->{Monitor}->{AutoStopTimeout} = int(1000000*$self->{Monitor}->{AutoStopTimeout});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub getParam
|
||||
{
|
||||
sub getParam {
|
||||
my $self = shift;
|
||||
my $params = shift;
|
||||
my $name = shift;
|
||||
my $default = shift;
|
||||
|
||||
if ( defined($params->{$name}) )
|
||||
{
|
||||
if ( defined($params->{$name}) ) {
|
||||
return( $params->{$name} );
|
||||
}
|
||||
elsif ( defined($default) )
|
||||
{
|
||||
} elsif ( defined($default) ) {
|
||||
return( $default );
|
||||
}
|
||||
Fatal( "Missing mandatory parameter '$name'" );
|
||||
}
|
||||
|
||||
sub executeCommand
|
||||
{
|
||||
sub executeCommand {
|
||||
my $self = shift;
|
||||
my $params = shift;
|
||||
|
||||
|
@ -145,8 +129,7 @@ sub executeCommand
|
|||
&{$self->{$command}}( $self, $params );
|
||||
}
|
||||
|
||||
sub printMsg
|
||||
{
|
||||
sub printMsg {
|
||||
my $self = shift;
|
||||
Fatal( "No printMsg method defined for protocol ".$self->{name} );
|
||||
}
|
||||
|
|
|
@ -70,31 +70,22 @@ use Carp;
|
|||
|
||||
our $dbh = undef;
|
||||
|
||||
sub zmDbConnect
|
||||
{
|
||||
sub zmDbConnect {
|
||||
my $force = shift;
|
||||
if ( $force )
|
||||
{
|
||||
if ( $force ) {
|
||||
zmDbDisconnect();
|
||||
}
|
||||
if ( !defined( $dbh ) )
|
||||
{
|
||||
if ( !defined( $dbh ) ) {
|
||||
my $socket;
|
||||
my ( $host, $portOrSocket ) = ( $Config{ZM_DB_HOST} =~ /^([^:]+)(?::(.+))?$/ );
|
||||
|
||||
if ( defined($portOrSocket) )
|
||||
{
|
||||
if ( $portOrSocket =~ /^\// )
|
||||
{
|
||||
if ( defined($portOrSocket) ) {
|
||||
if ( $portOrSocket =~ /^\// ) {
|
||||
$socket = ";mysql_socket=".$portOrSocket;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$socket = ";host=".$host.";port=".$portOrSocket;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$socket = ";host=".$Config{ZM_DB_HOST};
|
||||
}
|
||||
$dbh = DBI->connect( "DBI:mysql:database=".$Config{ZM_DB_NAME}
|
||||
|
@ -107,10 +98,8 @@ sub zmDbConnect
|
|||
return( $dbh );
|
||||
}
|
||||
|
||||
sub zmDbDisconnect
|
||||
{
|
||||
if ( defined( $dbh ) )
|
||||
{
|
||||
sub zmDbDisconnect {
|
||||
if ( defined( $dbh ) ) {
|
||||
$dbh->disconnect();
|
||||
$dbh = undef;
|
||||
}
|
||||
|
@ -123,33 +112,22 @@ use constant DB_MON_MOTION => 3; # All monitors that are doing motion detection
|
|||
use constant DB_MON_RECORD => 4; # All monitors that are doing unconditional recording
|
||||
use constant DB_MON_PASSIVE => 5; # All monitors that are in nodect state
|
||||
|
||||
sub zmDbGetMonitors
|
||||
{
|
||||
sub zmDbGetMonitors {
|
||||
zmDbConnect();
|
||||
|
||||
my $function = shift || DB_MON_ALL;
|
||||
my $sql = "select * from Monitors";
|
||||
|
||||
if ( $function )
|
||||
{
|
||||
if ( $function == DB_MON_CAPT )
|
||||
{
|
||||
if ( $function ) {
|
||||
if ( $function == DB_MON_CAPT ) {
|
||||
$sql .= " where Function >= 'Monitor'";
|
||||
}
|
||||
elsif ( $function == DB_MON_ACTIVE )
|
||||
{
|
||||
} elsif ( $function == DB_MON_ACTIVE ) {
|
||||
$sql .= " where Function > 'Monitor'";
|
||||
}
|
||||
elsif ( $function == DB_MON_MOTION )
|
||||
{
|
||||
} elsif ( $function == DB_MON_MOTION ) {
|
||||
$sql .= " where Function = 'Modect' or Function = 'Mocord'";
|
||||
}
|
||||
elsif ( $function == DB_MON_RECORD )
|
||||
{
|
||||
} elsif ( $function == DB_MON_RECORD ) {
|
||||
$sql .= " where Function = 'Record' or Function = 'Mocord'";
|
||||
}
|
||||
elsif ( $function == DB_MON_PASSIVE )
|
||||
{
|
||||
} elsif ( $function == DB_MON_PASSIVE ) {
|
||||
$sql .= " where Function = 'Nodect'";
|
||||
}
|
||||
}
|
||||
|
@ -159,16 +137,14 @@ sub zmDbGetMonitors
|
|||
or croak( "Can't execute '$sql': ".$sth->errstr() );
|
||||
|
||||
my @monitors;
|
||||
while( my $monitor = $sth->fetchrow_hashref() )
|
||||
{
|
||||
while( my $monitor = $sth->fetchrow_hashref() ) {
|
||||
push( @monitors, $monitor );
|
||||
}
|
||||
$sth->finish();
|
||||
return( \@monitors );
|
||||
}
|
||||
|
||||
sub zmDbGetMonitor
|
||||
{
|
||||
sub zmDbGetMonitor {
|
||||
zmDbConnect();
|
||||
|
||||
my $id = shift;
|
||||
|
@ -185,8 +161,7 @@ sub zmDbGetMonitor
|
|||
return( $monitor );
|
||||
}
|
||||
|
||||
sub zmDbGetMonitorAndControl
|
||||
{
|
||||
sub zmDbGetMonitorAndControl {
|
||||
zmDbConnect();
|
||||
|
||||
my $id = shift;
|
||||
|
|
|
@ -138,22 +138,18 @@ sub find_one {
|
|||
return $results[0] if @results;
|
||||
}
|
||||
|
||||
sub getEventPath
|
||||
{
|
||||
sub getEventPath {
|
||||
my $event = shift;
|
||||
|
||||
my $event_path = "";
|
||||
if ( $Config{ZM_USE_DEEP_STORAGE} )
|
||||
{
|
||||
if ( $Config{ZM_USE_DEEP_STORAGE} ) {
|
||||
$event_path = $Config{ZM_DIR_EVENTS}
|
||||
.'/'.$event->{MonitorId}
|
||||
.'/'.strftime( "%y/%m/%d/%H/%M/%S",
|
||||
localtime($event->{Time})
|
||||
)
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$event_path = $Config{ZM_DIR_EVENTS}
|
||||
.'/'.$event->{MonitorId}
|
||||
.'/'.$event->{Id}
|
||||
|
@ -176,17 +172,14 @@ sub GenerateVideo {
|
|||
( my $video_name = $self->{Name} ) =~ s/\s/_/g;
|
||||
|
||||
my @file_parts;
|
||||
if ( $rate )
|
||||
{
|
||||
if ( $rate ) {
|
||||
my $file_rate = $rate;
|
||||
$file_rate =~ s/\./_/;
|
||||
$file_rate =~ s/_00//;
|
||||
$file_rate =~ s/(_\d+)0+$/$1/;
|
||||
$file_rate = 'r'.$file_rate;
|
||||
push( @file_parts, $file_rate );
|
||||
}
|
||||
elsif ( $fps )
|
||||
{
|
||||
} elsif ( $fps ) {
|
||||
my $file_fps = $fps;
|
||||
$file_fps =~ s/\./_/;
|
||||
$file_fps =~ s/_00//;
|
||||
|
@ -195,35 +188,27 @@ sub GenerateVideo {
|
|||
push( @file_parts, $file_fps );
|
||||
}
|
||||
|
||||
if ( $scale )
|
||||
{
|
||||
if ( $scale ) {
|
||||
my $file_scale = $scale;
|
||||
$file_scale =~ s/\./_/;
|
||||
$file_scale =~ s/_00//;
|
||||
$file_scale =~ s/(_\d+)0+$/$1/;
|
||||
$file_scale = 's'.$file_scale;
|
||||
push( @file_parts, $file_scale );
|
||||
}
|
||||
elsif ( $size )
|
||||
{
|
||||
} elsif ( $size ) {
|
||||
my $file_size = 'S'.$size;
|
||||
push( @file_parts, $file_size );
|
||||
}
|
||||
my $video_file = "$video_name-".$file_parts[0]."-".$file_parts[1].".$format";
|
||||
if ( $overwrite || !-s $video_file )
|
||||
{
|
||||
if ( $overwrite || !-s $video_file ) {
|
||||
Info( "Creating video file $video_file for event $self->{Id}\n" );
|
||||
|
||||
my $frame_rate = sprintf( "%.2f", $self->{Frames}/$self->{FullLength} );
|
||||
if ( $rate )
|
||||
{
|
||||
if ( $rate != 1.0 )
|
||||
{
|
||||
if ( $rate ) {
|
||||
if ( $rate != 1.0 ) {
|
||||
$frame_rate *= $rate;
|
||||
}
|
||||
}
|
||||
elsif ( $fps )
|
||||
{
|
||||
} elsif ( $fps ) {
|
||||
$frame_rate = $fps;
|
||||
}
|
||||
|
||||
|
@ -231,17 +216,13 @@ sub GenerateVideo {
|
|||
my $height = $self->{MonitorHeight};
|
||||
my $video_size = " ${width}x${height}";
|
||||
|
||||
if ( $scale )
|
||||
{
|
||||
if ( $scale != 1.0 )
|
||||
{
|
||||
if ( $scale ) {
|
||||
if ( $scale != 1.0 ) {
|
||||
$width = int($width*$scale);
|
||||
$height = int($height*$scale);
|
||||
$video_size = " ${width}x${height}";
|
||||
}
|
||||
}
|
||||
elsif ( $size )
|
||||
{
|
||||
} elsif ( $size ) {
|
||||
$video_size = $size;
|
||||
}
|
||||
my $command = $Config{ZM_PATH_FFMPEG}
|
||||
|
@ -259,8 +240,7 @@ sub GenerateVideo {
|
|||
my $output = qx($command);
|
||||
|
||||
my $status = $? >> 8;
|
||||
if ( $status )
|
||||
{
|
||||
if ( $status ) {
|
||||
Error( "Unable to generate video, check "
|
||||
.$event_path."/ffmpeg.log for details"
|
||||
);
|
||||
|
|
|
@ -143,18 +143,15 @@ sub Execute {
|
|||
|
||||
my $sql = $self->Sql();
|
||||
|
||||
if ( $self->{HasDiskPercent} )
|
||||
{
|
||||
if ( $self->{HasDiskPercent} ) {
|
||||
my $disk_percent = getDiskPercent();
|
||||
$sql =~ s/zmDiskPercent/$disk_percent/g;
|
||||
}
|
||||
if ( $self->{HasDiskBlocks} )
|
||||
{
|
||||
if ( $self->{HasDiskBlocks} ) {
|
||||
my $disk_blocks = getDiskBlocks();
|
||||
$sql =~ s/zmDiskBlocks/$disk_blocks/g;
|
||||
}
|
||||
if ( $self->{HasSystemLoad} )
|
||||
{
|
||||
if ( $self->{HasSystemLoad} ) {
|
||||
my $load = getLoad();
|
||||
$sql =~ s/zmSystemLoad/$load/g;
|
||||
}
|
||||
|
@ -162,8 +159,7 @@ sub Execute {
|
|||
my $sth = $$self{dbh}->prepare_cached( $sql )
|
||||
or Fatal( "Can't prepare '$sql': ".$$self{dbh}->errstr() );
|
||||
my $res = $sth->execute();
|
||||
if ( !$res )
|
||||
{
|
||||
if ( !$res ) {
|
||||
Error( "Can't execute filter '$sql', ignoring: ".$sth->errstr() );
|
||||
return;
|
||||
}
|
||||
|
@ -300,103 +296,69 @@ sub Sql {
|
|||
} # end foreach term
|
||||
} # end if terms
|
||||
|
||||
if ( $self->{Sql} )
|
||||
{
|
||||
if ( $self->{AutoMessage} )
|
||||
{
|
||||
if ( $self->{Sql} ) {
|
||||
if ( $self->{AutoMessage} ) {
|
||||
# Include all events, including events that are still ongoing
|
||||
# and have no EndTime yet
|
||||
$sql .= " and ( ".$self->{Sql}." )";
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
# Only include closed events (events with valid EndTime)
|
||||
$sql .= " where not isnull(E.EndTime) and ( ".$self->{Sql}." )";
|
||||
}
|
||||
}
|
||||
my @auto_terms;
|
||||
if ( $self->{AutoArchive} )
|
||||
{
|
||||
if ( $self->{AutoArchive} ) {
|
||||
push( @auto_terms, "E.Archived = 0" )
|
||||
}
|
||||
if ( $self->{AutoVideo} )
|
||||
{
|
||||
if ( $self->{AutoVideo} ) {
|
||||
push( @auto_terms, "E.Videoed = 0" )
|
||||
}
|
||||
if ( $self->{AutoUpload} )
|
||||
{
|
||||
if ( $self->{AutoUpload} ) {
|
||||
push( @auto_terms, "E.Uploaded = 0" )
|
||||
}
|
||||
if ( $self->{AutoEmail} )
|
||||
{
|
||||
if ( $self->{AutoEmail} ) {
|
||||
push( @auto_terms, "E.Emailed = 0" )
|
||||
}
|
||||
if ( $self->{AutoMessage} )
|
||||
{
|
||||
if ( $self->{AutoMessage} ) {
|
||||
push( @auto_terms, "E.Messaged = 0" )
|
||||
}
|
||||
if ( $self->{AutoExecute} )
|
||||
{
|
||||
if ( $self->{AutoExecute} ) {
|
||||
push( @auto_terms, "E.Executed = 0" )
|
||||
}
|
||||
if ( @auto_terms )
|
||||
{
|
||||
if ( @auto_terms ) {
|
||||
$sql .= " and ( ".join( " or ", @auto_terms )." )";
|
||||
}
|
||||
if ( !$filter_expr->{sort_field} )
|
||||
{
|
||||
if ( !$filter_expr->{sort_field} ) {
|
||||
$filter_expr->{sort_field} = 'StartTime';
|
||||
$filter_expr->{sort_asc} = 0;
|
||||
}
|
||||
my $sort_column = '';
|
||||
if ( $filter_expr->{sort_field} eq 'Id' )
|
||||
{
|
||||
if ( $filter_expr->{sort_field} eq 'Id' ) {
|
||||
$sort_column = "E.Id";
|
||||
}
|
||||
elsif ( $filter_expr->{sort_field} eq 'MonitorName' )
|
||||
{
|
||||
} elsif ( $filter_expr->{sort_field} eq 'MonitorName' ) {
|
||||
$sort_column = "M.Name";
|
||||
}
|
||||
elsif ( $filter_expr->{sort_field} eq 'Name' )
|
||||
{
|
||||
} elsif ( $filter_expr->{sort_field} eq 'Name' ) {
|
||||
$sort_column = "E.Name";
|
||||
}
|
||||
elsif ( $filter_expr->{sort_field} eq 'StartTime' )
|
||||
{
|
||||
} elsif ( $filter_expr->{sort_field} eq 'StartTime' ) {
|
||||
$sort_column = "E.StartTime";
|
||||
}
|
||||
elsif ( $filter_expr->{sort_field} eq 'Secs' )
|
||||
{
|
||||
} elsif ( $filter_expr->{sort_field} eq 'Secs' ) {
|
||||
$sort_column = "E.Length";
|
||||
}
|
||||
elsif ( $filter_expr->{sort_field} eq 'Frames' )
|
||||
{
|
||||
} elsif ( $filter_expr->{sort_field} eq 'Frames' ) {
|
||||
$sort_column = "E.Frames";
|
||||
}
|
||||
elsif ( $filter_expr->{sort_field} eq 'AlarmFrames' )
|
||||
{
|
||||
} elsif ( $filter_expr->{sort_field} eq 'AlarmFrames' ) {
|
||||
$sort_column = "E.AlarmFrames";
|
||||
}
|
||||
elsif ( $filter_expr->{sort_field} eq 'TotScore' )
|
||||
{
|
||||
} elsif ( $filter_expr->{sort_field} eq 'TotScore' ) {
|
||||
$sort_column = "E.TotScore";
|
||||
}
|
||||
elsif ( $filter_expr->{sort_field} eq 'AvgScore' )
|
||||
{
|
||||
} elsif ( $filter_expr->{sort_field} eq 'AvgScore' ) {
|
||||
$sort_column = "E.AvgScore";
|
||||
}
|
||||
elsif ( $filter_expr->{sort_field} eq 'MaxScore' )
|
||||
{
|
||||
} elsif ( $filter_expr->{sort_field} eq 'MaxScore' ) {
|
||||
$sort_column = "E.MaxScore";
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$sort_column = "E.StartTime";
|
||||
}
|
||||
my $sort_order = $filter_expr->{sort_asc}?"asc":"desc";
|
||||
$sql .= " order by ".$sort_column." ".$sort_order;
|
||||
if ( $filter_expr->{limit} )
|
||||
{
|
||||
if ( $filter_expr->{limit} ) {
|
||||
$sql .= " limit 0,".$filter_expr->{limit};
|
||||
}
|
||||
Debug( "SQL:$sql\n" );
|
||||
|
@ -405,35 +367,31 @@ sub Sql {
|
|||
return $self->{Sql};
|
||||
} # end sub Sql
|
||||
|
||||
sub getDiskPercent
|
||||
{
|
||||
sub getDiskPercent {
|
||||
my $command = "df .";
|
||||
my $df = qx( $command );
|
||||
my $space = -1;
|
||||
if ( $df =~ /\s(\d+)%/ms )
|
||||
{
|
||||
if ( $df =~ /\s(\d+)%/ms ) {
|
||||
$space = $1;
|
||||
}
|
||||
return( $space );
|
||||
}
|
||||
sub getDiskBlocks
|
||||
{
|
||||
|
||||
sub getDiskBlocks {
|
||||
my $command = "df .";
|
||||
my $df = qx( $command );
|
||||
my $space = -1;
|
||||
if ( $df =~ /\s(\d+)\s+\d+\s+\d+%/ms )
|
||||
{
|
||||
if ( $df =~ /\s(\d+)\s+\d+\s+\d+%/ms ) {
|
||||
$space = $1;
|
||||
}
|
||||
return( $space );
|
||||
}
|
||||
sub getLoad
|
||||
{
|
||||
|
||||
sub getLoad {
|
||||
my $command = "uptime .";
|
||||
my $uptime = qx( $command );
|
||||
my $load = -1;
|
||||
if ( $uptime =~ /load average:\s+([\d.]+)/ms )
|
||||
{
|
||||
if ( $uptime =~ /load average:\s+([\d.]+)/ms ) {
|
||||
$load = $1;
|
||||
Info( "Load: $load" );
|
||||
}
|
||||
|
@ -443,8 +401,7 @@ sub getLoad
|
|||
#
|
||||
# More or less replicates the equivalent PHP function
|
||||
#
|
||||
sub strtotime
|
||||
{
|
||||
sub strtotime {
|
||||
my $dt_str = shift;
|
||||
return( Date::Manip::UnixDate( $dt_str, '%s' ) );
|
||||
}
|
||||
|
@ -452,20 +409,17 @@ sub strtotime
|
|||
#
|
||||
# More or less replicates the equivalent PHP function
|
||||
#
|
||||
sub str_repeat
|
||||
{
|
||||
sub str_repeat {
|
||||
my $string = shift;
|
||||
my $count = shift;
|
||||
return( ${string}x${count} );
|
||||
}
|
||||
|
||||
# Formats a date into MySQL format
|
||||
sub DateTimeToSQL
|
||||
{
|
||||
sub DateTimeToSQL {
|
||||
my $dt_str = shift;
|
||||
my $dt_val = strtotime( $dt_str );
|
||||
if ( !$dt_val )
|
||||
{
|
||||
if ( !$dt_val ) {
|
||||
Error( "Unable to parse date string '$dt_str'\n" );
|
||||
return( undef );
|
||||
}
|
||||
|
|
|
@ -76,13 +76,11 @@ use ZoneMinder::Database qw(:all);
|
|||
use POSIX;
|
||||
|
||||
# For running general shell commands
|
||||
sub executeShellCommand
|
||||
{
|
||||
sub executeShellCommand {
|
||||
my $command = shift;
|
||||
my $output = qx( $command );
|
||||
my $status = $? >> 8;
|
||||
if ( $status || logDebugging() )
|
||||
{
|
||||
if ( $status || logDebugging() ) {
|
||||
Debug( "Command: $command\n" );
|
||||
chomp( $output );
|
||||
Debug( "Output: $output\n" );
|
||||
|
@ -90,13 +88,11 @@ sub executeShellCommand
|
|||
return( $status );
|
||||
}
|
||||
|
||||
sub getCmdFormat
|
||||
{
|
||||
sub getCmdFormat {
|
||||
Debug( "Testing valid shell syntax\n" );
|
||||
|
||||
my ( $name ) = getpwuid( $> );
|
||||
if ( $name eq $Config{ZM_WEB_USER} )
|
||||
{
|
||||
if ( $name eq $Config{ZM_WEB_USER} ) {
|
||||
Debug( "Running as '$name', su commands not needed\n" );
|
||||
return( "" );
|
||||
}
|
||||
|
@ -109,13 +105,10 @@ sub getCmdFormat
|
|||
Debug( "Testing \"$command\"\n" );
|
||||
my $output = qx($command);
|
||||
my $status = $? >> 8;
|
||||
if ( !$status )
|
||||
{
|
||||
if ( !$status ) {
|
||||
Debug( "Test ok, using format \"$prefix<command>$suffix\"\n" );
|
||||
return( $prefix, $suffix );
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
chomp( $output );
|
||||
Debug( "Test failed, '$output'\n" );
|
||||
|
||||
|
@ -125,13 +118,10 @@ sub getCmdFormat
|
|||
Debug( "Testing \"$command\"\n" );
|
||||
my $output = qx($command);
|
||||
my $status = $? >> 8;
|
||||
if ( !$status )
|
||||
{
|
||||
if ( !$status ) {
|
||||
Debug( "Test ok, using format \"$prefix<command>$suffix\"\n" );
|
||||
return( $prefix, $suffix );
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
chomp( $output );
|
||||
Debug( "Test failed, '$output'\n" );
|
||||
|
||||
|
@ -141,13 +131,10 @@ sub getCmdFormat
|
|||
Debug( "Testing \"$command\"\n" );
|
||||
$output = qx($command);
|
||||
$status = $? >> 8;
|
||||
if ( !$status )
|
||||
{
|
||||
if ( !$status ) {
|
||||
Debug( "Test ok, using format \"$prefix<command>$suffix\"\n" );
|
||||
return( $prefix, $suffix );
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
chomp( $output );
|
||||
Debug( "Test failed, '$output'\n" );
|
||||
}
|
||||
|
@ -161,10 +148,8 @@ our $testedShellSyntax = 0;
|
|||
our ( $cmdPrefix, $cmdSuffix );
|
||||
|
||||
# For running ZM daemons etc
|
||||
sub runCommand
|
||||
{
|
||||
if ( !$testedShellSyntax )
|
||||
{
|
||||
sub runCommand {
|
||||
if ( !$testedShellSyntax ) {
|
||||
# Determine the appropriate syntax for the su command
|
||||
( $cmdPrefix, $cmdSuffix ) = getCmdFormat();
|
||||
$testedShellSyntax = !undef;
|
||||
|
@ -172,45 +157,36 @@ sub runCommand
|
|||
|
||||
my $command = shift;
|
||||
$command = $Config{ZM_PATH_BIN}."/".$command;
|
||||
if ( $cmdPrefix )
|
||||
{
|
||||
if ( $cmdPrefix ) {
|
||||
$command = $cmdPrefix.$command.$cmdSuffix;
|
||||
}
|
||||
Debug( "Command: $command\n" );
|
||||
my $output = qx($command);
|
||||
my $status = $? >> 8;
|
||||
chomp( $output );
|
||||
if ( $status || logDebugging() )
|
||||
{
|
||||
if ( $status )
|
||||
{
|
||||
if ( $status || logDebugging() ) {
|
||||
if ( $status ) {
|
||||
Error( "Unable to run \"$command\", output is \"$output\"\n" );
|
||||
exit( -1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
Debug( "Output: $output\n" );
|
||||
}
|
||||
}
|
||||
return( $output );
|
||||
}
|
||||
|
||||
sub getEventPath
|
||||
{
|
||||
sub getEventPath {
|
||||
my $event = shift;
|
||||
|
||||
my $event_path = "";
|
||||
if ( $Config{ZM_USE_DEEP_STORAGE} )
|
||||
{
|
||||
if ( $Config{ZM_USE_DEEP_STORAGE} ) {
|
||||
$event_path = $Config{ZM_DIR_EVENTS}
|
||||
.'/'.$event->{MonitorId}
|
||||
.'/'.strftime( "%y/%m/%d/%H/%M/%S",
|
||||
localtime($event->{Time})
|
||||
)
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$event_path = $Config{ZM_DIR_EVENTS}
|
||||
.'/'.$event->{MonitorId}
|
||||
.'/'.$event->{Id}
|
||||
|
@ -225,8 +201,7 @@ sub getEventPath
|
|||
return( $event_path );
|
||||
}
|
||||
|
||||
sub createEventPath
|
||||
{
|
||||
sub createEventPath {
|
||||
#
|
||||
# WARNING assumes running from events directory
|
||||
#
|
||||
|
@ -236,8 +211,7 @@ sub createEventPath
|
|||
: ($Config{ZM_PATH_WEB}.'/'.$Config{ZM_DIR_EVENTS});
|
||||
my $eventPath = $eventRootPath.'/'.$event->{MonitorId};
|
||||
|
||||
if ( $Config{ZM_USE_DEEP_STORAGE} )
|
||||
{
|
||||
if ( $Config{ZM_USE_DEEP_STORAGE} ) {
|
||||
my @startTime = localtime( $event->{StartTime} );
|
||||
|
||||
my @datetimeParts = ();
|
||||
|
@ -269,9 +243,7 @@ sub createEventPath
|
|||
or Fatal( "Can't open $idFile: $!" );
|
||||
close( $ID_FP );
|
||||
setFileOwner( $idFile );
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
makePath( $event->{Id}, $eventPath );
|
||||
$eventPath .= '/'.$event->{Id};
|
||||
|
||||
|
@ -289,13 +261,10 @@ use Data::Dumper;
|
|||
our $_setFileOwner = undef;
|
||||
our ( $_ownerUid, $_ownerGid );
|
||||
|
||||
sub _checkProcessOwner
|
||||
{
|
||||
if ( !defined($_setFileOwner) )
|
||||
{
|
||||
sub _checkProcessOwner {
|
||||
if ( !defined($_setFileOwner) ) {
|
||||
my ( $processOwner ) = getpwuid( $> );
|
||||
if ( $processOwner ne $Config{ZM_WEB_USER} )
|
||||
{
|
||||
if ( $processOwner ne $Config{ZM_WEB_USER} ) {
|
||||
# Not running as web user, so should be root in which case chown
|
||||
# the temporary directory
|
||||
( my $ownerName, my $ownerPass, $_ownerUid, $_ownerGid )
|
||||
|
@ -304,21 +273,17 @@ sub _checkProcessOwner
|
|||
.$Config{ZM_WEB_USER}."': $!"
|
||||
);
|
||||
$_setFileOwner = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$_setFileOwner = 0;
|
||||
}
|
||||
}
|
||||
return( $_setFileOwner );
|
||||
}
|
||||
|
||||
sub setFileOwner
|
||||
{
|
||||
sub setFileOwner {
|
||||
my $file = shift;
|
||||
|
||||
if ( _checkProcessOwner() )
|
||||
{
|
||||
if ( _checkProcessOwner() ) {
|
||||
chown( $_ownerUid, $_ownerGid, $file )
|
||||
or Fatal( "Can't change ownership of file '$file' to '"
|
||||
.$Config{ZM_WEB_USER}.":".$Config{ZM_WEB_GROUP}."': $!"
|
||||
|
@ -328,12 +293,9 @@ sub setFileOwner
|
|||
|
||||
our $_hasImageInfo = undef;
|
||||
|
||||
sub _checkForImageInfo
|
||||
{
|
||||
if ( !defined($_hasImageInfo) )
|
||||
{
|
||||
my $result = eval
|
||||
{
|
||||
sub _checkForImageInfo {
|
||||
if ( !defined($_hasImageInfo) ) {
|
||||
my $result = eval {
|
||||
require Image::Info;
|
||||
Image::Info->import();
|
||||
};
|
||||
|
@ -342,8 +304,7 @@ sub _checkForImageInfo
|
|||
return( $_hasImageInfo );
|
||||
}
|
||||
|
||||
sub createEvent
|
||||
{
|
||||
sub createEvent {
|
||||
my $event = shift;
|
||||
|
||||
Debug( "Creating event" );
|
||||
|
@ -353,12 +314,9 @@ sub createEvent
|
|||
|
||||
my $dbh = zmDbConnect();
|
||||
|
||||
if ( $event->{monitor} )
|
||||
{
|
||||
if ( $event->{monitor} ) {
|
||||
$event->{MonitorId} = $event->{monitor}->{Id};
|
||||
}
|
||||
elsif ( $event->{MonitorId} )
|
||||
{
|
||||
} elsif ( $event->{MonitorId} ) {
|
||||
my $sql = "select * from Monitors where Id = ?";
|
||||
my $sth = $dbh->prepare_cached( $sql )
|
||||
or Fatal( "Can't prepare sql '$sql': ".$dbh->errstr() );
|
||||
|
@ -369,9 +327,7 @@ sub createEvent
|
|||
.$event->{MonitorId}."'"
|
||||
);
|
||||
$sth->finish();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
Fatal( "Unable to create event, no monitor or monitor id supplied" );
|
||||
}
|
||||
$event->{Name} = "New Event" unless( $event->{Name} );
|
||||
|
@ -379,21 +335,15 @@ sub createEvent
|
|||
$event->{TotScore} = $event->{MaxScore} = 0;
|
||||
|
||||
my $lastTimestamp = 0.0;
|
||||
foreach my $frame ( @{$event->{frames}} )
|
||||
{
|
||||
if ( !$event->{Width} )
|
||||
{
|
||||
if ( $_hasImageInfo )
|
||||
{
|
||||
foreach my $frame ( @{$event->{frames}} ) {
|
||||
if ( !$event->{Width} ) {
|
||||
if ( $_hasImageInfo ) {
|
||||
my $imageInfo = Image::Info::image_info( $frame->{imagePath} );
|
||||
if ( $imageInfo->{error} )
|
||||
{
|
||||
if ( $imageInfo->{error} ) {
|
||||
Error( "Unable to extract image info from '"
|
||||
.$frame->{imagePath}."': ".$imageInfo->{error}
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
( $event->{Width}, $event->{Height} ) = Image::Info::dim( $imageInfo );
|
||||
}
|
||||
}
|
||||
|
@ -418,8 +368,7 @@ sub createEvent
|
|||
);
|
||||
|
||||
my ( @fields, @formats, @values );
|
||||
while ( my ( $field, $value ) = each( %$event ) )
|
||||
{
|
||||
while ( my ( $field, $value ) = each( %$event ) ) {
|
||||
next unless $field =~ /^[A-Z]/;
|
||||
push( @fields, $field );
|
||||
push( @formats, ($formats{$field} or '?') );
|
||||
|
@ -436,8 +385,7 @@ sub createEvent
|
|||
$event->{Id} = $dbh->{mysql_insertid};
|
||||
Info( "Created event ".$event->{Id} );
|
||||
|
||||
if ( $event->{EndTime} )
|
||||
{
|
||||
if ( $event->{EndTime} ) {
|
||||
$event->{Name} = $event->{monitor}->{EventPrefix}.$event->{Id}
|
||||
if ( $event->{Name} eq 'New Event' );
|
||||
my $sql = "update Events set Name = ? where Id = ?";
|
||||
|
@ -453,14 +401,12 @@ sub createEvent
|
|||
TimeStamp => 'from_unixtime(?)',
|
||||
);
|
||||
my $frameId = 1;
|
||||
foreach my $frame ( @{$event->{frames}} )
|
||||
{
|
||||
foreach my $frame ( @{$event->{frames}} ) {
|
||||
$frame->{EventId} = $event->{Id};
|
||||
$frame->{FrameId} = $frameId++;
|
||||
|
||||
my ( @fields, @formats, @values );
|
||||
while ( my ( $field, $value ) = each( %$frame ) )
|
||||
{
|
||||
while ( my ( $field, $value ) = each( %$frame ) ) {
|
||||
next unless $field =~ /^[A-Z]/;
|
||||
push( @fields, $field );
|
||||
push( @formats, ($frameFormats{$field} or '?') );
|
||||
|
@ -475,8 +421,7 @@ sub createEvent
|
|||
my $res = $sth->execute( @values )
|
||||
or Fatal( "Can't execute sql '$sql': ".$sth->errstr() );
|
||||
#$frame->{FrameId} = $dbh->{mysql_insertid};
|
||||
if ( $frame->{imagePath} )
|
||||
{
|
||||
if ( $frame->{imagePath} ) {
|
||||
$frame->{capturePath} = sprintf(
|
||||
"%s/%0".$Config{ZM_EVENT_IMAGE_DIGITS}
|
||||
."d-capture.jpg"
|
||||
|
@ -488,8 +433,7 @@ sub createEvent
|
|||
." to ".$frame->{capturePath}.": $!"
|
||||
);
|
||||
setFileOwner( $frame->{capturePath} );
|
||||
if ( 0 && $Config{ZM_CREATE_ANALYSIS_IMAGES} )
|
||||
{
|
||||
if ( 0 && $Config{ZM_CREATE_ANALYSIS_IMAGES} ) {
|
||||
$frame->{analysePath} = sprintf(
|
||||
"%s/%0".$Config{ZM_EVENT_IMAGE_DIGITS}
|
||||
."d-analyse.jpg"
|
||||
|
@ -506,20 +450,17 @@ sub createEvent
|
|||
}
|
||||
}
|
||||
|
||||
sub addEventImage
|
||||
{
|
||||
sub addEventImage {
|
||||
my $event = shift;
|
||||
my $frame = shift;
|
||||
|
||||
# TBD
|
||||
}
|
||||
|
||||
sub updateEvent
|
||||
{
|
||||
sub updateEvent {
|
||||
my $event = shift;
|
||||
|
||||
if ( !$event->{EventId} )
|
||||
{
|
||||
if ( !$event->{EventId} ) {
|
||||
Error( "Unable to update event, no event id supplied" );
|
||||
return( 0 );
|
||||
}
|
||||
|
@ -535,8 +476,7 @@ sub updateEvent
|
|||
);
|
||||
|
||||
my ( @values, @sets );
|
||||
while ( my ( $field, $value ) = each( %$event ) )
|
||||
{
|
||||
while ( my ( $field, $value ) = each( %$event ) ) {
|
||||
next if ( $field eq 'Id' );
|
||||
push( @values, $event->{$field} );
|
||||
push( @sets, $field." = ".($formats{$field} or '?') );
|
||||
|
@ -550,8 +490,7 @@ sub updateEvent
|
|||
or Fatal( "Can't execute sql '$sql': ".$sth->errstr() );
|
||||
}
|
||||
|
||||
sub deleteEventFiles
|
||||
{
|
||||
sub deleteEventFiles {
|
||||
#
|
||||
# WARNING assumes running from events directory
|
||||
#
|
||||
|
@ -559,14 +498,12 @@ sub deleteEventFiles
|
|||
my $monitor_id = shift;
|
||||
$monitor_id = '*' if ( !defined($monitor_id) );
|
||||
|
||||
if ( $Config{ZM_USE_DEEP_STORAGE} )
|
||||
{
|
||||
if ( $Config{ZM_USE_DEEP_STORAGE} ) {
|
||||
my $link_path = $monitor_id."/*/*/*/.".$event_id;
|
||||
#Debug( "LP1:$link_path" );
|
||||
my @links = glob($link_path);
|
||||
#Debug( "L:".$links[0].": $!" );
|
||||
if ( @links )
|
||||
{
|
||||
if ( @links ) {
|
||||
( $link_path ) = ( $links[0] =~ /^(.*)$/ ); # De-taint
|
||||
#Debug( "LP2:$link_path" );
|
||||
|
||||
|
@ -581,8 +518,7 @@ sub deleteEventFiles
|
|||
|
||||
unlink( $link_path ) or Error( "Unable to unlink '$link_path': $!" );
|
||||
my @path_parts = split( /\//, $event_path );
|
||||
for ( my $i = int(@path_parts)-2; $i >= 1; $i-- )
|
||||
{
|
||||
for ( my $i = int(@path_parts)-2; $i >= 1; $i-- ) {
|
||||
my $delete_path = join( '/', @path_parts[0..$i] );
|
||||
#Debug( "DP$i:$delete_path" );
|
||||
my @has_files = glob( $delete_path."/*" );
|
||||
|
@ -595,16 +531,13 @@ sub deleteEventFiles
|
|||
executeShellCommand( $command );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
my $command = "/bin/rm -rf $monitor_id/$event_id";
|
||||
executeShellCommand( $command );
|
||||
}
|
||||
}
|
||||
|
||||
sub makePath
|
||||
{
|
||||
sub makePath {
|
||||
my $path = shift;
|
||||
my $root = shift;
|
||||
$root = (( $path =~ m|^/| )?'':'.' ) unless( $root );
|
||||
|
@ -612,17 +545,12 @@ sub makePath
|
|||
Debug( "Creating path '$path' in $root'\n" );
|
||||
my @parts = split( '/', $path );
|
||||
my $fullPath = $root;
|
||||
foreach my $dir ( @parts )
|
||||
{
|
||||
foreach my $dir ( @parts ) {
|
||||
$fullPath .= '/'.$dir;
|
||||
if ( !-d $fullPath )
|
||||
{
|
||||
if ( -e $fullPath )
|
||||
{
|
||||
if ( !-d $fullPath ) {
|
||||
if ( -e $fullPath ) {
|
||||
Fatal( "Can't create '$fullPath', already exists as non directory" );
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
Debug( "Creating '$fullPath'\n" );
|
||||
mkdir( $fullPath, 0755 ) or Fatal( "Can't mkdir '$fullPath': $!" );
|
||||
setFileOwner( $fullPath );
|
||||
|
@ -635,11 +563,9 @@ sub makePath
|
|||
our $testedJSON = 0;
|
||||
our $hasJSONAny = 0;
|
||||
|
||||
sub _testJSON
|
||||
{
|
||||
sub _testJSON {
|
||||
return if ( $testedJSON );
|
||||
my $result = eval
|
||||
{
|
||||
my $result = eval {
|
||||
require JSON::Any;
|
||||
JSON::Any->import();
|
||||
};
|
||||
|
@ -647,8 +573,7 @@ sub _testJSON
|
|||
$hasJSONAny = 1 if ( $result );
|
||||
}
|
||||
|
||||
sub _getJSONType
|
||||
{
|
||||
sub _getJSONType {
|
||||
my $value = shift;
|
||||
return( 'null' ) unless( defined($value) );
|
||||
return( 'integer' ) if ( $value =~ /^\d+$/ );
|
||||
|
@ -660,64 +585,46 @@ sub _getJSONType
|
|||
|
||||
sub jsonEncode;
|
||||
|
||||
sub jsonEncode
|
||||
{
|
||||
sub jsonEncode {
|
||||
my $value = shift;
|
||||
|
||||
_testJSON();
|
||||
if ( $hasJSONAny )
|
||||
{
|
||||
if ( $hasJSONAny ) {
|
||||
my $string = eval { JSON::Any->objToJson( $value ) };
|
||||
Fatal( "Unable to encode object to JSON: $@" ) unless( $string );
|
||||
return( $string );
|
||||
}
|
||||
|
||||
my $type = _getJSONType($value);
|
||||
if ( $type eq 'integer' || $type eq 'double' )
|
||||
{
|
||||
if ( $type eq 'integer' || $type eq 'double' ) {
|
||||
return( $value );
|
||||
}
|
||||
elsif ( $type eq 'boolean' )
|
||||
{
|
||||
} elsif ( $type eq 'boolean' ) {
|
||||
return( $value?'true':'false' );
|
||||
}
|
||||
elsif ( $type eq 'string' )
|
||||
{
|
||||
} elsif ( $type eq 'string' ) {
|
||||
$value =~ s|(["\\/])|\\$1|g;
|
||||
$value =~ s|\r?\n|\n|g;
|
||||
return( '"'.$value.'"' );
|
||||
}
|
||||
elsif ( $type eq 'null' )
|
||||
{
|
||||
} elsif ( $type eq 'null' ) {
|
||||
return( 'null' );
|
||||
}
|
||||
elsif ( $type eq 'array' )
|
||||
{
|
||||
} elsif ( $type eq 'array' ) {
|
||||
return( '['.join( ',', map { jsonEncode( $_ ) } @$value ).']' );
|
||||
}
|
||||
elsif ( $type eq 'hash' )
|
||||
{
|
||||
} elsif ( $type eq 'hash' ) {
|
||||
my $result = '{';
|
||||
while ( my ( $subKey=>$subValue ) = each( %$value ) )
|
||||
{
|
||||
while ( my ( $subKey=>$subValue ) = each( %$value ) ) {
|
||||
$result .= ',' if ( $result ne '{' );
|
||||
$result .= '"'.$subKey.'":'.jsonEncode( $subValue );
|
||||
}
|
||||
return( $result.'}' );
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
Fatal( "Unexpected type '$type'" );
|
||||
}
|
||||
}
|
||||
|
||||
sub jsonDecode
|
||||
{
|
||||
sub jsonDecode {
|
||||
my $value = shift;
|
||||
|
||||
_testJSON();
|
||||
if ( $hasJSONAny )
|
||||
{
|
||||
if ( $hasJSONAny ) {
|
||||
my $object = eval { JSON::Any->jsonToObj( $value ) };
|
||||
Fatal( "Unable to decode JSON string '$value': $@" ) unless( $object );
|
||||
return( $object );
|
||||
|
@ -727,41 +634,27 @@ sub jsonDecode
|
|||
my $unescape = 0;
|
||||
my $out = '';
|
||||
my @chars = split( //, $value );
|
||||
for ( my $i = 0; $i < @chars; $i++ )
|
||||
{
|
||||
if ( !$comment )
|
||||
{
|
||||
if ( $chars[$i] eq ':' )
|
||||
{
|
||||
for ( my $i = 0; $i < @chars; $i++ ) {
|
||||
if ( !$comment ) {
|
||||
if ( $chars[$i] eq ':' ) {
|
||||
$out .= '=>';
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$out .= $chars[$i];
|
||||
}
|
||||
}
|
||||
elsif ( !$unescape )
|
||||
{
|
||||
if ( $chars[$i] eq '\\' )
|
||||
{
|
||||
} elsif ( !$unescape ) {
|
||||
if ( $chars[$i] eq '\\' ) {
|
||||
$unescape = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$out .= $chars[$i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $chars[$i] ne '/' )
|
||||
{
|
||||
} else {
|
||||
if ( $chars[$i] ne '/' ) {
|
||||
$out .= '\\';
|
||||
}
|
||||
$out .= $chars[$i];
|
||||
$unescape = 0;
|
||||
}
|
||||
if ( $chars[$i] eq '"' )
|
||||
{
|
||||
if ( $chars[$i] eq '"' ) {
|
||||
$comment = !$comment;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -128,8 +128,7 @@ our %priorities = (
|
|||
our $logger;
|
||||
our $LOGFILE;
|
||||
|
||||
sub new
|
||||
{
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $this = {};
|
||||
|
||||
|
@ -160,12 +159,10 @@ sub new
|
|||
return $this;
|
||||
}
|
||||
|
||||
sub BEGIN
|
||||
{
|
||||
sub BEGIN {
|
||||
# Fake the config variables that are used in case they are not defined yet
|
||||
# Only really necessary to support upgrade from previous version
|
||||
if ( !eval('defined($Config{ZM_LOG_DEBUG})') )
|
||||
{
|
||||
if ( !eval('defined($Config{ZM_LOG_DEBUG})') ) {
|
||||
no strict 'subs';
|
||||
no strict 'refs';
|
||||
my %dbgConfig = (
|
||||
|
@ -177,8 +174,7 @@ sub BEGIN
|
|||
ZM_LOG_DEBUG_LEVEL => 1,
|
||||
ZM_LOG_DEBUG_FILE => ""
|
||||
);
|
||||
while ( my ( $name, $value ) = each( %dbgConfig ) )
|
||||
{
|
||||
while ( my ( $name, $value ) = each( %dbgConfig ) ) {
|
||||
*{$name} = sub { $value };
|
||||
}
|
||||
use strict 'subs';
|
||||
|
@ -186,14 +182,12 @@ sub BEGIN
|
|||
}
|
||||
}
|
||||
|
||||
sub DESTROY
|
||||
{
|
||||
sub DESTROY {
|
||||
my $this = shift;
|
||||
$this->terminate();
|
||||
}
|
||||
|
||||
sub initialise( @ )
|
||||
{
|
||||
sub initialise( @ ) {
|
||||
my $this = shift;
|
||||
my %options = @_;
|
||||
|
||||
|
@ -204,8 +198,7 @@ sub initialise( @ )
|
|||
my $tempLogFile;
|
||||
$tempLogFile = $this->{logPath}."/".$this->{id}.".log";
|
||||
$tempLogFile = $options{logFile} if ( defined($options{logFile}) );
|
||||
if ( my $logFile = $this->getTargettedEnv('LOG_FILE') )
|
||||
{
|
||||
if ( my $logFile = $this->getTargettedEnv('LOG_FILE') ) {
|
||||
$tempLogFile = $logFile;
|
||||
}
|
||||
|
||||
|
@ -216,33 +209,23 @@ sub initialise( @ )
|
|||
my $tempSyslogLevel = $this->{syslogLevel};
|
||||
|
||||
$tempTermLevel = $options{termLevel} if ( defined($options{termLevel}) );
|
||||
if ( defined($options{databaseLevel}) )
|
||||
{
|
||||
if ( defined($options{databaseLevel}) ) {
|
||||
$tempDatabaseLevel = $options{databaseLevel};
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$tempDatabaseLevel = $Config{ZM_LOG_LEVEL_DATABASE};
|
||||
}
|
||||
if ( defined($options{fileLevel}) )
|
||||
{
|
||||
if ( defined($options{fileLevel}) ) {
|
||||
$tempFileLevel = $options{fileLevel};
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$tempFileLevel = $Config{ZM_LOG_LEVEL_FILE};
|
||||
}
|
||||
if ( defined($options{syslogLevel}) )
|
||||
{
|
||||
if ( defined($options{syslogLevel}) ) {
|
||||
$tempSyslogLevel = $options{syslogLevel};
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$tempSyslogLevel = $Config{ZM_LOG_LEVEL_SYSLOG};
|
||||
}
|
||||
|
||||
if ( defined($ENV{'LOG_PRINT'}) )
|
||||
{
|
||||
if ( defined($ENV{'LOG_PRINT'}) ) {
|
||||
$tempTermLevel = $ENV{'LOG_PRINT'}? DEBUG : NOLOG;
|
||||
}
|
||||
|
||||
|
@ -254,22 +237,17 @@ sub initialise( @ )
|
|||
$tempFileLevel = $level if ( defined($level = $this->getTargettedEnv('LOG_LEVEL_FILE')) );
|
||||
$tempSyslogLevel = $level if ( defined($level = $this->getTargettedEnv('LOG_LEVEL_SYSLOG')) );
|
||||
|
||||
if ( $Config{ZM_LOG_DEBUG} )
|
||||
{
|
||||
foreach my $target ( split( /\|/, $Config{ZM_LOG_DEBUG_TARGET} ) )
|
||||
{
|
||||
if ( $Config{ZM_LOG_DEBUG} ) {
|
||||
foreach my $target ( split( /\|/, $Config{ZM_LOG_DEBUG_TARGET} ) ) {
|
||||
if ( $target eq $this->{id}
|
||||
|| $target eq "_".$this->{id}
|
||||
|| $target eq $this->{idRoot}
|
||||
|| $target eq "_".$this->{idRoot}
|
||||
|| $target eq ""
|
||||
)
|
||||
{
|
||||
if ( $Config{ZM_LOG_DEBUG_LEVEL} > NOLOG )
|
||||
{
|
||||
) {
|
||||
if ( $Config{ZM_LOG_DEBUG_LEVEL} > NOLOG ) {
|
||||
$tempLevel = $this->limit( $Config{ZM_LOG_DEBUG_LEVEL} );
|
||||
if ( $Config{ZM_LOG_DEBUG_FILE} ne "" )
|
||||
{
|
||||
if ( $Config{ZM_LOG_DEBUG_FILE} ne "" ) {
|
||||
$tempLogFile = $Config{ZM_LOG_DEBUG_FILE};
|
||||
$tempFileLevel = $tempLevel;
|
||||
}
|
||||
|
@ -303,8 +281,7 @@ sub initialise( @ )
|
|||
);
|
||||
}
|
||||
|
||||
sub terminate
|
||||
{
|
||||
sub terminate {
|
||||
my $this = shift;
|
||||
return unless ( $this->{initialised} );
|
||||
$this->syslogLevel( NOLOG );
|
||||
|
@ -313,8 +290,7 @@ sub terminate
|
|||
$this->termLevel( NOLOG );
|
||||
}
|
||||
|
||||
sub reinitialise
|
||||
{
|
||||
sub reinitialise {
|
||||
my $this = shift;
|
||||
|
||||
return unless ( $this->{initialised} );
|
||||
|
@ -335,8 +311,7 @@ sub reinitialise
|
|||
$this->databaseLevel( $databaseLevel ) if ( $databaseLevel > NOLOG );
|
||||
}
|
||||
|
||||
sub limit
|
||||
{
|
||||
sub limit {
|
||||
my $this = shift;
|
||||
my $level = shift;
|
||||
return( DEBUG ) if ( $level > DEBUG );
|
||||
|
@ -344,55 +319,45 @@ sub limit
|
|||
return( $level );
|
||||
}
|
||||
|
||||
sub getTargettedEnv
|
||||
{
|
||||
sub getTargettedEnv {
|
||||
my $this = shift;
|
||||
my $name = shift;
|
||||
my $envName = $name."_".$this->{id};
|
||||
my $value;
|
||||
$value = $ENV{$envName} if ( defined($ENV{$envName}) );
|
||||
if ( !defined($value) && $this->{id} ne $this->{idRoot} )
|
||||
{
|
||||
if ( !defined($value) && $this->{id} ne $this->{idRoot} ) {
|
||||
$envName = $name."_".$this->{idRoot};
|
||||
$value = $ENV{$envName} if ( defined($ENV{$envName}) );
|
||||
}
|
||||
if ( !defined($value) )
|
||||
{
|
||||
if ( !defined($value) ) {
|
||||
$value = $ENV{$name} if ( defined($ENV{$name}) );
|
||||
}
|
||||
if ( defined($value) )
|
||||
{
|
||||
if ( defined($value) ) {
|
||||
( $value ) = $value =~ m/(.*)/;
|
||||
}
|
||||
return( $value );
|
||||
}
|
||||
|
||||
sub fetch
|
||||
{
|
||||
if ( !$logger )
|
||||
{
|
||||
sub fetch {
|
||||
if ( !$logger ) {
|
||||
$logger = ZoneMinder::Logger->new();
|
||||
$logger->initialise( 'syslogLevel'=>INFO, 'databaseLevel'=>INFO );
|
||||
}
|
||||
return( $logger );
|
||||
}
|
||||
|
||||
sub id
|
||||
{
|
||||
sub id {
|
||||
my $this = shift;
|
||||
my $id = shift;
|
||||
if ( defined($id) && $this->{id} ne $id )
|
||||
{
|
||||
if ( defined($id) && $this->{id} ne $id ) {
|
||||
# Remove whitespace
|
||||
$id =~ s/\S//g;
|
||||
# Replace non-alphanum with underscore
|
||||
$id =~ s/[^a-zA-Z_]/_/g;
|
||||
|
||||
if ( $this->{id} ne $id )
|
||||
{
|
||||
if ( $this->{id} ne $id ) {
|
||||
$this->{id} = $this->{idRoot} = $id;
|
||||
if ( $id =~ /^([^_]+)_(.+)$/ )
|
||||
{
|
||||
if ( $id =~ /^([^_]+)_(.+)$/ ) {
|
||||
$this->{idRoot} = $1;
|
||||
$this->{idArgs} = $2;
|
||||
}
|
||||
|
@ -401,12 +366,10 @@ sub id
|
|||
return( $this->{id} );
|
||||
}
|
||||
|
||||
sub level
|
||||
{
|
||||
sub level {
|
||||
my $this = shift;
|
||||
my $level = shift;
|
||||
if ( defined($level) )
|
||||
{
|
||||
if ( defined($level) ) {
|
||||
$this->{level} = $this->limit( $level );
|
||||
$this->{effectiveLevel} = NOLOG;
|
||||
$this->{effectiveLevel} = $this->{termLevel} if ( $this->{termLevel} > $this->{effectiveLevel} );
|
||||
|
@ -418,64 +381,48 @@ sub level
|
|||
return( $this->{level} );
|
||||
}
|
||||
|
||||
sub debugOn
|
||||
{
|
||||
sub debugOn {
|
||||
my $this = shift;
|
||||
return( $this->{effectiveLevel} >= DEBUG );
|
||||
}
|
||||
|
||||
sub trace
|
||||
{
|
||||
sub trace {
|
||||
my $this = shift;
|
||||
$this->{trace} = $_[0] if ( @_ );
|
||||
return( $this->{trace} );
|
||||
}
|
||||
|
||||
sub termLevel
|
||||
{
|
||||
sub termLevel {
|
||||
my $this = shift;
|
||||
my $termLevel = shift;
|
||||
if ( defined($termLevel) )
|
||||
{
|
||||
if ( defined($termLevel) ) {
|
||||
$termLevel = NOLOG if ( !$this->{hasTerm} );
|
||||
$termLevel = $this->limit( $termLevel );
|
||||
if ( $this->{termLevel} != $termLevel )
|
||||
{
|
||||
if ( $this->{termLevel} != $termLevel ) {
|
||||
$this->{termLevel} = $termLevel;
|
||||
}
|
||||
}
|
||||
return( $this->{termLevel} );
|
||||
}
|
||||
|
||||
sub databaseLevel
|
||||
{
|
||||
sub databaseLevel {
|
||||
my $this = shift;
|
||||
my $databaseLevel = shift;
|
||||
if ( defined($databaseLevel) )
|
||||
{
|
||||
if ( defined($databaseLevel) ) {
|
||||
$databaseLevel = $this->limit( $databaseLevel );
|
||||
if ( $this->{databaseLevel} != $databaseLevel )
|
||||
{
|
||||
if ( $databaseLevel > NOLOG && $this->{databaseLevel} <= NOLOG )
|
||||
{
|
||||
if ( !$this->{dbh} )
|
||||
{
|
||||
if ( $this->{databaseLevel} != $databaseLevel ) {
|
||||
if ( $databaseLevel > NOLOG && $this->{databaseLevel} <= NOLOG ) {
|
||||
if ( !$this->{dbh} ) {
|
||||
my $socket;
|
||||
my ( $host, $portOrSocket ) = ( $Config{ZM_DB_HOST} =~ /^([^:]+)(?::(.+))?$/ );
|
||||
|
||||
if ( defined($portOrSocket) )
|
||||
{
|
||||
if ( $portOrSocket =~ /^\// )
|
||||
{
|
||||
if ( defined($portOrSocket) ) {
|
||||
if ( $portOrSocket =~ /^\// ) {
|
||||
$socket = ";mysql_socket=".$portOrSocket;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$socket = ";host=".$host.";port=".$portOrSocket;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$socket = ";host=".$Config{ZM_DB_HOST};
|
||||
}
|
||||
$this->{dbh} = DBI->connect( "DBI:mysql:database=".$Config{ZM_DB_NAME}
|
||||
|
@ -483,8 +430,7 @@ sub databaseLevel
|
|||
, $Config{ZM_DB_USER}
|
||||
, $Config{ZM_DB_PASS}
|
||||
);
|
||||
if ( !$this->{dbh} )
|
||||
{
|
||||
if ( !$this->{dbh} ) {
|
||||
$databaseLevel = NOLOG;
|
||||
Error( "Unable to write log entries to DB, can't connect to database '"
|
||||
.$Config{ZM_DB_NAME}
|
||||
|
@ -492,9 +438,7 @@ sub databaseLevel
|
|||
.$Config{ZM_DB_HOST}
|
||||
."'"
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$this->{dbh}->{AutoCommit} = 1;
|
||||
Fatal( "Can't set AutoCommit on in database connection" )
|
||||
unless( $this->{dbh}->{AutoCommit} );
|
||||
|
@ -504,11 +448,8 @@ sub databaseLevel
|
|||
$this->{dbh}->trace( 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
elsif ( $databaseLevel <= NOLOG && $this->{databaseLevel} > NOLOG )
|
||||
{
|
||||
if ( $this->{dbh} )
|
||||
{
|
||||
} elsif ( $databaseLevel <= NOLOG && $this->{databaseLevel} > NOLOG ) {
|
||||
if ( $this->{dbh} ) {
|
||||
$this->{dbh}->disconnect();
|
||||
undef($this->{dbh});
|
||||
}
|
||||
|
@ -519,15 +460,12 @@ sub databaseLevel
|
|||
return( $this->{databaseLevel} );
|
||||
}
|
||||
|
||||
sub fileLevel
|
||||
{
|
||||
sub fileLevel {
|
||||
my $this = shift;
|
||||
my $fileLevel = shift;
|
||||
if ( defined($fileLevel) )
|
||||
{
|
||||
if ( defined($fileLevel) ) {
|
||||
$fileLevel = $this->limit($fileLevel);
|
||||
if ( $this->{fileLevel} != $fileLevel )
|
||||
{
|
||||
if ( $this->{fileLevel} != $fileLevel ) {
|
||||
$this->closeFile() if ( $this->{fileLevel} > NOLOG );
|
||||
$this->{fileLevel} = $fileLevel;
|
||||
$this->openFile() if ( $this->{fileLevel} > NOLOG );
|
||||
|
@ -536,15 +474,12 @@ sub fileLevel
|
|||
return( $this->{fileLevel} );
|
||||
}
|
||||
|
||||
sub syslogLevel
|
||||
{
|
||||
sub syslogLevel {
|
||||
my $this = shift;
|
||||
my $syslogLevel = shift;
|
||||
if ( defined($syslogLevel) )
|
||||
{
|
||||
if ( defined($syslogLevel) ) {
|
||||
$syslogLevel = $this->limit($syslogLevel);
|
||||
if ( $this->{syslogLevel} != $syslogLevel )
|
||||
{
|
||||
if ( $this->{syslogLevel} != $syslogLevel ) {
|
||||
$this->closeSyslog() if ( $syslogLevel <= NOLOG && $this->{syslogLevel} > NOLOG );
|
||||
$this->openSyslog() if ( $syslogLevel > NOLOG && $this->{syslogLevel} <= NOLOG );
|
||||
$this->{syslogLevel} = $syslogLevel;
|
||||
|
@ -553,70 +488,56 @@ sub syslogLevel
|
|||
return( $this->{syslogLevel} );
|
||||
}
|
||||
|
||||
sub openSyslog
|
||||
{
|
||||
sub openSyslog {
|
||||
my $this = shift;
|
||||
openlog( $this->{id}, "pid", "local1" );
|
||||
}
|
||||
|
||||
sub closeSyslog
|
||||
{
|
||||
sub closeSyslog {
|
||||
my $this = shift;
|
||||
#closelog();
|
||||
}
|
||||
|
||||
sub logFile
|
||||
{
|
||||
sub logFile {
|
||||
my $this = shift;
|
||||
my $logFile = shift;
|
||||
if ( $logFile =~ /^(.+)\+$/ )
|
||||
{
|
||||
if ( $logFile =~ /^(.+)\+$/ ) {
|
||||
$this->{logFile} = $1.'.'.$$;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$this->{logFile} = $logFile;
|
||||
}
|
||||
}
|
||||
|
||||
sub openFile
|
||||
{
|
||||
sub openFile {
|
||||
my $this = shift;
|
||||
if ( open( $LOGFILE, ">>", $this->{logFile} ) )
|
||||
{
|
||||
if ( open( $LOGFILE, ">>", $this->{logFile} ) ) {
|
||||
$LOGFILE->autoflush() if ( $this->{autoFlush} );
|
||||
|
||||
my $webUid = (getpwnam( $Config{ZM_WEB_USER} ))[2];
|
||||
my $webGid = (getgrnam( $Config{ZM_WEB_GROUP} ))[2];
|
||||
if ( $> == 0 )
|
||||
{
|
||||
if ( $> == 0 ) {
|
||||
chown( $webUid, $webGid, $this->{logFile} )
|
||||
or Fatal( "Can't change permissions on log file '"
|
||||
.$this->{logFile}."': $!"
|
||||
)
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$this->fileLevel( NOLOG );
|
||||
Error( "Can't open log file '".$this->{logFile}."': $!" );
|
||||
}
|
||||
}
|
||||
|
||||
sub closeFile
|
||||
{
|
||||
sub closeFile {
|
||||
my $this = shift;
|
||||
close( $LOGFILE ) if ( fileno($LOGFILE) );
|
||||
}
|
||||
|
||||
sub logPrint
|
||||
{
|
||||
sub logPrint {
|
||||
my $this = shift;
|
||||
my $level = shift;
|
||||
my $string = shift;
|
||||
|
||||
if ( $level <= $this->{effectiveLevel} )
|
||||
{
|
||||
if ( $level <= $this->{effectiveLevel} ) {
|
||||
$string =~ s/[\r\n]+$//g;
|
||||
|
||||
my $code = $codes{$level};
|
||||
|
@ -633,23 +554,19 @@ sub logPrint
|
|||
, $code
|
||||
, $string
|
||||
);
|
||||
if ( $this->{trace} )
|
||||
{
|
||||
if ( $this->{trace} ) {
|
||||
$message = Carp::shortmess( $message );
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$message = $message."\n";
|
||||
}
|
||||
syslog( $priorities{$level}, $code." [%s]", $string )
|
||||
if ( $level <= $this->{syslogLevel} );
|
||||
if ( $level <= $this->{syslogLevel} ) {
|
||||
syslog( $priorities{$level}, $code." [%s]", $string );
|
||||
}
|
||||
print( $LOGFILE $message ) if ( $level <= $this->{fileLevel} );
|
||||
if ( $level <= $this->{databaseLevel} )
|
||||
{
|
||||
if ( $level <= $this->{databaseLevel} ) {
|
||||
my $sql = "insert into Logs ( TimeKey, Component, Pid, Level, Code, Message, File, Line ) values ( ?, ?, ?, ?, ?, ?, ?, NULL )";
|
||||
$this->{sth} = $this->{dbh}->prepare_cached( $sql );
|
||||
if ( !$this->{sth} )
|
||||
{
|
||||
if ( !$this->{sth} ) {
|
||||
$this->{databaseLevel} = NOLOG;
|
||||
Fatal( "Can't prepare log entry '$sql': ".$this->{dbh}->errstr() );
|
||||
}
|
||||
|
@ -661,8 +578,7 @@ sub logPrint
|
|||
, $string
|
||||
, $this->{fileName}
|
||||
);
|
||||
if ( !$res )
|
||||
{
|
||||
if ( !$res ) {
|
||||
$this->{databaseLevel} = NOLOG;
|
||||
Fatal( "Can't execute log entry '$sql': ".$this->{sth}->errstr() );
|
||||
}
|
||||
|
@ -671,27 +587,23 @@ sub logPrint
|
|||
}
|
||||
}
|
||||
|
||||
sub logInit( ;@ )
|
||||
{
|
||||
sub logInit( ;@ ) {
|
||||
my %options = @_ ? @_ : ();
|
||||
$logger = ZoneMinder::Logger->new() if ( !$logger );
|
||||
$logger->initialise( %options );
|
||||
}
|
||||
|
||||
sub logReinit
|
||||
{
|
||||
sub logReinit {
|
||||
fetch()->reinitialise();
|
||||
}
|
||||
|
||||
sub logTerm
|
||||
{
|
||||
sub logTerm {
|
||||
return unless ( $logger );
|
||||
$logger->terminate();
|
||||
$logger = undef;
|
||||
}
|
||||
|
||||
sub logHupHandler
|
||||
{
|
||||
sub logHupHandler {
|
||||
my $savedErrno = $!;
|
||||
return unless( $logger );
|
||||
fetch()->reinitialise();
|
||||
|
@ -699,90 +611,74 @@ sub logHupHandler
|
|||
$! = $savedErrno;
|
||||
}
|
||||
|
||||
sub logSetSignal
|
||||
{
|
||||
sub logSetSignal {
|
||||
$SIG{HUP} = \&logHupHandler;
|
||||
}
|
||||
|
||||
sub logClearSignal
|
||||
{
|
||||
sub logClearSignal {
|
||||
$SIG{HUP} = 'DEFAULT';
|
||||
}
|
||||
|
||||
sub logLevel
|
||||
{
|
||||
sub logLevel {
|
||||
return( fetch()->level( @_ ) );
|
||||
}
|
||||
|
||||
sub logDebugging
|
||||
{
|
||||
sub logDebugging {
|
||||
return( fetch()->debugOn() );
|
||||
}
|
||||
|
||||
sub logTermLevel
|
||||
{
|
||||
sub logTermLevel {
|
||||
return( fetch()->termLevel( @_ ) );
|
||||
}
|
||||
|
||||
sub logDatabaseLevel
|
||||
{
|
||||
sub logDatabaseLevel {
|
||||
return( fetch()->databaseLevel( @_ ) );
|
||||
}
|
||||
|
||||
sub logFileLevel
|
||||
{
|
||||
sub logFileLevel {
|
||||
return( fetch()->fileLevel( @_ ) );
|
||||
}
|
||||
|
||||
sub logSyslogLevel
|
||||
{
|
||||
sub logSyslogLevel {
|
||||
return( fetch()->syslogLevel( @_ ) );
|
||||
}
|
||||
|
||||
sub Mark
|
||||
{
|
||||
sub Mark {
|
||||
my $level = shift;
|
||||
$level = DEBUG unless( defined($level) );
|
||||
my $tag = "Mark";
|
||||
fetch()->logPrint( $level, $tag );
|
||||
}
|
||||
|
||||
sub Dump
|
||||
{
|
||||
sub Dump {
|
||||
my $var = shift;
|
||||
my $label = shift;
|
||||
$label = "VAR" unless( defined($label) );
|
||||
fetch()->logPrint( DEBUG, Data::Dumper->Dump( [ $var ], [ $label ] ) );
|
||||
}
|
||||
|
||||
sub Debug( @ )
|
||||
{
|
||||
sub Debug( @ ) {
|
||||
fetch()->logPrint( DEBUG, @_ );
|
||||
}
|
||||
|
||||
sub Info( @ )
|
||||
{
|
||||
sub Info( @ ) {
|
||||
fetch()->logPrint( INFO, @_ );
|
||||
}
|
||||
|
||||
sub Warning( @ )
|
||||
{
|
||||
sub Warning( @ ) {
|
||||
fetch()->logPrint( WARNING, @_ );
|
||||
}
|
||||
|
||||
sub Error( @ )
|
||||
{
|
||||
sub Error( @ ) {
|
||||
fetch()->logPrint( ERROR, @_ );
|
||||
}
|
||||
|
||||
sub Fatal( @ )
|
||||
{
|
||||
sub Fatal( @ ) {
|
||||
fetch()->logPrint( FATAL, @_ );
|
||||
exit( -1 );
|
||||
}
|
||||
|
||||
sub Panic( @ )
|
||||
{
|
||||
sub Panic( @ ) {
|
||||
fetch()->logPrint( PANIC, @_ );
|
||||
confess( $_[0] );
|
||||
}
|
||||
|
|
|
@ -115,13 +115,11 @@ use constant TRIGGER_OFF => 2;
|
|||
|
||||
use Storable qw( freeze thaw );
|
||||
|
||||
if ( "@ENABLE_MMAP@" eq 'yes' ) # 'yes' if memory is mmapped
|
||||
{
|
||||
if ( "@ENABLE_MMAP@" eq 'yes' ) {
|
||||
# 'yes' if memory is mmapped
|
||||
require ZoneMinder::Memory::Mapped;
|
||||
ZoneMinder::Memory::Mapped->import();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
require ZoneMinder::Memory::Shared;
|
||||
ZoneMinder::Memory::Shared->import();
|
||||
}
|
||||
|
@ -142,8 +140,7 @@ our $arch = 32 + 32*( qx(uname -m) =~ /64/ );
|
|||
our $native = $arch/8;
|
||||
our $mem_seq = 0;
|
||||
|
||||
our $mem_data =
|
||||
{
|
||||
our $mem_data = {
|
||||
"shared_data" => { "type"=>"SharedData", "seq"=>$mem_seq++, "contents"=> {
|
||||
"size" => { "type"=>"uint32", "seq"=>$mem_seq++ },
|
||||
"last_write_index" => { "type"=>"uint32", "seq"=>$mem_seq++ },
|
||||
|
@ -185,73 +182,54 @@ our $mem_data =
|
|||
our $mem_size = 0;
|
||||
our $mem_verified = {};
|
||||
|
||||
sub zmMemInit
|
||||
{
|
||||
sub zmMemInit {
|
||||
my $offset = 0;
|
||||
|
||||
foreach my $section_data ( sort { $a->{seq} <=> $b->{seq} } values( %$mem_data ) )
|
||||
{
|
||||
foreach my $section_data ( sort { $a->{seq} <=> $b->{seq} } values( %$mem_data ) ) {
|
||||
$section_data->{offset} = $offset;
|
||||
$section_data->{align} = 0;
|
||||
|
||||
if ( $section_data->{align} > 1 )
|
||||
{
|
||||
if ( $section_data->{align} > 1 ) {
|
||||
my $rem = $offset % $section_data->{align};
|
||||
if ( $rem > 0 )
|
||||
{
|
||||
if ( $rem > 0 ) {
|
||||
$offset += ($section_data->{align} - $rem);
|
||||
}
|
||||
}
|
||||
foreach my $member_data ( sort { $a->{seq} <=> $b->{seq} } values( %{$section_data->{contents}} ) )
|
||||
{
|
||||
foreach my $member_data ( sort { $a->{seq} <=> $b->{seq} } values( %{$section_data->{contents}} ) ) {
|
||||
if ( $member_data->{type} eq "long"
|
||||
|| $member_data->{type} eq "ulong"
|
||||
|| $member_data->{type} eq "size_t"
|
||||
)
|
||||
{
|
||||
) {
|
||||
$member_data->{size} = $member_data->{align} = $native;
|
||||
}
|
||||
elsif( $member_data->{type} eq "int64"
|
||||
} elsif ( $member_data->{type} eq "int64"
|
||||
|| $member_data->{type} eq "uint64"
|
||||
|| $member_data->{type} eq "time_t64"
|
||||
)
|
||||
{
|
||||
) {
|
||||
$member_data->{size} = $member_data->{align} = 8;
|
||||
}
|
||||
elsif ( $member_data->{type} eq "int32"
|
||||
} elsif ( $member_data->{type} eq "int32"
|
||||
|| $member_data->{type} eq "uint32"
|
||||
|| $member_data->{type} eq "bool4"
|
||||
)
|
||||
{
|
||||
) {
|
||||
$member_data->{size} = $member_data->{align} = 4;
|
||||
}
|
||||
elsif ($member_data->{type} eq "int16"
|
||||
} elsif ($member_data->{type} eq "int16"
|
||||
|| $member_data->{type} eq "uint16"
|
||||
)
|
||||
{
|
||||
) {
|
||||
$member_data->{size} = $member_data->{align} = 2;
|
||||
}
|
||||
elsif ( $member_data->{type} eq "int8"
|
||||
} elsif ( $member_data->{type} eq "int8"
|
||||
|| $member_data->{type} eq "uint8"
|
||||
|| $member_data->{type} eq "bool1"
|
||||
)
|
||||
{
|
||||
) {
|
||||
$member_data->{size} = $member_data->{align} = 1;
|
||||
}
|
||||
elsif ( $member_data->{type} =~ /^u?int8\[(\d+)\]$/ )
|
||||
{
|
||||
} elsif ( $member_data->{type} =~ /^u?int8\[(\d+)\]$/ ) {
|
||||
$member_data->{size} = $1;
|
||||
$member_data->{align} = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
Fatal( "Unexpected type '".$member_data->{type}
|
||||
."' found in shared data definition."
|
||||
);
|
||||
}
|
||||
|
||||
if ( $member_data->{align} > 1 && ($offset%$member_data->{align}) > 0 )
|
||||
{
|
||||
if ( $member_data->{align} > 1 && ($offset%$member_data->{align}) > 0 ) {
|
||||
$offset += ($member_data->{align} - ($offset%$member_data->{align}));
|
||||
}
|
||||
$member_data->{offset} = $offset;
|
||||
|
@ -265,22 +243,17 @@ sub zmMemInit
|
|||
|
||||
&zmMemInit();
|
||||
|
||||
sub zmMemVerify
|
||||
{
|
||||
sub zmMemVerify {
|
||||
my $monitor = shift;
|
||||
if ( !zmMemAttach( $monitor, $mem_size ) )
|
||||
{
|
||||
if ( !zmMemAttach( $monitor, $mem_size ) ) {
|
||||
return( undef );
|
||||
}
|
||||
|
||||
my $mem_key = zmMemKey( $monitor );
|
||||
if ( !defined($mem_verified->{$mem_key}) )
|
||||
{
|
||||
if ( !defined($mem_verified->{$mem_key}) ) {
|
||||
my $sd_size = zmMemRead( $monitor, "shared_data:size", 1 );
|
||||
if ( $sd_size != $mem_data->{shared_data}->{size} )
|
||||
{
|
||||
if ( $sd_size )
|
||||
{
|
||||
if ( $sd_size != $mem_data->{shared_data}->{size} ) {
|
||||
if ( $sd_size ) {
|
||||
Error( "Shared data size conflict in shared_data for monitor "
|
||||
.$monitor->{Name}
|
||||
.", expected "
|
||||
|
@ -288,9 +261,7 @@ sub zmMemVerify
|
|||
.", got "
|
||||
.$sd_size
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
Debug( "Shared data size conflict in shared_data for monitor "
|
||||
.$monitor->{Name}
|
||||
.", expected "
|
||||
|
@ -301,10 +272,8 @@ sub zmMemVerify
|
|||
return( undef );
|
||||
}
|
||||
my $td_size = zmMemRead( $monitor, "trigger_data:size", 1 );
|
||||
if ( $td_size != $mem_data->{trigger_data}->{size} )
|
||||
{
|
||||
if ( $td_size )
|
||||
{
|
||||
if ( $td_size != $mem_data->{trigger_data}->{size} ) {
|
||||
if ( $td_size ) {
|
||||
Error( "Shared data size conflict in trigger_data for monitor "
|
||||
.$monitor->{Name}
|
||||
.", expected "
|
||||
|
@ -312,9 +281,7 @@ sub zmMemVerify
|
|||
.", got "
|
||||
.$td_size
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
Debug( "Shared data size conflict in trigger_data for monitor "
|
||||
.$monitor->{Name}
|
||||
.", expected "
|
||||
|
@ -330,24 +297,20 @@ sub zmMemVerify
|
|||
return( !undef );
|
||||
}
|
||||
|
||||
sub zmMemRead
|
||||
{
|
||||
sub zmMemRead {
|
||||
my $monitor = shift;
|
||||
my $fields = shift;
|
||||
my $nocheck = shift;
|
||||
|
||||
if ( !($nocheck || zmMemVerify( $monitor )) )
|
||||
{
|
||||
if ( !($nocheck || zmMemVerify( $monitor )) ) {
|
||||
return( undef );
|
||||
}
|
||||
|
||||
if ( !ref($fields) )
|
||||
{
|
||||
if ( !ref($fields) ) {
|
||||
$fields = [ $fields ];
|
||||
}
|
||||
my @values;
|
||||
foreach my $field ( @$fields )
|
||||
{
|
||||
foreach my $field ( @$fields ) {
|
||||
my ( $section, $element ) = split( /[\/:.]/, $field );
|
||||
Fatal( "Invalid shared data selector '$field'" ) if ( !$section || !$element );
|
||||
|
||||
|
@ -356,171 +319,113 @@ sub zmMemRead
|
|||
my $size = $mem_data->{$section}->{contents}->{$element}->{size};
|
||||
|
||||
my $data = zmMemGet( $monitor, $offset, $size );
|
||||
if ( !defined($data) )
|
||||
{
|
||||
if ( !defined($data) ) {
|
||||
Error( "Unable to read '$field' from memory for monitor ".$monitor->{Id} );
|
||||
zmMemInvalidate( $monitor );
|
||||
return( undef );
|
||||
}
|
||||
my $value;
|
||||
if ( $type eq "long" )
|
||||
{
|
||||
if ( $type eq "long" ) {
|
||||
( $value ) = unpack( "l!", $data );
|
||||
}
|
||||
elsif ( $type eq "ulong" || $type eq "size_t" )
|
||||
{
|
||||
} elsif ( $type eq "ulong" || $type eq "size_t" ) {
|
||||
( $value ) = unpack( "L!", $data );
|
||||
}
|
||||
elsif ( $type eq "int64" || $type eq "time_t64" )
|
||||
{
|
||||
} elsif ( $type eq "int64" || $type eq "time_t64" ) {
|
||||
# The "q" type is only available on 64bit platforms, so use native.
|
||||
( $value ) = unpack( "l!", $data );
|
||||
}
|
||||
elsif ( $type eq "uint64" )
|
||||
{
|
||||
} elsif ( $type eq "uint64" ) {
|
||||
# The "q" type is only available on 64bit platforms, so use native.
|
||||
( $value ) = unpack( "L!", $data );
|
||||
}
|
||||
elsif ( $type eq "int32" )
|
||||
{
|
||||
} elsif ( $type eq "int32" ) {
|
||||
( $value ) = unpack( "l", $data );
|
||||
}
|
||||
elsif ( $type eq "uint32" || $type eq "bool4" )
|
||||
{
|
||||
} elsif ( $type eq "uint32" || $type eq "bool4" ) {
|
||||
( $value ) = unpack( "L", $data );
|
||||
}
|
||||
elsif ( $type eq "int16" )
|
||||
{
|
||||
} elsif ( $type eq "int16" ) {
|
||||
( $value ) = unpack( "s", $data );
|
||||
}
|
||||
elsif ( $type eq "uint16" )
|
||||
{
|
||||
} elsif ( $type eq "uint16" ) {
|
||||
( $value ) = unpack( "S", $data );
|
||||
}
|
||||
elsif ( $type eq "int8" )
|
||||
{
|
||||
} elsif ( $type eq "int8" ) {
|
||||
( $value ) = unpack( "c", $data );
|
||||
}
|
||||
elsif ( $type eq "uint8" || $type eq "bool1" )
|
||||
{
|
||||
} elsif ( $type eq "uint8" || $type eq "bool1" ) {
|
||||
( $value ) = unpack( "C", $data );
|
||||
}
|
||||
elsif ( $type =~ /^int8\[\d+\]$/ )
|
||||
{
|
||||
} elsif ( $type =~ /^int8\[\d+\]$/ ) {
|
||||
( $value ) = unpack( "Z".$size, $data );
|
||||
}
|
||||
elsif ( $type =~ /^uint8\[\d+\]$/ )
|
||||
{
|
||||
} elsif ( $type =~ /^uint8\[\d+\]$/ ) {
|
||||
( $value ) = unpack( "C".$size, $data );
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
Fatal( "Unexpected type '".$type."' found for '".$field."'" );
|
||||
}
|
||||
push( @values, $value );
|
||||
}
|
||||
if ( wantarray() )
|
||||
{
|
||||
if ( wantarray() ) {
|
||||
return( @values )
|
||||
}
|
||||
return( $values[0] );
|
||||
}
|
||||
|
||||
sub zmMemInvalidate
|
||||
{
|
||||
sub zmMemInvalidate {
|
||||
my $monitor = shift;
|
||||
my $mem_key = zmMemKey($monitor);
|
||||
if ( $mem_key )
|
||||
{
|
||||
if ( $mem_key ) {
|
||||
delete $mem_verified->{$mem_key};
|
||||
zmMemDetach( $monitor );
|
||||
}
|
||||
}
|
||||
|
||||
sub zmMemTidy
|
||||
{
|
||||
sub zmMemTidy {
|
||||
zmMemClean();
|
||||
}
|
||||
|
||||
sub zmMemWrite
|
||||
{
|
||||
sub zmMemWrite {
|
||||
my $monitor = shift;
|
||||
my $field_values = shift;
|
||||
my $nocheck = shift;
|
||||
|
||||
if ( !($nocheck || zmMemVerify( $monitor )) )
|
||||
{
|
||||
if ( !($nocheck || zmMemVerify( $monitor )) ) {
|
||||
return( undef );
|
||||
}
|
||||
|
||||
while ( my ( $field, $value ) = each( %$field_values ) )
|
||||
{
|
||||
while ( my ( $field, $value ) = each( %$field_values ) ) {
|
||||
my ( $section, $element ) = split( /[\/:.]/, $field );
|
||||
Fatal( "Invalid shared data selector '$field'" )
|
||||
if ( !$section || !$element );
|
||||
if ( !$section || !$element ) {
|
||||
Fatal( "Invalid shared data selector '$field'" );
|
||||
}
|
||||
|
||||
my $offset = $mem_data->{$section}->{contents}->{$element}->{offset};
|
||||
my $type = $mem_data->{$section}->{contents}->{$element}->{type};
|
||||
my $size = $mem_data->{$section}->{contents}->{$element}->{size};
|
||||
|
||||
my $data;
|
||||
if ( $type eq "long" )
|
||||
{
|
||||
if ( $type eq "long" ) {
|
||||
$data = pack( "l!", $value );
|
||||
}
|
||||
elsif ( $type eq "ulong" || $type eq "size_t" )
|
||||
{
|
||||
} elsif ( $type eq "ulong" || $type eq "size_t" ) {
|
||||
$data = pack( "L!", $value );
|
||||
}
|
||||
elsif ( $type eq "int64" || $type eq "time_t64" )
|
||||
{
|
||||
} elsif ( $type eq "int64" || $type eq "time_t64" ) {
|
||||
# The "q" type is only available on 64bit platforms, so use native.
|
||||
$data = pack( "l!", $value );
|
||||
}
|
||||
elsif ( $type eq "uint64" )
|
||||
{
|
||||
} elsif ( $type eq "uint64" ) {
|
||||
# The "q" type is only available on 64bit platforms, so use native.
|
||||
$data = pack( "L!", $value );
|
||||
}
|
||||
elsif ( $type eq "int32" )
|
||||
{
|
||||
} elsif ( $type eq "int32" ) {
|
||||
$data = pack( "l", $value );
|
||||
}
|
||||
elsif ( $type eq "uint32" || $type eq "bool4" )
|
||||
{
|
||||
} elsif ( $type eq "uint32" || $type eq "bool4" ) {
|
||||
$data = pack( "L", $value );
|
||||
}
|
||||
elsif ( $type eq "int16" )
|
||||
{
|
||||
} elsif ( $type eq "int16" ) {
|
||||
$data = pack( "s", $value );
|
||||
}
|
||||
elsif ( $type eq "uint16" )
|
||||
{
|
||||
} elsif ( $type eq "uint16" ) {
|
||||
$data = pack( "S", $value );
|
||||
}
|
||||
elsif ( $type eq "int8" )
|
||||
{
|
||||
} elsif ( $type eq "int8" ) {
|
||||
$data = pack( "c", $value );
|
||||
}
|
||||
elsif ( $type eq "uint8" || $type eq "bool1" )
|
||||
{
|
||||
} elsif ( $type eq "uint8" || $type eq "bool1" ) {
|
||||
$data = pack( "C", $value );
|
||||
}
|
||||
elsif ( $type =~ /^int8\[\d+\]$/ )
|
||||
{
|
||||
} elsif ( $type =~ /^int8\[\d+\]$/ ) {
|
||||
$data = pack( "Z".$size, $value );
|
||||
}
|
||||
elsif ( $type =~ /^uint8\[\d+\]$/ )
|
||||
{
|
||||
} elsif ( $type =~ /^uint8\[\d+\]$/ ) {
|
||||
$data = pack( "C".$size, $value );
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
Fatal( "Unexpected type '".$type."' found for '".$field."'" );
|
||||
}
|
||||
|
||||
if ( !zmMemPut( $monitor, $offset, $size, $data ) )
|
||||
{
|
||||
if ( !zmMemPut( $monitor, $offset, $size, $data ) ) {
|
||||
Error( "Unable to write '$value' to '$field' in memory for monitor "
|
||||
.$monitor->{Id}
|
||||
);
|
||||
|
@ -531,52 +436,45 @@ sub zmMemWrite
|
|||
return( !undef );
|
||||
}
|
||||
|
||||
sub zmGetMonitorState
|
||||
{
|
||||
sub zmGetMonitorState {
|
||||
my $monitor = shift;
|
||||
|
||||
return( zmMemRead( $monitor, "shared_data:state" ) );
|
||||
}
|
||||
|
||||
sub zmGetAlarmLocation
|
||||
{
|
||||
sub zmGetAlarmLocation {
|
||||
my $monitor = shift;
|
||||
|
||||
return( zmMemRead( $monitor, [ "shared_data:alarm_x", "shared_data:alarm_y" ] ) );
|
||||
}
|
||||
|
||||
sub zmSetControlState
|
||||
{
|
||||
sub zmSetControlState {
|
||||
my $monitor = shift;
|
||||
my $control_state = shift;
|
||||
|
||||
zmMemWrite( $monitor, { "shared_data:control_state" => $control_state } );
|
||||
}
|
||||
|
||||
sub zmGetControlState
|
||||
{
|
||||
sub zmGetControlState {
|
||||
my $monitor = shift;
|
||||
|
||||
return( zmMemRead( $monitor, "shared_data:control_state" ) );
|
||||
}
|
||||
|
||||
sub zmSaveControlState
|
||||
{
|
||||
sub zmSaveControlState {
|
||||
my $monitor = shift;
|
||||
my $control_state = shift;
|
||||
|
||||
zmSetControlState( $monitor, freeze( $control_state ) );
|
||||
}
|
||||
|
||||
sub zmRestoreControlState
|
||||
{
|
||||
sub zmRestoreControlState {
|
||||
my $monitor = shift;
|
||||
|
||||
return( thaw( zmGetControlState( $monitor ) ) );
|
||||
}
|
||||
|
||||
sub zmIsAlarmed
|
||||
{
|
||||
sub zmIsAlarmed {
|
||||
my $monitor = shift;
|
||||
|
||||
my $state = zmGetMonitorState( $monitor );
|
||||
|
@ -584,8 +482,7 @@ sub zmIsAlarmed
|
|||
return( $state == STATE_ALARM );
|
||||
}
|
||||
|
||||
sub zmInAlarm
|
||||
{
|
||||
sub zmInAlarm {
|
||||
my $monitor = shift;
|
||||
|
||||
my $state = zmGetMonitorState( $monitor );
|
||||
|
@ -593,8 +490,7 @@ sub zmInAlarm
|
|||
return( $state == STATE_ALARM || $state == STATE_ALERT );
|
||||
}
|
||||
|
||||
sub zmHasAlarmed
|
||||
{
|
||||
sub zmHasAlarmed {
|
||||
my $monitor = shift;
|
||||
my $last_event_id = shift;
|
||||
|
||||
|
@ -603,47 +499,39 @@ sub zmHasAlarmed
|
|||
]
|
||||
);
|
||||
|
||||
if ( $state == STATE_ALARM || $state == STATE_ALERT )
|
||||
{
|
||||
if ( $state == STATE_ALARM || $state == STATE_ALERT ) {
|
||||
return( $last_event );
|
||||
}
|
||||
elsif( $last_event != $last_event_id )
|
||||
{
|
||||
} elsif( $last_event != $last_event_id ) {
|
||||
return( $last_event );
|
||||
}
|
||||
return( undef );
|
||||
}
|
||||
|
||||
sub zmGetLastEvent
|
||||
{
|
||||
sub zmGetLastEvent {
|
||||
my $monitor = shift;
|
||||
|
||||
return( zmMemRead( $monitor, "shared_data:last_event" ) );
|
||||
}
|
||||
|
||||
sub zmGetLastWriteTime
|
||||
{
|
||||
sub zmGetLastWriteTime {
|
||||
my $monitor = shift;
|
||||
|
||||
return( zmMemRead( $monitor, "shared_data:last_write_time" ) );
|
||||
}
|
||||
|
||||
sub zmGetLastReadTime
|
||||
{
|
||||
sub zmGetLastReadTime {
|
||||
my $monitor = shift;
|
||||
|
||||
return( zmMemRead( $monitor, "shared_data:last_read_time" ) );
|
||||
}
|
||||
|
||||
sub zmGetMonitorActions
|
||||
{
|
||||
sub zmGetMonitorActions {
|
||||
my $monitor = shift;
|
||||
|
||||
return( zmMemRead( $monitor, "shared_data:action" ) );
|
||||
}
|
||||
|
||||
sub zmMonitorEnable
|
||||
{
|
||||
sub zmMonitorEnable {
|
||||
my $monitor = shift;
|
||||
|
||||
my $action = zmMemRead( $monitor, "shared_data:action" );
|
||||
|
@ -651,8 +539,7 @@ sub zmMonitorEnable
|
|||
zmMemWrite( $monitor, { "shared_data:action" => $action } );
|
||||
}
|
||||
|
||||
sub zmMonitorDisable
|
||||
{
|
||||
sub zmMonitorDisable {
|
||||
my $monitor = shift;
|
||||
|
||||
my $action = zmMemRead( $monitor, "shared_data:action" );
|
||||
|
@ -660,8 +547,7 @@ sub zmMonitorDisable
|
|||
zmMemWrite( $monitor, { "shared_data:action" => $action } );
|
||||
}
|
||||
|
||||
sub zmMonitorSuspend
|
||||
{
|
||||
sub zmMonitorSuspend {
|
||||
my $monitor = shift;
|
||||
|
||||
my $action = zmMemRead( $monitor, "shared_data:action" );
|
||||
|
@ -669,8 +555,7 @@ sub zmMonitorSuspend
|
|||
zmMemWrite( $monitor, { "shared_data:action" => $action } );
|
||||
}
|
||||
|
||||
sub zmMonitorResume
|
||||
{
|
||||
sub zmMonitorResume {
|
||||
my $monitor = shift;
|
||||
|
||||
my $action = zmMemRead( $monitor, "shared_data:action" );
|
||||
|
@ -678,15 +563,13 @@ sub zmMonitorResume
|
|||
zmMemWrite( $monitor, { "shared_data:action" => $action } );
|
||||
}
|
||||
|
||||
sub zmGetTriggerState
|
||||
{
|
||||
sub zmGetTriggerState {
|
||||
my $monitor = shift;
|
||||
|
||||
return( zmMemRead( $monitor, "trigger_data:trigger_state" ) );
|
||||
}
|
||||
|
||||
sub zmTriggerEventOn
|
||||
{
|
||||
sub zmTriggerEventOn {
|
||||
my $monitor = shift;
|
||||
my $score = shift;
|
||||
my $cause = shift;
|
||||
|
@ -704,8 +587,7 @@ sub zmTriggerEventOn
|
|||
zmMemWrite( $monitor, $values );
|
||||
}
|
||||
|
||||
sub zmTriggerEventOff
|
||||
{
|
||||
sub zmTriggerEventOff {
|
||||
my $monitor = shift;
|
||||
|
||||
my $values = {
|
||||
|
@ -719,8 +601,7 @@ sub zmTriggerEventOff
|
|||
zmMemWrite( $monitor, $values );
|
||||
}
|
||||
|
||||
sub zmTriggerEventCancel
|
||||
{
|
||||
sub zmTriggerEventCancel {
|
||||
my $monitor = shift;
|
||||
|
||||
my $values = {
|
||||
|
@ -734,8 +615,7 @@ sub zmTriggerEventCancel
|
|||
zmMemWrite( $monitor, $values );
|
||||
}
|
||||
|
||||
sub zmTriggerShowtext
|
||||
{
|
||||
sub zmTriggerShowtext {
|
||||
my $monitor = shift;
|
||||
my $showtext = shift;
|
||||
|
||||
|
@ -758,11 +638,9 @@ ZoneMinder::MappedMem - ZoneMinder Mapped Memory access module
|
|||
use ZoneMinder::MappedMem;
|
||||
use ZoneMinder::MappedMem qw(:all);
|
||||
|
||||
if ( zmMemVerify( $monitor ) )
|
||||
{
|
||||
if ( zmMemVerify( $monitor ) ) {
|
||||
$state = zmGetMonitorState( $monitor );
|
||||
if ( $state == STATE_ALARM )
|
||||
{
|
||||
if ( $state == STATE_ALARM ) {
|
||||
...
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,6 +87,10 @@ while( 1 )
|
|||
{
|
||||
next if $monitor->{Function} eq 'None';
|
||||
my $restart = 0;
|
||||
# Prevent open handles building up if we have connect to shared memory
|
||||
# Many of our error checks below do a next without closing the mem handle.
|
||||
# zmMemInvalidate will just return of nothing is open, so we can just do this here.
|
||||
zmMemInvalidate( $monitor );
|
||||
if ( zmMemVerify( $monitor )
|
||||
&& zmMemRead( $monitor, "shared_data:valid" )
|
||||
)
|
||||
|
|
|
@ -3990,19 +3990,31 @@ void MonitorStream::runStream()
|
|||
const int max_swap_len_suffix = 15;
|
||||
|
||||
int swap_path_length = strlen(config.path_swap) + 1; // +1 for NULL terminator
|
||||
int subfolder1_length = snprintf(NULL, 0, "/zmswap-m%d", monitor->Id() ) + 1;
|
||||
int subfolder2_length = snprintf(NULL, 0, "/zmswap-q%06d", connkey ) + 1;
|
||||
int total_swap_path_length = swap_path_length + subfolder1_length + subfolder2_length;
|
||||
|
||||
if ( connkey && playback_buffer > 0 ) {
|
||||
|
||||
if ( swap_path_length + max_swap_len_suffix > PATH_MAX ) {
|
||||
Error( "Swap Path is too long. %d > %d ", swap_path_length+max_swap_len_suffix, PATH_MAX );
|
||||
if ( total_swap_path_length + max_swap_len_suffix > PATH_MAX ) {
|
||||
Error( "Swap Path is too long. %d > %d ", total_swap_path_length+max_swap_len_suffix, PATH_MAX );
|
||||
} else {
|
||||
swap_path = (char *)malloc( swap_path_length+max_swap_len_suffix );
|
||||
Debug( 3, "Checking swap image path %s", config.path_swap );
|
||||
swap_path = (char *)malloc( total_swap_path_length+max_swap_len_suffix );
|
||||
strncpy( swap_path, config.path_swap, swap_path_length );
|
||||
|
||||
Debug( 3, "Checking swap path folder: %s", swap_path );
|
||||
if ( checkSwapPath( swap_path, false ) ) {
|
||||
snprintf( &(swap_path[swap_path_length]), max_swap_len_suffix, "/zmswap-m%d", monitor->Id() );
|
||||
// Append the subfolder name /zmswap-m{monitor-id} to the end of swap_path
|
||||
int ndx = swap_path_length - 1; // Array index of the NULL terminator
|
||||
snprintf( &(swap_path[ndx]), subfolder1_length, "/zmswap-m%d", monitor->Id() );
|
||||
|
||||
Debug( 4, "Checking swap path subfolder: %s", swap_path );
|
||||
if ( checkSwapPath( swap_path, true ) ) {
|
||||
snprintf( &(swap_path[swap_path_length]), max_swap_len_suffix, "/zmswap-q%06d", connkey );
|
||||
// Append the subfolder name /zmswap-q{connection key} to the end of swap_path
|
||||
ndx = swap_path_length+subfolder1_length - 2; // Array index of the NULL terminator
|
||||
snprintf( &(swap_path[ndx]), subfolder2_length, "/zmswap-q%06d", connkey );
|
||||
|
||||
Debug( 4, "Checking swap path subfolder: %s", swap_path );
|
||||
if ( checkSwapPath( swap_path, true ) ) {
|
||||
buffered_playback = true;
|
||||
}
|
||||
|
@ -4204,9 +4216,6 @@ void MonitorStream::runStream()
|
|||
}
|
||||
if ( buffered_playback )
|
||||
{
|
||||
char swap_path[PATH_MAX] = "";
|
||||
|
||||
snprintf( swap_path, sizeof(swap_path), "%s/zmswap-m%d/zmswap-q%06d", config.path_swap, monitor->Id(), connkey );
|
||||
Debug( 1, "Cleaning swap files from %s", swap_path );
|
||||
struct stat stat_buf;
|
||||
if ( stat( swap_path, &stat_buf ) < 0 )
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
//
|
||||
|
||||
// ZoneMinder Dutch Translation by Alco (a.k. nightcrawler)
|
||||
// Updated by Bernardus Jansen (bajansen)
|
||||
|
||||
// Notes for Translators
|
||||
// 0. Get some credit, put your name in the line above (optional)
|
||||
|
@ -72,33 +73,33 @@
|
|||
// Simple String Replacements
|
||||
$SLANG = array(
|
||||
'24BitColour' => '24 bits kleuren',
|
||||
'32BitColour' => '32 bit colour', // Added - 2015-04-18
|
||||
'32BitColour' => '32 bits kleuren',
|
||||
'8BitGrey' => '8 bits grijstinten',
|
||||
'Action' => 'Actie',
|
||||
'Actual' => 'Aktueel',
|
||||
'Actual' => 'Origineel',
|
||||
'AddNewControl' => 'Nieuwe controle toevoegen',
|
||||
'AddNewMonitor' => 'Nieuwe monitor toevoegen',
|
||||
'AddNewUser' => 'Nieuwe gebruiker toevoegen',
|
||||
'AddNewZone' => 'Nieuw gebied toevoegen',
|
||||
'Alarm' => 'Alarm',
|
||||
'AlarmBrFrames' => 'Alarm<br/>Frames',
|
||||
'AlarmFrame' => 'Alarm Frame',
|
||||
'AlarmFrameCount' => 'Alarm Frame Aantal',
|
||||
'AlarmLimits' => 'Alarm Limieten',
|
||||
'AlarmBrFrames' => 'Alarm-<br/>frames',
|
||||
'AlarmFrame' => 'Alarmframe',
|
||||
'AlarmFrameCount' => 'Aantal alarmframes',
|
||||
'AlarmLimits' => 'Alarmlimieten',
|
||||
'AlarmMaximumFPS' => 'Alarm Maximum FPS',
|
||||
'AlarmPx' => 'Alarm Px',
|
||||
'AlarmRGBUnset' => 'U moet een RGB alarm kleur keizen',
|
||||
'AlarmRefImageBlendPct'=> 'Alarm Reference Image Blend %ge', // Added - 2015-04-18
|
||||
'Alert' => 'Waarschuwing',
|
||||
'AlarmRGBUnset' => 'U moet een RGB alarmkleur kiezen',
|
||||
'AlarmRefImageBlendPct'=> 'Alarm Reference Image Blend %ge',
|
||||
'Alert' => 'Alert',
|
||||
'All' => 'Alle',
|
||||
'AnalysisFPS' => 'Analysis FPS', // Added - 2015-07-22
|
||||
'AnalysisUpdateDelay' => 'Analysis Update Delay', // Added - 2015-07-23
|
||||
'Apply' => 'Voer uit',
|
||||
'ApplyingStateChange' => 'Status verandering aan het uitvoeren',
|
||||
'AnalysisFPS' => 'Analyse FPS',
|
||||
'AnalysisUpdateDelay' => 'Analyse Update Vertraging',
|
||||
'Apply' => 'Toepassen',
|
||||
'ApplyingStateChange' => 'Statusverandering wordt uitgevoerd',
|
||||
'ArchArchived' => 'Alleen gearchiveerd',
|
||||
'ArchUnarchived' => 'Alleen ongearchiveerd',
|
||||
'Archive' => 'Archief',
|
||||
'Archived' => 'Archived',
|
||||
'Archive' => 'Archiveren',
|
||||
'Archived' => 'Gearchiveerd',
|
||||
'Area' => 'Gebied',
|
||||
'AreaUnits' => 'Gebied (px/%)',
|
||||
'AttrAlarmFrames' => 'Alarmframes',
|
||||
|
@ -117,55 +118,55 @@ $SLANG = array(
|
|||
'AttrMonitorName' => 'Monitor Naam',
|
||||
'AttrName' => 'Naam',
|
||||
'AttrNotes' => 'Notities',
|
||||
'AttrSystemLoad' => 'System Belasting',
|
||||
'AttrSystemLoad' => 'Systembelasting',
|
||||
'AttrTime' => 'Tijd',
|
||||
'AttrTotalScore' => 'Totale Score',
|
||||
'AttrWeekday' => 'Weekdag',
|
||||
'Auto' => 'Auto',
|
||||
'AutoStopTimeout' => 'Auto Stop Timeout',
|
||||
'Available' => 'Beschikbaar', // Added - 2009-03-31
|
||||
'Available' => 'Beschikbaar',
|
||||
'AvgBrScore' => 'Gem.<br/>score',
|
||||
'Background' => 'Achtergrond',
|
||||
'BackgroundFilter' => 'Run filter in achtergrond',
|
||||
'BadAlarmFrameCount' => 'Alarm frame moet een getal zijn van 1 of meer',
|
||||
'BadAlarmMaxFPS' => 'Alarm Maximum FPS moet een positiev getal zijn of een floating point waarde',
|
||||
'BadAnalysisFPS' => 'Analysis FPS must be a positive integer or floating point value', // Added - 2015-07-22
|
||||
'BadAnalysisUpdateDelay'=> 'Analysis update delay must be set to an integer of zero or more', // Added - 2015-07-23
|
||||
'BackgroundFilter' => 'Voer filter uit op achtergrond',
|
||||
'BadAlarmFrameCount' => 'Aantal alarmframes moet een getal zijn van 1 of meer',
|
||||
'BadAlarmMaxFPS' => 'Alarm Maximum FPS moet een positieve waarde zijn',
|
||||
'BadAnalysisFPS' => 'Analyse FPS moet een positieve waarde zijn',
|
||||
'BadAnalysisUpdateDelay'=> 'Analyse updatevertraging moet een getal van nul of groter zijn',
|
||||
'BadChannel' => 'Kanaal moet een getal zijn van 1 of meer',
|
||||
'BadColours' => 'Target colour must be set to a valid value', // Added - 2015-04-18
|
||||
'BadDevice' => 'Apparaat moet een bestaande waarde krijgen',
|
||||
'BadFPSReportInterval' => 'FPS rapport interval buffer en aantal moet een nummer groter dan nul zijn',
|
||||
'BadFormat' => 'Formaat moet een nummer nul of groter zijn',
|
||||
'BadFrameSkip' => 'Frame skip aantal moet een nummer nul of groter zijn',
|
||||
'BadColours' => 'Doelkleur moet een geldige waarde zijn',
|
||||
'BadDevice' => 'Apparaat moet een geldige waarde zijn',
|
||||
'BadFPSReportInterval' => 'FPS rapport interval buffer aantal moet een getal groter dan nul zijn',
|
||||
'BadFormat' => 'Formaat moet een getal van nul of groter zijn',
|
||||
'BadFrameSkip' => 'Frame skip aantal moet een getal van nul of groter zijn',
|
||||
'BadHeight' => 'Hoogte moet een geldige waarde zijn',
|
||||
'BadHost' => 'Host moet een juiste address or hostname zijn, laat http:// weg ',
|
||||
'BadImageBufferCount' => 'Foto buffer groote moet een nummer 10 of groter zijn',
|
||||
'BadLabelX' => 'Label X co-ordinate moet een nummer nul of groter zijn',
|
||||
'BadLabelY' => 'Label Y co-ordinate moet een nummer nul of groter zijn',
|
||||
'BadMaxFPS' => 'Maximum FPS moet een positieve integer of floating point waarde zijn',
|
||||
'BadMotionFrameSkip' => 'Motion Frame skip count must be an integer of zero or more',
|
||||
'BadNameChars' => 'Namen mogen alleen alpha numerieke karakters, ruimten bevatten plus hyphens en underscores',
|
||||
'BadPalette' => 'Palette moet een geldige waarde zijn', // Added - 2009-03-31
|
||||
'BadHost' => 'Host moet een juist adres of hostname zijn, laat http:// weg',
|
||||
'BadImageBufferCount' => 'Buffergrootte moet een getal van 10 of groter zijn',
|
||||
'BadLabelX' => 'Label X-coördinaat moet een getal van nul of groter zijn',
|
||||
'BadLabelY' => 'Label Y-coördinaat moet een getal van nul of groter zijn',
|
||||
'BadMaxFPS' => 'Maximum FPS moet een positieve waarde zijn',
|
||||
'BadMotionFrameSkip' => 'Motion Frame skip count dient een getal van nul of groter te zijn',
|
||||
'BadNameChars' => 'Namen mogen alleen letters en cijfers bevatten plus spaties, streepjes, en liggende streepjes',
|
||||
'BadPalette' => 'Palet moet een geldige waarde zijn',
|
||||
'BadPath' => 'Pad moet een geldige waarde zijn',
|
||||
'BadPort' => 'Port moet een geldige nummer zijn',
|
||||
'BadPostEventCount' => 'Post gebeurtenis foto aantal moet een geldige waarde van nul of groter zijn',
|
||||
'BadPreEventCount' => 'Pre gebeurtenis aantal moe minimaal nul en lager dan de buffert grote',
|
||||
'BadPort' => 'Poort moet een geldige nummer zijn',
|
||||
'BadPostEventCount' => 'Aantal post-gebeurtenisframes moet een getal van nul of groter zijn',
|
||||
'BadPreEventCount' => 'Aantal pre-gebeurtenisframes moet een getal zijn van minimaal nul en minder dan de buffergrootte',
|
||||
'BadRefBlendPerc' => 'Reference blend percentage moet een geldige waarde van nul of groter zijn',
|
||||
'BadSectionLength' => 'Selectie lengte moet een integer van 30 of meer zijn',
|
||||
'BadSectionLength' => 'Sectielengte moet een getal van 30 of groter zijn',
|
||||
'BadSignalCheckColour' => 'Signaalcontrolekleur moet een geldige RGB waarde zijn',
|
||||
'BadStreamReplayBuffer'=> 'Stream replay buffer moet een geldige waarde van nul of groter zijn',
|
||||
'BadWarmupCount' => 'Warmop frames moet een geldige waarde van nul of groter zijn',
|
||||
'BadWebColour' => 'Web kleur moeten een geldige webkleurwaarde bevatten',
|
||||
'BadWidth' => 'Breedte moet ingevuld worden',
|
||||
'BadWarmupCount' => 'Opwarm frames moet een geldig getal van nul of groter zijn',
|
||||
'BadWebColour' => 'Webkleur moet een geldige webkleurwaarde bevatten',
|
||||
'BadWidth' => 'Breedte moet een geldige waarde zijn',
|
||||
'Bandwidth' => 'Bandbreedte',
|
||||
'BandwidthHead' => 'Bandwidth', // This is the end of the bandwidth status on the top of the console, different in many language due to phrasing
|
||||
'BandwidthHead' => 'bandbreedte', // This is the end of the bandwidth status on the top of the console, different in many language due to phrasing
|
||||
'BlobPx' => 'Blob px',
|
||||
'BlobSizes' => 'Blobgrootte',
|
||||
'Blobs' => 'Blobs',
|
||||
'Brightness' => 'Helderheid',
|
||||
'Buffer' => 'Buffer', // Added - 2015-04-18
|
||||
'Buffer' => 'Buffer',
|
||||
'Buffers' => 'Buffers',
|
||||
'CSSDescription' => 'Change the default css for this computer', // Added - 2015-04-18
|
||||
'CSSDescription' => 'Wijzig de standaard CSS voor deze computer',
|
||||
'CanAutoFocus' => 'Can Auto Focus',
|
||||
'CanAutoGain' => 'Can Auto Gain',
|
||||
'CanAutoIris' => 'Can Auto Iris',
|
||||
|
@ -204,61 +205,61 @@ $SLANG = array(
|
|||
'CanZoomAbs' => 'Can Zoom Absoluut',
|
||||
'CanZoomCon' => 'Can Zoom Continue',
|
||||
'CanZoomRel' => 'Can Zoom Relatief',
|
||||
'Cancel' => 'Afbreken',
|
||||
'CancelForcedAlarm' => 'Afbreken geforceerd alarm',
|
||||
'CaptureHeight' => 'Opname hoogte',
|
||||
'CaptureMethod' => 'Opname Methode', // Added - 2009-02-08
|
||||
'CapturePalette' => 'Opname pallet',
|
||||
'CaptureResolution' => 'Capture Resolution', // Added - 2015-04-18
|
||||
'CaptureWidth' => 'Opname breedte',
|
||||
'Cancel' => 'Annuleren',
|
||||
'CancelForcedAlarm' => 'Geforceerd alarm annuleren',
|
||||
'CaptureHeight' => 'Hoogte van opname',
|
||||
'CaptureMethod' => 'Opnamemethode',
|
||||
'CapturePalette' => 'Kleurpalet opname',
|
||||
'CaptureResolution' => 'Opnameresolutie',
|
||||
'CaptureWidth' => 'Breedte van opname',
|
||||
'Cause' => 'Oorzaak',
|
||||
'CheckMethod' => 'Alarm controle Methode',
|
||||
'ChooseDetectedCamera' => 'Kies gedetecteerde Camera', // Added - 2009-03-31
|
||||
'CheckMethod' => 'Alarmcontrolemethode',
|
||||
'ChooseDetectedCamera' => 'Kies gedetecteerde Camera',
|
||||
'ChooseFilter' => 'Kies filter',
|
||||
'ChooseLogFormat' => 'Kies en log formaat', // Added - 2011-06-17
|
||||
'ChooseLogSelection' => 'Kies een log selectie', // Added - 2011-06-17
|
||||
'ChooseLogFormat' => 'Kies een logformaat',
|
||||
'ChooseLogSelection' => 'Kies een logselectie',
|
||||
'ChoosePreset' => 'Kies voorkeur',
|
||||
'Clear' => 'Leeg', // Added - 2011-06-16
|
||||
'Close' => 'Sluit',
|
||||
'Clear' => 'Legen',
|
||||
'Close' => 'Sluiten',
|
||||
'Colour' => 'Kleur',
|
||||
'Command' => 'Commando',
|
||||
'Component' => 'Component', // Added - 2011-06-16
|
||||
'Component' => 'Component',
|
||||
'Config' => 'Configuratie',
|
||||
'ConfiguredFor' => 'Geconfigureerd voor',
|
||||
'ConfirmDeleteEvents' => 'Weet uw zeker dat uw deze gebeurtenissen wil verwijderen?',
|
||||
'ConfirmDeleteEvents' => 'Weet u zeker dat u deze gebeurtenissen wilt verwijderen?',
|
||||
'ConfirmPassword' => 'Bevestig wachtwoord',
|
||||
'ConjAnd' => 'en',
|
||||
'ConjOr' => 'of',
|
||||
'Console' => 'Console',
|
||||
'ContactAdmin' => 'Neem A.U.B. contact op met uw beheerder voor details.',
|
||||
'Continue' => 'Continue',
|
||||
'ContactAdmin' => 'Neem a.u.b. contact op met uw beheerder voor details.',
|
||||
'Continue' => 'Doorgaan',
|
||||
'Contrast' => 'Contrast',
|
||||
'Control' => 'Bestuur',
|
||||
'ControlAddress' => 'Bestuuradres',
|
||||
'ControlCap' => 'Bestuurmogelijkheid',
|
||||
'ControlCaps' => 'Bestuurmogelijkheden',
|
||||
'ControlDevice' => 'Bestuurapparaat',
|
||||
'ControlType' => 'Bestuur Type',
|
||||
'ControlType' => 'Bestuurtype',
|
||||
'Controllable' => 'Bestuurbaar',
|
||||
'Current' => 'Current', // Added - 2015-04-18
|
||||
'Current' => 'Huidig',
|
||||
'Cycle' => 'Cyclus',
|
||||
'CycleWatch' => 'Observeer cyclus',
|
||||
'DateTime' => 'Datum/Tijd', // Added - 2011-06-16
|
||||
'DateTime' => 'Datum/Tijd',
|
||||
'Day' => 'Dag',
|
||||
'Debug' => 'Debug',
|
||||
'DefaultRate' => 'Standaard Radius',
|
||||
'DefaultScale' => 'Standaard Schaal',
|
||||
'DefaultView' => 'Standaard scherm',
|
||||
'Deinterlacing' => 'Deinterlacing', // Added - 2015-04-18
|
||||
'Delay' => 'Delay', // Added - 2015-04-18
|
||||
'Delete' => 'verwijder',
|
||||
'Delay' => 'Vertraging',
|
||||
'Delete' => 'Verwijder',
|
||||
'DeleteAndNext' => 'verwijder & volgende',
|
||||
'DeleteAndPrev' => 'verwijder & vorige',
|
||||
'DeleteSavedFilter' => 'verwijder opgeslagen filter',
|
||||
'Description' => 'Omschrijving',
|
||||
'DetectedCameras' => 'Gedetecteerde Cameras', // Added - 2009-03-31
|
||||
'DetectedProfiles' => 'Detected Profiles', // Added - 2015-04-18
|
||||
'Device' => 'Apparaat', // Added - 2009-02-08
|
||||
'DetectedCameras' => 'Gedetecteerde camera\'s',
|
||||
'DetectedProfiles' => 'Gedetecteerde profielen',
|
||||
'Device' => 'Apparaat',
|
||||
'DeviceChannel' => 'Apparaatkanaal',
|
||||
'DeviceFormat' => 'Apparaatformaat',
|
||||
'DeviceNumber' => 'Apparaatnummer',
|
||||
|
@ -267,75 +268,75 @@ $SLANG = array(
|
|||
'Dimensions' => 'Afmetingen',
|
||||
'DisableAlarms' => 'Alarmen uitschakelen',
|
||||
'Disk' => 'Schijf',
|
||||
'Display' => 'Weergave', // Added - 2011-01-30
|
||||
'Displaying' => 'Weergaven', // Added - 2011-06-16
|
||||
'Display' => 'Weergave',
|
||||
'Displaying' => 'Weergaven',
|
||||
'DoNativeMotionDetection'=> 'Do Native Motion Detection', // Added - 2015-04-18
|
||||
'Donate' => 'A.U.B geef ons een donatie',
|
||||
'Donate' => 'Geef a.u.b. een donatie',
|
||||
'DonateAlready' => 'Nee, ik heb al gedoneerd',
|
||||
'DonateEnticement' => 'U gebruikt Zoneminder nu voor een geruime tijd, hopelijk vindt je het een nuttige toevoeging voor u huis of werkplek beveiliging. Natuurlijk is en blijft Zoneminder gratis en open source software. Maar het kost geld om te ontwikkelen en support te onderhouden. Ik vraag u dan ook om er over na te denken om een donatie te doen om zo de ontwikkeling en support te ondersteunen. Natuurlijk bent u hier vrij in, en elke donatie hoe klein dan ook wordt erg gewaardeerd. <br><br> Als u wilt donderen geef dat hier onder dan aan of ga naar http://www.zoneminder.com/dontate.html in uw browser.<br><br>Bedankt voor het gebruiken van Zoneminder en vergeet niet om ons forum op ZoneMinder.com te bezoeken voor ondersteuning of suggesties waarmee u ZoneMinder beleving nog beter wordt.',
|
||||
'DonateEnticement' => 'U gebruikt ZoneMinder nu voor een geruime tijd, hopelijk vindt u het een nuttige toevoeging voor uw huis- of werkplekbeveiliging. Natuurlijk is en blijft ZoneMinder gratis en open source software, maar het kost geld om te ontwikkelen, ondersteunen, en te onderhouden. Wij vragen u dan ook om er over na te denken een donatie te doen om zo de ontwikkeling van ZoneMinder te ondersteunen. Natuurlijk bent u hier vrij in, en elke donatie hoe klein dan ook wordt erg gewaardeerd. <br><br> Als u wilt doneren geef dat hieronder dan aan of ga naar http://www.zoneminder.com/donate.html in uw browser.<br><br>Bedankt voor het gebruiken van ZoneMinder en vergeet niet om ons forum op ZoneMinder.com te bezoeken voor ondersteuning of suggesties waarmee uw ZoneMinder beleving nog beter wordt.',
|
||||
'DonateRemindDay' => 'Nu niet, herinner mij over 1 dag hieraan',
|
||||
'DonateRemindHour' => 'Nu niet, herinner mij over een uur hieraan',
|
||||
'DonateRemindMonth' => 'Nu niet, herinner mij over een maand hieraan',
|
||||
'DonateRemindNever' => 'Nee, ik hiervoor wil niet doneren',
|
||||
'DonateRemindNever' => 'Nee, ik wil niet doneren',
|
||||
'DonateRemindWeek' => 'Nu niet, herinner mij over een week hieraan',
|
||||
'DonateYes' => 'Ja, ik wil nu doneren',
|
||||
'Download' => 'Download',
|
||||
'DuplicateMonitorName' => 'Duplicaat Monitor Naam', // Added - 2009-03-31
|
||||
'Download' => 'Downloaden',
|
||||
'DuplicateMonitorName' => 'Kopieer monitornaam',
|
||||
'Duration' => 'Duur',
|
||||
'Edit' => 'Bewerk',
|
||||
'Edit' => 'Bewerken',
|
||||
'Email' => 'Email',
|
||||
'EnableAlarms' => 'Enable Alarms',
|
||||
'EnableAlarms' => 'Alarmen inschakelen',
|
||||
'Enabled' => 'Ingeschakeld',
|
||||
'EnterNewFilterName' => 'Voer nieuwe filternaam in',
|
||||
'Error' => 'Fout',
|
||||
'ErrorBrackets' => 'Fout, controleer of je even veel openings als afsluiting brackets hebt gebruikt',
|
||||
'ErrorBrackets' => 'Fout, controleer of je evenveel openings- als afsluitingsbrackets hebt gebruikt',
|
||||
'ErrorValidValue' => 'Fout, Controleer of alle termen een geldige waarde hebben',
|
||||
'Etc' => 'etc',
|
||||
'Event' => 'Gebeurtenis',
|
||||
'EventFilter' => 'Gebeurtenisfilter',
|
||||
'EventId' => 'Gebeurtenis Id',
|
||||
'EventName' => 'Gebeurtenis Name',
|
||||
'EventPrefix' => 'Gebeurtenis Prefix',
|
||||
'EventName' => 'Gebeurtenisnaam',
|
||||
'EventPrefix' => 'Gebeurtenisprefix',
|
||||
'Events' => 'Gebeurtenissen',
|
||||
'Exclude' => 'Sluit uit',
|
||||
'Execute' => 'Execute',
|
||||
'Export' => 'Exporteer',
|
||||
'ExportDetails' => 'Exporteer Gebeurtenis Details',
|
||||
'ExportFailed' => 'Exporteer gefaald',
|
||||
'ExportFormat' => 'Exporteer File Formaat',
|
||||
'Exclude' => 'Uitsluiten',
|
||||
'Execute' => 'Uitvoeren',
|
||||
'Export' => 'Exporteren',
|
||||
'ExportDetails' => 'Exporteer gebeurtenisdetails',
|
||||
'ExportFailed' => 'Exporteren mislukt',
|
||||
'ExportFormat' => 'Formaat exporteerbestand',
|
||||
'ExportFormatTar' => 'Tar',
|
||||
'ExportFormatZip' => 'Zip',
|
||||
'ExportFrames' => 'Exporteer Frame Details',
|
||||
'ExportFrames' => 'Exporteer framedetails',
|
||||
'ExportImageFiles' => 'Exporteer fotobestanden',
|
||||
'ExportLog' => 'Exporteer Log', // Added - 2011-06-17
|
||||
'ExportLog' => 'Exporteer log',
|
||||
'ExportMiscFiles' => 'Exporteer andere bestanden (wanneer aanwezig)',
|
||||
'ExportOptions' => 'Exporteer Opties',
|
||||
'ExportSucceeded' => 'Exporteren geslaagd', // Added - 2009-02-08
|
||||
'ExportVideoFiles' => 'Exporteer Video bestanden (wanneer aanwezig)',
|
||||
'Exporting' => 'Exporteerd',
|
||||
'ExportOptions' => 'Exporteeropties',
|
||||
'ExportSucceeded' => 'Exporteren geslaagd',
|
||||
'ExportVideoFiles' => 'Exporteer videobestanden (wanneer aanwezig)',
|
||||
'Exporting' => 'Exporteren',
|
||||
'FPS' => 'fps',
|
||||
'FPSReportInterval' => 'FPS rapportage interval',
|
||||
'FTP' => 'FTP',
|
||||
'Far' => 'Far',
|
||||
'FastForward' => 'Snel vooruit',
|
||||
'Far' => 'Ver',
|
||||
'FastForward' => 'Doorspoelen',
|
||||
'Feed' => 'toevoer',
|
||||
'Ffmpeg' => 'Ffmpeg', // Added - 2009-02-08
|
||||
'Ffmpeg' => 'Ffmpeg',
|
||||
'File' => 'Bestand',
|
||||
'Filter' => 'Filter', // Added - 2015-04-18
|
||||
'Filter' => 'Filter',
|
||||
'FilterArchiveEvents' => 'Archiveer alle overeenkomsten',
|
||||
'FilterDeleteEvents' => 'Verwijder alle overeenkomsten',
|
||||
'FilterEmailEvents' => 'Email de details van alle overeenkomsten',
|
||||
'FilterExecuteEvents' => 'Voer opdrachten op alle overeenkomsten uit',
|
||||
'FilterLog' => 'Filter log', // Added - 2015-04-18
|
||||
'FilterExecuteEvents' => 'Voer opdrachten uit op alle overeenkomsten',
|
||||
'FilterLog' => 'Filterlog',
|
||||
'FilterMessageEvents' => 'Bericht de details van alle overeenkomsten',
|
||||
'FilterPx' => 'Filter px',
|
||||
'FilterUnset' => 'Je moet de filter hoogte en breedte opgeven',
|
||||
'FilterUnset' => 'Je moet de filterhoogte en -breedte opgeven',
|
||||
'FilterUploadEvents' => 'Verstuur alle overeenkomsten',
|
||||
'FilterVideoEvents' => 'Maak video voor alle matches',
|
||||
'FilterVideoEvents' => 'Maak video voor alle overeenkomsten',
|
||||
'Filters' => 'Filters',
|
||||
'First' => 'Eerste',
|
||||
'FlippedHori' => 'Horizontaal gedraait',
|
||||
'FlippedVert' => 'Vertikaal gedraait',
|
||||
'FlippedHori' => 'Horizontaal gedraaid',
|
||||
'FlippedVert' => 'Verticaal gedraaid',
|
||||
'FnMocord' => 'Mocord', // Added 2013.08.16.
|
||||
'FnModect' => 'Modect', // Added 2013.08.16.
|
||||
'FnMonitor' => 'Monitor', // Added 2013.08.16.
|
||||
|
@ -343,7 +344,7 @@ $SLANG = array(
|
|||
'FnNone' => 'None', // Added 2013.08.16.
|
||||
'FnRecord' => 'Record', // Added 2013.08.16.
|
||||
'Focus' => 'Focus',
|
||||
'ForceAlarm' => 'Forceeer alarm',
|
||||
'ForceAlarm' => 'Forceer alarm',
|
||||
'Format' => 'Formaat',
|
||||
'Frame' => 'Frame',
|
||||
'FrameId' => 'Frame id',
|
||||
|
@ -353,9 +354,9 @@ $SLANG = array(
|
|||
'Func' => 'Func',
|
||||
'Function' => 'Functie',
|
||||
'Gain' => 'Gain',
|
||||
'General' => 'Generiek',
|
||||
'General' => 'Algemeen',
|
||||
'GenerateVideo' => 'Genereer Video',
|
||||
'GeneratingVideo' => 'Genereren Video',
|
||||
'GeneratingVideo' => 'Video wordt gegenereerd',
|
||||
'GoToZoneMinder' => 'Ga naar ZoneMinder.com',
|
||||
'Grey' => 'Grijs',
|
||||
'Group' => 'Groep',
|
||||
|
@ -366,53 +367,53 @@ $SLANG = array(
|
|||
'HasIrisSpeed' => 'Heeft Iris Snelheid',
|
||||
'HasPanSpeed' => 'Heeft Pan Snelheid',
|
||||
'HasPresets' => 'Heeft Voorkeuren',
|
||||
'HasTiltSpeed' => 'Heeft Tilt Snelheid',
|
||||
'HasTiltSpeed' => 'Heeft Tiltsnelheid',
|
||||
'HasTurboPan' => 'Heeft Turbo Pan',
|
||||
'HasTurboTilt' => 'Heeft Turbo Tilt',
|
||||
'HasWhiteSpeed' => 'Heeft White Bal. Snelheid',
|
||||
'HasZoomSpeed' => 'Heeft Zoom Snelheid',
|
||||
'HasZoomSpeed' => 'Heeft Zoomsnelheid',
|
||||
'High' => 'Hoog',
|
||||
'HighBW' => 'Hoog B/W',
|
||||
'Home' => 'Home',
|
||||
'Hour' => 'Uur',
|
||||
'Hue' => 'Hue',
|
||||
'Id' => 'Id',
|
||||
'Idle' => 'Ongebruikt',
|
||||
'Ignore' => 'Negeer',
|
||||
'Image' => 'Foto',
|
||||
'ImageBufferSize' => 'Foto buffer grootte (frames)',
|
||||
'Images' => 'Fotos',
|
||||
'Idle' => 'Inactief',
|
||||
'Ignore' => 'Negeren',
|
||||
'Image' => 'Beeld',
|
||||
'ImageBufferSize' => 'Beeldbuffergrootte (frames)',
|
||||
'Images' => 'Beelden',
|
||||
'In' => 'In',
|
||||
'Include' => 'voeg in',
|
||||
'Inverted' => 'Omgedraaid',
|
||||
'Inverted' => 'Geïnverteerd',
|
||||
'Iris' => 'Iris',
|
||||
'KeyString' => 'Sleutel waarde',
|
||||
'Label' => 'Label',
|
||||
'Language' => 'Taal',
|
||||
'Last' => 'Laatste',
|
||||
'Layout' => 'Layout', // Added - 2009-02-08
|
||||
'Level' => 'Nivo', // Added - 2011-06-16
|
||||
'Layout' => 'Layout',
|
||||
'Level' => 'Niveau',
|
||||
'Libvlc' => 'Libvlc',
|
||||
'LimitResultsPost' => 'resultaten;', // This is used at the end of the phrase 'Limit to first N results only'
|
||||
'LimitResultsPre' => 'beperk tot eerste', // This is used at the beginning of the phrase 'Limit to first N results only'
|
||||
'Line' => 'Lijn', // Added - 2011-06-16
|
||||
'Line' => 'Lijn',
|
||||
'LinkedMonitors' => 'Gekoppelde monitoren',
|
||||
'List' => 'Lijst',
|
||||
'Load' => 'Belasting',
|
||||
'Load' => 'Systeemlast',
|
||||
'Local' => 'Lokaal',
|
||||
'Log' => 'Log', // Added - 2011-06-16
|
||||
'Log' => 'Log',
|
||||
'LoggedInAs' => 'Aangemeld als',
|
||||
'Logging' => 'Logging', // Added - 2011-06-16
|
||||
'LoggingIn' => 'Aanmelden..',
|
||||
'Login' => 'Aanmelden',
|
||||
'Logout' => 'Afmelden',
|
||||
'Logs' => 'Logs', // Added - 2011-06-17
|
||||
'Logs' => 'Logs',
|
||||
'Low' => 'Laag',
|
||||
'LowBW' => 'Laag B/W',
|
||||
'Main' => 'Main',
|
||||
'Man' => 'Man',
|
||||
'Manual' => 'Handmatig',
|
||||
'Mark' => 'Markeer',
|
||||
'Mark' => 'Markeren',
|
||||
'Max' => 'Max',
|
||||
'MaxBandwidth' => 'Max Bandbreedte',
|
||||
'MaxBrScore' => 'Max.<br/>score',
|
||||
|
@ -438,19 +439,19 @@ $SLANG = array(
|
|||
'MaxZoomSpeed' => 'Max Zoom Snelheid',
|
||||
'MaxZoomStep' => 'Max Zoom Stap',
|
||||
'MaximumFPS' => 'Maximum FPS',
|
||||
'Medium' => 'Medium',
|
||||
'MediumBW' => 'Medium B/W',
|
||||
'Message' => 'Message', // Added - 2011-06-16
|
||||
'MinAlarmAreaLtMax' => 'Minimum alarm moet kleiner dan het maximum',
|
||||
'Medium' => 'Gemiddeld',
|
||||
'MediumBW' => 'Gemiddelde B/W',
|
||||
'Message' => 'Bericht',
|
||||
'MinAlarmAreaLtMax' => 'Minimum alarmgebied moet kleiner zijn dan het maximum',
|
||||
'MinAlarmAreaUnset' => 'Specificeer het minimaal aantal alarmpixels',
|
||||
'MinBlobAreaLtMax' => 'minimum blob gebied moet kleiner zijn dan maximum blob gebied',
|
||||
'MinBlobAreaLtMax' => 'Minimum blobgebied moet kleiner zijn dan maximum blobgebied',
|
||||
'MinBlobAreaUnset' => 'Specificeer het minimaal aantal blobpixels',
|
||||
'MinBlobLtMinFilter' => 'Minimum blob gebied moet kleiner of gelijk aan het minimale filter gebied zijn',
|
||||
'MinBlobsLtMax' => 'Minimum blobs moet kleiner zijn dan maximum blobs',
|
||||
'MinBlobsUnset' => 'Specificeer het minimaal blob aantal',
|
||||
'MinBlobLtMinFilter' => 'Minimum blobgebied moet kleiner of gelijk zijn aan het minimale filtergebied',
|
||||
'MinBlobsLtMax' => 'Minimum aantal blobs moet kleiner zijn dan maximum aantal blobs',
|
||||
'MinBlobsUnset' => 'Specificeer het minimaal aantal blobs',
|
||||
'MinFilterAreaLtMax' => 'Minimum filtergebied moet minder dan het maximum zijn',
|
||||
'MinFilterAreaUnset' => 'Specificeer het minimaal aantal filterpixels',
|
||||
'MinFilterLtMinAlarm' => 'Minimum filter gebied moet kleiner of gelijk aan het minimale alarm gebied zijn',
|
||||
'MinFilterLtMinAlarm' => 'Minimum filtergebied moet kleiner of gelijk zijn aan het minimale alarmgebied',
|
||||
'MinFocusRange' => 'Min Focus Bereik',
|
||||
'MinFocusSpeed' => 'Min Focus Snelheid',
|
||||
'MinFocusStep' => 'Min Focus Step',
|
||||
|
@ -474,46 +475,46 @@ $SLANG = array(
|
|||
'MinZoomRange' => 'Min Zoom Bereik',
|
||||
'MinZoomSpeed' => 'Min Zoom Snelheid',
|
||||
'MinZoomStep' => 'Min Zoom Step',
|
||||
'Misc' => 'Misc',
|
||||
'Mode' => 'Mode', // Added - 2015-04-18
|
||||
'Misc' => 'Etc.',
|
||||
'Mode' => 'Modus',
|
||||
'Monitor' => 'Monitor',
|
||||
'MonitorIds' => 'Monitor Ids',
|
||||
'MonitorPreset' => 'Monitor Preset',
|
||||
'MonitorPresetIntro' => 'Selecteer een preset uit de lijst.<br><br>let op dit overschrijft de reeds ingevoerde waarden voor deze monitor!<br><br>',
|
||||
'MonitorPresetIntro' => 'Selecteer een voorinstelling uit de lijst.<br><br>let op, dit overschrijft de reeds ingevoerde waarden voor deze monitor!<br><br>',
|
||||
'MonitorProbe' => 'Monitor Probe', // Added - 2009-03-31
|
||||
'MonitorProbeIntro' => 'Deze lijst toont gedeteerde analoge en netwerk cameras en of deze al ingebruik of beschikbaar zijn.<br/><br/>Selecteer de gewenste waarde uit de lijst hier beneden.<br/><br/>Let er op dat het mogelijk is dat niet alle cameras hier worden weer gegeven, en dat alle ingevoerde waarden voor de huidige monitor worden overschreven.<br/><br/>', // Added - 2009-03-31
|
||||
'MonitorProbeIntro' => 'Deze lijst toont gedeteerde analoge en netwerk cameras en of deze al in gebruik of beschikbaar zijn.<br/><br/>Selecteer de gewenste waarde uit de lijst hieronder.<br/><br/>Let op dat mogelijk niet alle cameras hier worden weergegeven en dat alle ingevoerde waarden voor de huidige monitor zullen worden overschreven.<br/><br/>',
|
||||
'Monitors' => 'Monitoren',
|
||||
'Montage' => 'Montage',
|
||||
'Month' => 'Maand',
|
||||
'More' => 'Meer', // Added - 2011-06-16
|
||||
'More' => 'Meer',
|
||||
'MotionFrameSkip' => 'Motion Frame Skip',
|
||||
'Move' => 'Verplaats',
|
||||
'Mtg2widgrd' => '2-wide grid', // Added 2013.08.15.
|
||||
'Mtg3widgrd' => '3-wide grid', // Added 2013.08.15.
|
||||
'Mtg3widgrx' => '3-wide grid, scaled, enlarge on alarm', // Added 2013.08.15.
|
||||
'Mtg4widgrd' => '4-wide grid', // Added 2013.08.15.
|
||||
'MtgDefault' => 'Default', // Added 2013.08.15.
|
||||
'MtgDefault' => 'Standaard', // Added 2013.08.15.
|
||||
'MustBeGe' => 'Moet groter zijn of gelijk aan',
|
||||
'MustBeLe' => 'Moet kleiner zijn of gelijk aan',
|
||||
'MustConfirmPassword' => 'Je moet je wachtwoord bevestigen',
|
||||
'MustSupplyPassword' => 'Je moet een wachtwoord geven',
|
||||
'MustSupplyUsername' => 'Je moet een gebruikersnaam geven',
|
||||
'MustConfirmPassword' => 'Bevestig uw wachtwoord',
|
||||
'MustSupplyPassword' => 'Geef een wachtwoord op',
|
||||
'MustSupplyUsername' => 'Geef een gebruikersnaam op',
|
||||
'Name' => 'Naam',
|
||||
'Near' => 'Dichtbij',
|
||||
'Network' => 'Netwerk',
|
||||
'New' => 'Nieuw',
|
||||
'NewGroup' => 'Niew Groep',
|
||||
'NewLabel' => 'Niew Label',
|
||||
'NewGroup' => 'Nieuwe groep',
|
||||
'NewLabel' => 'Nieuw label',
|
||||
'NewPassword' => 'Nieuw wachtwoord',
|
||||
'NewState' => 'Nieuwe status',
|
||||
'NewUser' => 'Nieuwe gebruiker',
|
||||
'Next' => 'Volgende',
|
||||
'No' => 'Nee',
|
||||
'NoDetectedCameras' => 'Geen cameras gedeteceerd', // Added - 2009-03-31
|
||||
'NoFramesRecorded' => 'Er zijn geen frames opgenomen voor deze gebeurtenis',
|
||||
'NoGroup' => 'Geeb Groep',
|
||||
'NoDetectedCameras' => 'Geen cameras gedetecteerd',
|
||||
'NoFramesRecorded' => 'Er zijn geen beelden opgenomen voor deze gebeurtenis',
|
||||
'NoGroup' => 'Geen Groep',
|
||||
'NoSavedFilters' => 'Geen Opgeslagen Filters',
|
||||
'NoStatisticsRecorded' => 'Er zijn geen statistieken opgenomen voor deze gebeurenis',
|
||||
'NoStatisticsRecorded' => 'Er zijn geen statistieken opgenomen voor deze gebeurtenis',
|
||||
'None' => 'Geen',
|
||||
'NoneAvailable' => 'Geen beschikbaar',
|
||||
'Normal' => 'Normaal',
|
||||
|
@ -521,25 +522,25 @@ $SLANG = array(
|
|||
'NumPresets' => 'Num Voorkeuren',
|
||||
'Off' => 'Uit',
|
||||
'On' => 'Aan',
|
||||
'OnvifCredentialsIntro'=> 'Please supply user name and password for the selected camera.<br/>If no user has been created for the camera then the user given here will be created with the given password.<br/><br/>', // Added - 2015-04-18
|
||||
'OnvifProbe' => 'ONVIF', // Added - 2015-04-18
|
||||
'OnvifProbeIntro' => 'The list below shows detected ONVIF cameras and whether they are already being used or available for selection.<br/><br/>Select the desired entry from the list below.<br/><br/>Please note that not all cameras may be detected and that choosing a camera here may overwrite any values you already have configured for the current monitor.<br/><br/>', // Added - 2015-04-18
|
||||
'OnvifCredentialsIntro'=> 'Geef een gebruikersnaam en wachtwoord op voor de geselecteerde camera.<br/>Als er geen gebruiker bestaat vor de camera zal de hier opgegeven gebruiker met het aangegeven wachtwoord worden aangemaakt.<br/><br/>',
|
||||
'OnvifProbe' => 'ONVIF',
|
||||
'OnvifProbeIntro' => 'De lijst hieronder geeft gedetecteerde ONVIF camera\'s aan en of deze al worden gebruikt of beschikbaar zijn.<br/><br/>Selecteer de gewenste camera uit de lijst.<br/><br/>Let op dat het kan zijn dat niet alle camera\'s zijn gedetecteerd en dat het kiezen van een camera alle reeds ingestelde waarden voor de huidige monitor zal overschrijven.<br/><br/>',
|
||||
'OpEq' => 'gelijk aan',
|
||||
'OpGt' => 'groter dan',
|
||||
'OpGtEq' => 'groter dan of gelijk aan',
|
||||
'OpIn' => 'in set',
|
||||
'OpLt' => 'kleiner dan',
|
||||
'OpLtEq' => 'kleiner dan of gelijk aan',
|
||||
'OpMatches' => 'Komt overeen',
|
||||
'OpMatches' => 'Komt overeen met',
|
||||
'OpNe' => 'niet gelijk aan',
|
||||
'OpNotIn' => 'niet in set',
|
||||
'OpNotMatches' => 'Komt niet overeen',
|
||||
'OpNotMatches' => 'Komt niet overeen met',
|
||||
'Open' => 'Open',
|
||||
'OptionHelp' => 'OptieHelp',
|
||||
'OptionRestartWarning' => 'Deze veranderingen passen niet aan\nals het systeem loopt. Als je\nKlaar bent met veranderen vergeet dan niet dat\nje ZoneMinder herstart.',
|
||||
'OptionRestartWarning' => 'Deze veranderingen worden niet\ndoorgevoerd als het systeem loopt.\nVergeet niet ZoneMinder te herstarten\nwanneer u klaar bent.',
|
||||
'Options' => 'Opties',
|
||||
'OrEnterNewName' => 'of voer een nieuwe naam in',
|
||||
'Order' => 'Sorteer',
|
||||
'Order' => 'Sorteren',
|
||||
'Orientation' => 'Orientatie',
|
||||
'Out' => 'Uit',
|
||||
'OverwriteExisting' => 'Overschrijf bestaande',
|
||||
|
@ -555,30 +556,30 @@ $SLANG = array(
|
|||
'Pause' => 'Pause',
|
||||
'Phone' => 'Telefoon',
|
||||
'PhoneBW' => 'Telefoon B/W',
|
||||
'Pid' => 'PID', // Added - 2011-06-16
|
||||
'Pid' => 'PID',
|
||||
'PixelDiff' => 'Pixel Diff',
|
||||
'Pixels' => 'pixels',
|
||||
'Play' => 'Speel',
|
||||
'PlayAll' => 'Speel Alles',
|
||||
'PleaseWait' => 'Wacht A.U.B.',
|
||||
'Plugins' => 'Plugins', // Added - 2015-04-18
|
||||
'Play' => 'Afspelen',
|
||||
'PlayAll' => 'Alles afspelen',
|
||||
'PleaseWait' => 'Wacht a.u.b.',
|
||||
'Plugins' => 'Plugins',
|
||||
'Point' => 'Punt',
|
||||
'PostEventImageBuffer' => 'Post gebeurtenis foto Buffer',
|
||||
'PreEventImageBuffer' => 'Pre gebeurtenis foto Buffer',
|
||||
'PreserveAspect' => 'Beeld verhouding bewaren',
|
||||
'PostEventImageBuffer' => 'Post-gebeurtenis framebuffer',
|
||||
'PreEventImageBuffer' => 'Pre-gebeurtenis framebuffer',
|
||||
'PreserveAspect' => 'Beeldverhouding behouden',
|
||||
'Preset' => 'Voorkeur',
|
||||
'Presets' => 'Voorkeuren',
|
||||
'Prev' => 'Vorige',
|
||||
'Probe' => 'Scan', // Added - 2009-03-31
|
||||
'ProfileProbe' => 'Stream Probe', // Added - 2015-04-18
|
||||
'ProfileProbeIntro' => 'The list below shows the existing stream profiles of the selected camera .<br/><br/>Select the desired entry from the list below.<br/><br/>Please note that ZoneMinder cannot configure additional profiles and that choosing a camera here may overwrite any values you already have configured for the current monitor.<br/><br/>', // Added - 2015-04-18
|
||||
'Progress' => 'Progress', // Added - 2015-04-18
|
||||
'Progress' => 'Voortgang',
|
||||
'Protocol' => 'Protocol',
|
||||
'Rate' => 'Waardering',
|
||||
'Rate' => 'Snelheid',
|
||||
'Real' => 'Echte',
|
||||
'Record' => 'Record',
|
||||
'RefImageBlendPct' => 'Referentie foto Blend %ge',
|
||||
'Refresh' => 'Ververs',
|
||||
'RefImageBlendPct' => 'Referentie beeld blend percentage',
|
||||
'Refresh' => 'Verversen',
|
||||
'Remote' => 'Remote',
|
||||
'RemoteHostName' => 'Remote Host Naam',
|
||||
'RemoteHostPath' => 'Remote Host Pad',
|
||||
|
@ -592,55 +593,55 @@ $SLANG = array(
|
|||
'ReplayAll' => 'Alle Gebeurtenissen',
|
||||
'ReplayGapless' => 'Opvolgende Gebeurtenissen',
|
||||
'ReplaySingle' => 'Enkele Gebeurtenis',
|
||||
'Reset' => 'Herstel',
|
||||
'ResetEventCounts' => 'Herstel gebeurtenis teller',
|
||||
'Reset' => 'Resetten',
|
||||
'ResetEventCounts' => 'Gebeurtenisteller resetten',
|
||||
'Restart' => 'Herstart',
|
||||
'Restarting' => 'Herstarten',
|
||||
'RestrictedCameraIds' => 'Verboden Camera Ids',
|
||||
'RestrictedMonitors' => 'Beperkte Monitoren',
|
||||
'ReturnDelay' => 'Return Delay',
|
||||
'ReturnLocation' => 'Return Locatie',
|
||||
'Rewind' => 'Rewind',
|
||||
'Rewind' => 'Terugspoelen',
|
||||
'RotateLeft' => 'Draai linksom',
|
||||
'RotateRight' => 'Draai rechtsom',
|
||||
'RunLocalUpdate' => 'Gebruik zmupdate.pl om up te daten', // Added - 2011-05-25
|
||||
'RunMode' => 'Draai Modus',
|
||||
'RunState' => 'Draai Status',
|
||||
'RunLocalUpdate' => 'Gebruik zmupdate.pl om bij te werken',
|
||||
'RunMode' => 'Uitvoermodus',
|
||||
'RunState' => 'Uitvoerstatus',
|
||||
'Running' => 'Werkend',
|
||||
'Save' => 'Opslaan',
|
||||
'SaveAs' => 'Opslaan als',
|
||||
'SaveFilter' => 'Opslaan Filter',
|
||||
'SaveFilter' => 'Filter opslaan',
|
||||
'Scale' => 'Schaal',
|
||||
'Score' => 'Score',
|
||||
'Secs' => 'Secs',
|
||||
'Secs' => 'Sec.',
|
||||
'Sectionlength' => 'Sectielengte',
|
||||
'Select' => 'Selecteer',
|
||||
'SelectFormat' => 'Selecteer Formaat', // Added - 2011-06-17
|
||||
'SelectLog' => 'Selecteer Log', // Added - 2011-06-17
|
||||
'SelectFormat' => 'Selecteer Formaat',
|
||||
'SelectLog' => 'Selecteer Log',
|
||||
'SelectMonitors' => 'Selecteer Monitoren',
|
||||
'SelfIntersecting' => 'Polygonranden moeten niet overlappen',
|
||||
'Set' => 'Zet',
|
||||
'SetNewBandwidth' => 'Zet Nieuwe Bandbreedte',
|
||||
'SetPreset' => 'Zet Preset',
|
||||
'Set' => 'Instellen',
|
||||
'SetNewBandwidth' => 'Nieuwe Bandbreedte instellen',
|
||||
'SetPreset' => 'Voorkeur instellen',
|
||||
'Settings' => 'Instellingen',
|
||||
'ShowFilterWindow' => 'Toon Filter Venster',
|
||||
'ShowTimeline' => 'Toon Tijdslijn',
|
||||
'ShowFilterWindow' => 'Toon Filtervenster',
|
||||
'ShowTimeline' => 'Toon Tijdlijn',
|
||||
'SignalCheckColour' => 'Signaalcontrolekleur',
|
||||
'Size' => 'Groote',
|
||||
'SkinDescription' => 'Wijzig standaard uiterlijk voor deze computer', // Added - 2011-01-30
|
||||
'SkinDescription' => 'Wijzig standaarduiterlijk voor deze computer',
|
||||
'Sleep' => 'Slaap',
|
||||
'SortAsc' => 'Opl.',
|
||||
'SortBy' => 'Sorteer op',
|
||||
'SortDesc' => 'Afl.',
|
||||
'Source' => 'Bron',
|
||||
'SourceColours' => 'Bron Colours', // Added - 2009-02-08
|
||||
'SourcePath' => 'Bron Path', // Added - 2009-02-08
|
||||
'SourceType' => 'Bron Type',
|
||||
'SourceColours' => 'Bronkleuren',
|
||||
'SourcePath' => 'Bronpad',
|
||||
'SourceType' => 'Brontype',
|
||||
'Speed' => 'Snelheid',
|
||||
'SpeedHigh' => 'Hoge Snelheid',
|
||||
'SpeedLow' => 'Lage Snelheid',
|
||||
'SpeedMedium' => 'Medium Snelheid',
|
||||
'SpeedTurbo' => 'Turbo Snelheid',
|
||||
'SpeedHigh' => 'Hoge snelheid',
|
||||
'SpeedLow' => 'Lage snelheid',
|
||||
'SpeedMedium' => 'Gemiddelde snelheid',
|
||||
'SpeedTurbo' => 'Turbo snelheid',
|
||||
'Start' => 'Start',
|
||||
'State' => 'Status',
|
||||
'Stats' => 'Stats',
|
||||
|
@ -648,18 +649,18 @@ $SLANG = array(
|
|||
'Step' => 'Stap',
|
||||
'StepBack' => 'Stap Terug',
|
||||
'StepForward' => 'Stap Vooruit',
|
||||
'StepLarge' => 'Groten stap',
|
||||
'StepMedium' => 'Medium Stap',
|
||||
'StepNone' => 'Geen Stap',
|
||||
'StepSmall' => 'Smalle Stap',
|
||||
'Stills' => 'Plaatjes',
|
||||
'Stop' => 'Stop',
|
||||
'StepLarge' => 'Grote stap',
|
||||
'StepMedium' => 'Gemiddelde stap',
|
||||
'StepNone' => 'Geen stap',
|
||||
'StepSmall' => 'Kleine stap',
|
||||
'Stills' => 'Beelden',
|
||||
'Stop' => 'Stoppen',
|
||||
'Stopped' => 'Gestopt',
|
||||
'Stream' => 'Stream',
|
||||
'StreamReplayBuffer' => 'Stream Replay foto Buffer',
|
||||
'StreamReplayBuffer' => 'Stream Replay beeldbuffer',
|
||||
'Submit' => 'Verzenden',
|
||||
'System' => 'Systeem',
|
||||
'SystemLog' => 'Systeem Log', // Added - 2011-06-16
|
||||
'SystemLog' => 'Systeemlog',
|
||||
'TargetColorspace' => 'Target colorspace', // Added - 2015-04-18
|
||||
'Tele' => 'Tele',
|
||||
'Thumbnail' => 'Thumbnail',
|
||||
|
@ -667,38 +668,38 @@ $SLANG = array(
|
|||
'Time' => 'Tijd',
|
||||
'TimeDelta' => 'Tijd Delta',
|
||||
'TimeStamp' => 'Tijdstempel',
|
||||
'Timeline' => 'Tijdslijn',
|
||||
'TimelineTip1' => 'Pass your mouse over the graph to view a snapshot image and event details.', // Added 2013.08.15.
|
||||
'TimelineTip2' => 'Click on the coloured sections of the graph, or the image, to view the event.', // Added 2013.08.15.
|
||||
'TimelineTip3' => 'Click on the background to zoom in to a smaller time period based around your click.', // Added 2013.08.15.
|
||||
'TimelineTip4' => 'Use the controls below to zoom out or navigate back and forward through the time range.', // Added 2013.08.15.
|
||||
'Timeline' => 'Tijdlijn',
|
||||
'TimelineTip1' => 'Beweeg de muis over de grafiek om een beeld en gebeurtenisdetails te bekijken.',
|
||||
'TimelineTip2' => 'Klik op de gekleurde delen van de grafiek of de afbeelding om de gebeurtenis te bekijken.',
|
||||
'TimelineTip3' => 'Klik op de achtergrond om in te zoomen naar een smaller tijdsbestek rond de positie van de muis.',
|
||||
'TimelineTip4' => 'Gebruik de knoppen hieronder om uit te zoomen of voor- en achteruit te navigeren.',
|
||||
'Timestamp' => 'Tijdstempel',
|
||||
'TimestampLabelFormat' => 'Tijdstempel Label Format',
|
||||
'TimestampLabelX' => 'Tijdstempel Label X',
|
||||
'TimestampLabelY' => 'Tijdstempel Label Y',
|
||||
'TimestampLabelFormat' => 'Formaat tijdstempel',
|
||||
'TimestampLabelX' => 'Tijdstempel X-positie',
|
||||
'TimestampLabelY' => 'Tijdstempel Y-positie',
|
||||
'Today' => 'Vandaag',
|
||||
'Tools' => 'Gereedschappen',
|
||||
'Total' => 'Totaal', // Added - 2011-06-16
|
||||
'TotalBrScore' => 'Totaal<br/>Score',
|
||||
'Total' => 'Totaal',
|
||||
'TotalBrScore' => 'Totaal-<br/>Score',
|
||||
'TrackDelay' => 'Track Vertraging',
|
||||
'TrackMotion' => 'Track Beweging',
|
||||
'Triggers' => 'Triggers',
|
||||
'TurboPanSpeed' => 'Turbo Pan Snelheid',
|
||||
'TurboTiltSpeed' => 'Turbo Tilt Snelheid',
|
||||
'Type' => 'Type',
|
||||
'Unarchive' => 'Dearchiveer',
|
||||
'Undefined' => 'Ongedefineerd', // Added - 2009-02-08
|
||||
'Unarchive' => 'Dearchiveren',
|
||||
'Undefined' => 'Ongedefinieerd',
|
||||
'Units' => 'Eenheden',
|
||||
'Unknown' => 'Onbekend',
|
||||
'Update' => 'Ververs',
|
||||
'UpdateAvailable' => 'Een update voor ZoneMinder is beschikbaar',
|
||||
'Update' => 'Bijwerken',
|
||||
'UpdateAvailable' => 'Er is een nieuwe versie voor ZoneMinder beschikbaar',
|
||||
'UpdateNotNecessary' => 'Geen update noodzakelijk',
|
||||
'Updated' => 'Ververst', // Added - 2011-06-16
|
||||
'Upload' => 'Upload', // Added - 2015-04-18
|
||||
'Updated' => 'Bijwerken voltooid',
|
||||
'Upload' => 'Uploaden',
|
||||
'UseFilter' => 'Gebruik Filter',
|
||||
'UseFilterExprsPost' => ' filter expressies', // This is used at the end of the phrase 'use N filter expressions'
|
||||
'UseFilterExprsPre' => 'Gebruik ', // This is used at the beginning of the phrase 'use N filter expressions'
|
||||
'UsedPlugins' => 'Used Plugins', // Added - 2015-04-18
|
||||
'UsedPlugins' => 'Gebruikte plugins',
|
||||
'User' => 'Gebruiker',
|
||||
'Username' => 'Gebruikersnaam',
|
||||
'Users' => 'Gebruikers',
|
||||
|
@ -713,26 +714,26 @@ $SLANG = array(
|
|||
'VersionRemindNever' => 'Herinner mij niet aan nieuwe versies',
|
||||
'VersionRemindWeek' => 'Herinner mij na 1 week',
|
||||
'Video' => 'Video',
|
||||
'VideoFormat' => 'Video Formaat',
|
||||
'VideoGenFailed' => 'Video Generatie mislukt!',
|
||||
'VideoFormat' => 'Videoformaat',
|
||||
'VideoGenFailed' => 'Videogeneratie mislukt!',
|
||||
'VideoGenFiles' => 'Bestaande videobestanden',
|
||||
'VideoGenNoFiles' => 'Geen videobestanden gevonden',
|
||||
'VideoGenParms' => 'Video Generatie Parameters',
|
||||
'VideoGenSucceeded' => 'Video Generatie voltooid!',
|
||||
'VideoGenParms' => 'Videogeneratie Parameters',
|
||||
'VideoGenSucceeded' => 'Videogeneratie voltooid!',
|
||||
'VideoSize' => 'Videogrootte',
|
||||
'View' => 'Bekijk',
|
||||
'ViewAll' => 'Bekijk Alles',
|
||||
'ViewEvent' => 'Bekijk Gebeurtenis',
|
||||
'ViewPaged' => 'Bekijk Pagina',
|
||||
'Wake' => 'Wakker',
|
||||
'WarmupFrames' => 'Warmop Frames',
|
||||
'WarmupFrames' => 'Opwarm frames',
|
||||
'Watch' => 'Observeer',
|
||||
'Web' => 'Web',
|
||||
'WebColour' => 'Web Kleur',
|
||||
'WebColour' => 'Webkleur',
|
||||
'Week' => 'Week',
|
||||
'White' => 'Wit',
|
||||
'WhiteBalance' => 'Wit Balance',
|
||||
'Wide' => 'Wijd',
|
||||
'WhiteBalance' => 'Witbalans',
|
||||
'Wide' => 'Breed',
|
||||
'X' => 'X',
|
||||
'X10' => 'X10',
|
||||
'X10ActivationString' => 'X10 Activatie Waarde',
|
||||
|
@ -746,13 +747,13 @@ $SLANG = array(
|
|||
'ZoneArea' => 'Zone Gebied',
|
||||
'ZoneExtendAlarmFrames' => 'Extend Alarm Frame Count',
|
||||
'ZoneFilterSize' => 'Filter Hoogte/Breedte (pixels)',
|
||||
'ZoneMinMaxAlarmArea' => 'Min/Max Alarmeer Gebied',
|
||||
'ZoneMinMaxBlobArea' => 'Min/Max Blob Gebied',
|
||||
'ZoneMinMaxAlarmArea' => 'Min/Max alarmgebied',
|
||||
'ZoneMinMaxBlobArea' => 'Min/Max Blobgebied',
|
||||
'ZoneMinMaxBlobs' => 'Min/Max Blobs',
|
||||
'ZoneMinMaxFiltArea' => 'Min/Max Gefilterd Gebied',
|
||||
'ZoneMinMaxPixelThres' => 'Min/Max Pixel Threshold (0-255)',
|
||||
'ZoneMinderLog' => 'ZoneMinder Log', // Added - 2011-06-17
|
||||
'ZoneOverloadFrames' => 'Overload Frame negeer aantal',
|
||||
'ZoneMinMaxFiltArea' => 'Min/Max Gefilterd gebied',
|
||||
'ZoneMinMaxPixelThres' => 'Min/Max Pixel drempelwaarde (0-255)',
|
||||
'ZoneMinderLog' => 'ZoneMinder Log',
|
||||
'ZoneOverloadFrames' => 'Negeer aantal overload frames',
|
||||
'Zones' => 'Zones',
|
||||
'Zoom' => 'Zoom',
|
||||
'ZoomIn' => 'Zoom In',
|
||||
|
@ -763,11 +764,11 @@ $SLANG = array(
|
|||
$CLANG = array(
|
||||
'CurrentLogin' => 'huidige login is \'%1$s\'',
|
||||
'EventCount' => '%1$s %2$s', // Als voorbeeld '37 gebeurtenissen' (from Vlang below)
|
||||
'LastEvents' => 'Last %1$s %2$s', // Als voorbeeld 'Laatste 37 gebeurtenissen' (from Vlang below)
|
||||
'LastEvents' => 'Laatste %1$s %2$s', // Als voorbeeld 'Laatste 37 gebeurtenissen' (from Vlang below)
|
||||
'LatestRelease' => 'de laatste release is v%1$s, jij hebt v%2$s.',
|
||||
'MonitorCount' => '%1$s %2$s', // Als voorbeeld '4 Monitoren' (from Vlang below)
|
||||
'MonitorFunction' => 'Monitor %1$s Functie',
|
||||
'RunningRecentVer' => 'U draait al met de laatste versie van ZoneMinder, v%s.',
|
||||
'RunningRecentVer' => 'U draait al de meest recente versie van ZoneMinder, v%s.',
|
||||
'VersionMismatch' => 'Versie verschil, systeem is versie %1$s, database is %2$s.', // Added - 2011-05-25
|
||||
);
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ function getControlCommands( $monitor )
|
|||
$cmds['PresetGoto'] = "presetGoto";
|
||||
$cmds['PresetHome'] = "presetHome";
|
||||
|
||||
if ( !empty($monitor->CanZoom) )
|
||||
if ( !empty($monitor->CanZoom()) )
|
||||
{
|
||||
if ( $monitor->CanZoomCon() )
|
||||
$cmds['ZoomRoot'] = "zoomCon";
|
||||
|
@ -45,7 +45,7 @@ function getControlCommands( $monitor )
|
|||
$cmds['ZoomMan'] = "zoomMan";
|
||||
}
|
||||
|
||||
if ( !empty($monitor->CanFocus) )
|
||||
if ( !empty($monitor->CanFocus()) )
|
||||
{
|
||||
if ( $monitor->CanFocusCon() )
|
||||
$cmds['FocusRoot'] = "focusCon";
|
||||
|
@ -60,7 +60,7 @@ function getControlCommands( $monitor )
|
|||
$cmds['FocusMan'] = "focusMan";
|
||||
}
|
||||
|
||||
if ( !empty($monitor->CanIris) )
|
||||
if ( !empty($monitor->CanIris()) )
|
||||
{
|
||||
if ( $monitor->CanIrisCon() )
|
||||
$cmds['IrisRoot'] = "irisCon";
|
||||
|
@ -75,7 +75,7 @@ function getControlCommands( $monitor )
|
|||
$cmds['IrisMan'] = "irisMan";
|
||||
}
|
||||
|
||||
if ( !empty($monitor->CanWhite) )
|
||||
if ( !empty($monitor->CanWhite()) )
|
||||
{
|
||||
if ( $monitor->CanWhiteCon() )
|
||||
$cmds['WhiteRoot'] = "whiteCon";
|
||||
|
@ -89,7 +89,7 @@ function getControlCommands( $monitor )
|
|||
$cmds['WhiteMan'] = "whiteMan";
|
||||
}
|
||||
|
||||
if ( !empty($monitor->CanGain) )
|
||||
if ( !empty($monitor->CanGain()) )
|
||||
{
|
||||
if ( $monitor->CanGainCon() )
|
||||
$cmds['GainRoot'] = "gainCon";
|
||||
|
@ -103,7 +103,7 @@ function getControlCommands( $monitor )
|
|||
$cmds['GainMan'] = "gainMan";
|
||||
}
|
||||
|
||||
if ( !empty($monitor->CanMove) )
|
||||
if ( !empty($monitor->CanMove()) )
|
||||
{
|
||||
if ( $monitor->CanMoveCon() )
|
||||
{
|
||||
|
@ -243,12 +243,12 @@ function controlPanTilt( $monitor, $cmds )
|
|||
ob_start();
|
||||
?>
|
||||
<div class="pantiltControls">
|
||||
<div class="pantilLabel"><?php echo translate('PanTilt') ?></div>
|
||||
<div class="pantiltLabel"><?php echo translate('PanTilt') ?></div>
|
||||
<div class="pantiltButtons">
|
||||
<?php
|
||||
$hasPan = $monitor->CanPan;
|
||||
$hasTilt = $monitor->CanTilt;
|
||||
$hasDiag = $hasPan && $hasTilt && $monitor->CanMoveDiag;
|
||||
$hasPan = $monitor->CanPan();
|
||||
$hasTilt = $monitor->CanTilt();
|
||||
$hasDiag = $hasPan && $hasTilt && $monitor->CanMoveDiag();
|
||||
?>
|
||||
<div class="arrowBtn upLeftBtn<?php echo $hasDiag?'':' invisible' ?>" onclick="controlCmd('<?php echo $cmds['MoveUpLeft'] ?>',event,-1,-1)"></div>
|
||||
<div class="arrowBtn upBtn<?php echo $hasTilt?'':' invisible' ?>" onclick="controlCmd('<?php echo $cmds['MoveUp'] ?>',event,0,-1)"></div>
|
||||
|
@ -278,7 +278,7 @@ function controlPresets( $monitor, $cmds )
|
|||
$labels[$row['Preset']] = $row['Label'];
|
||||
}
|
||||
|
||||
$presetBreak = (int)(($monitor->NumPresets+1)/((int)(($monitor->NumPresets-1)/MAX_PRESETS)+1));
|
||||
$presetBreak = (int)(($monitor->NumPresets()+1)/((int)(($monitor->NumPresets()-1)/MAX_PRESETS)+1));
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
|
@ -286,7 +286,7 @@ function controlPresets( $monitor, $cmds )
|
|||
<!--<div><?php echo translate('Presets') ?></div>-->
|
||||
<div>
|
||||
<?php
|
||||
for ( $i = 1; $i <= $monitor->NumPresets; $i++ )
|
||||
for ( $i = 1; $i <= $monitor->NumPresets(); $i++ )
|
||||
{
|
||||
?><input type="button" class="ptzNumBtn" title="<?php echo isset($labels[$i])?$labels[$i]:"" ?>" value="<?php echo $i ?>" onclick="controlCmd('<?php echo $cmds['PresetGoto'] ?><?php echo $i ?>');"/><?php
|
||||
if ( $i && (($i%$presetBreak) == 0) )
|
||||
|
|
|
@ -142,8 +142,6 @@ function exportEventDetail( $event, $exportFrames, $exportImages )
|
|||
|
||||
function exportEventFrames( $event, $exportDetail, $exportImages )
|
||||
{
|
||||
global $SLANG;
|
||||
|
||||
$sql = "SELECT *, unix_timestamp( TimeStamp ) AS UnixTimeStamp FROM Frames WHERE EventID = ? ORDER BY FrameId";
|
||||
$frames = dbFetchAll( $sql, NULL, array( $event['Id'] ) );
|
||||
|
||||
|
@ -230,8 +228,6 @@ function exportEventFrames( $event, $exportDetail, $exportImages )
|
|||
|
||||
function exportEventImages( $event, $exportDetail, $exportFrames, $myfilelist )
|
||||
{
|
||||
global $SLANG;
|
||||
|
||||
ob_start();
|
||||
exportHeader( translate('Images')." ".$event['Id'] );
|
||||
|
||||
|
@ -589,7 +585,6 @@ else if (document.layers) window.onload=start_slider;
|
|||
|
||||
function exportEventImagesMaster( $eids )
|
||||
{
|
||||
global $SLANG;
|
||||
ob_start();
|
||||
exportHeader( translate('Images').' Master' );
|
||||
?>
|
||||
|
|
|
@ -28,5 +28,3 @@ var showVersionPopup = <?php echo isset($showVersionPopup )?'true':'false' ?>;
|
|||
var showDonatePopup = <?php echo isset($showDonatePopup )?'true':'false' ?>;
|
||||
var translatedAddText = "<?php echo translate('AddNewMonitor') ?>";
|
||||
var translatedCloneText = "<?php echo translate('CloneMonitor') ?>";
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue