Merge branch 'master' of https://github.com/manupap1/ZoneMinder into plugin_support_basic

Conflicts:
	distros/debian/control
	distros/debian8/zoneminder.dirs
	web/skins/classic/views/js/Makefile.am
This commit is contained in:
Emmanuel Papin 2014-12-31 12:20:56 +01:00
commit 45edab3ad9
40 changed files with 1155 additions and 148 deletions

View File

@ -549,10 +549,10 @@ if test "$prefix" != "NONE"; then
PERL_SITE_LIB=`perl -V:installsitelib | sed -e "s/.*='\(.*\)';/\1/"` PERL_SITE_LIB=`perl -V:installsitelib | sed -e "s/.*='\(.*\)';/\1/"`
PERL_LIB_PATH=`echo $PERL_SITE_LIB | sed -e "s|^$PERL_SITE_PREFIX||"` PERL_LIB_PATH=`echo $PERL_SITE_LIB | sed -e "s|^$PERL_SITE_PREFIX||"`
EXTRA_PERL_LIB="use lib '$prefix$PERL_LIB_PATH'; # Include custom perl install path" EXTRA_PERL_LIB="use lib '$prefix$PERL_LIB_PATH'; # Include custom perl install path"
PERL_MM_PARMS="PREFIX=$prefix" PERL_MM_PARMS="\"PREFIX=$prefix INSTALLDIRS=vendor\""
else else
EXTRA_PERL_LIB="# Include from system perl paths only" EXTRA_PERL_LIB="# Include from system perl paths only"
PERL_MM_PARMS= PERL_MM_PARMS="\"INSTALLDIRS=vendor\""
fi fi
AC_SUBST(PERL_MM_PARMS) AC_SUBST(PERL_MM_PARMS)
AC_SUBST(EXTRA_PERL_LIB) AC_SUBST(EXTRA_PERL_LIB)

View File

@ -0,0 +1,5 @@
This package uses quilt to manage all modifications to the upstream source.
Changes are stored in the source package as diffs in debian/patches and applied
during the build.
See /usr/share/doc/quilt/README.source for a detailed explanation.

View File

@ -2,14 +2,14 @@ Source: zoneminder
Section: net Section: net
Priority: optional Priority: optional
Maintainer: Isaac Connor <iconnor@connortechnology.com> Maintainer: Isaac Connor <iconnor@connortechnology.com>
Build-Depends: debhelper (>= 7.0.50), autoconf, automake, dpatch, libphp-serialization-perl, libgnutls-dev|libgnutls28-dev, libmysqlclient-dev | libmariadbclient-dev, libdbd-mysql-perl, libdate-manip-perl, libwww-perl, libjpeg8-dev|libjpeg9-dev|libjpeg62-turbo-dev, libpcre3-dev, libavcodec-dev, libavformat-dev (>= 3:0.svn20090204), libswscale-dev (>= 3:0.svn20090204), libavutil-dev, libv4l-dev (>= 0.8.3), libbz2-dev, libtool, libsys-mmap-perl, ffmpeg | libav-tools, libnetpbm10-dev, libavdevice-dev, libdevice-serialport-perl, libarchive-zip-perl, libmime-lite-perl, dh-autoreconf, libvlccore-dev, libvlc-dev, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libgcrypt11-dev|libgcrypt20-dev, libpolkit-gobject-1-dev Build-Depends: debhelper (>= 9), autoconf, automake, quilt, libphp-serialization-perl, libgnutls-dev|libgnutls28-dev, libmysqlclient-dev | libmariadbclient-dev, libdbd-mysql-perl, libdate-manip-perl, libwww-perl, libjpeg8-dev|libjpeg9-dev|libjpeg62-turbo-dev, libpcre3-dev, libavcodec-dev, libavformat-dev (>= 3:0.svn20090204), libswscale-dev (>= 3:0.svn20090204), libavutil-dev, libv4l-dev (>= 0.8.3), libbz2-dev, libtool, libsys-mmap-perl, ffmpeg | libav-tools, libnetpbm10-dev, libavdevice-dev, libdevice-serialport-perl, libarchive-zip-perl, libmime-lite-perl, dh-autoreconf, libvlccore-dev, libvlc-dev, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libgcrypt11-dev|libgcrypt20-dev, libpolkit-gobject-1-dev
Standards-Version: 3.9.2 Standards-Version: 3.9.4
Package: zoneminder Package: zoneminder
Architecture: any Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice53 | libavdevice55, libjpeg8|libjpeg9|libjpeg62-turbo, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7 | libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0, liburi-encode-perl Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice53 | libavdevice55, libjpeg8|libjpeg9|libjpeg62-turbo, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7 | libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0, liburi-encode-perl
Recommends: mysql-server|mariadb-server Recommends: mysql-server|mariadb-server
Description: A video camera security and surveillance solution Description: Video camera security and surveillance solution
ZoneMinder is intended for use in single or multi-camera video security ZoneMinder is intended for use in single or multi-camera video security
applications, including commercial or home CCTV, theft prevention and child applications, including commercial or home CCTV, theft prevention and child
or family member or home monitoring and other care scenarios. It or family member or home monitoring and other care scenarios. It
@ -22,9 +22,11 @@ Description: A video camera security and surveillance solution
via X.10 or other protocols. via X.10 or other protocols.
Package: zoneminder-dbg Package: zoneminder-dbg
Section: debug
Priority: extra
Architecture: any Architecture: any
Depends: zoneminder (= ${binary:Version}), ${misc:Depends} Depends: zoneminder (= ${binary:Version}), ${misc:Depends}
Description: debugging syumbols for zoneminder. Description: Debugging symbols for zoneminder.
ZoneMinder is a video camera security and surveillance solution. ZoneMinder is a video camera security and surveillance solution.
ZoneMinder is intended for use in single or multi-camera video security ZoneMinder is intended for use in single or multi-camera video security
applications, including commercial or home CCTV, theft prevention and child applications, including commercial or home CCTV, theft prevention and child

View File

@ -3,5 +3,10 @@ usr/lib/cgi-bin
usr/share/man usr/share/man
usr/share/perl5/ZoneMinder usr/share/perl5/ZoneMinder
usr/share/perl5/ZoneMinder.pm usr/share/perl5/ZoneMinder.pm
usr/share/polkit-1/actions
usr/share/polkit-1/rules.d
usr/share/zoneminder usr/share/zoneminder
etc/zm etc/zm
db/zm_create.sql usr/share/zoneminder/db
db/zm_update-*.sql usr/share/zoneminder/db
debian/apache.conf etc/zm

View File

@ -0,0 +1,17 @@
Index: ZoneMinder/configure.ac
===================================================================
--- ZoneMinder.orig/configure.ac 2014-12-13 15:10:27.705191682 +0100
+++ ZoneMinder/configure.ac 2014-12-13 16:50:07.101049743 +0100
@@ -443,10 +443,10 @@
PERL_SITE_LIB=`perl -V:installsitelib | sed -e "s/.*='\(.*\)';/\1/"`
PERL_LIB_PATH=`echo $PERL_SITE_LIB | sed -e "s|^$PERL_SITE_PREFIX||"`
EXTRA_PERL_LIB="use lib '$prefix$PERL_LIB_PATH'; # Include custom perl install path"
- PERL_MM_PARMS="PREFIX=$prefix"
+ PERL_MM_PARMS="\"PREFIX=$prefix INSTALLDIRS=vendor\""
else
EXTRA_PERL_LIB="# Include from system perl paths only"
- PERL_MM_PARMS=
+ PERL_MM_PARMS="\"INSTALLDIRS=vendor\""
fi
AC_SUBST(PERL_MM_PARMS)
AC_SUBST(EXTRA_PERL_LIB)

View File

@ -0,0 +1 @@
01_vendor-perl.diff

View File

@ -25,10 +25,10 @@ else
endif endif
%: %:
dh $@ --with autoreconf dh $@ --with quilt,autoreconf
override_dh_auto_configure: override_dh_auto_configure:
CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --sysconfdir=/etc/zm --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --with-mysql=/usr --with-mariadb=/usr --with-webdir=/usr/share/zoneminder --with-ffmpeg=/usr --with-cgidir=/usr/lib/cgi-bin --with-webuser=www-data --with-webgroup=www-data --enable-crashtrace=no --enable-mmap=yes CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" dh_auto_configure -- --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --sysconfdir=/etc/zm --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --with-mysql=/usr --with-mariadb=/usr --with-webdir=/usr/share/zoneminder --with-ffmpeg=/usr --with-cgidir=/usr/lib/cgi-bin --with-webuser=www-data --with-webgroup=www-data --enable-crashtrace=no --enable-mmap=yes
override_dh_clean: override_dh_clean:
# Add here commands to clean up after the build process. # Add here commands to clean up after the build process.
@ -36,28 +36,23 @@ override_dh_clean:
dh_clean dh_clean
override_dh_install: override_dh_install:
# Add here commands to install the package into debian/zm. dh_install --fail-missing
$(MAKE) install DESTDIR=$(CURDIR)/debian/zoneminder RUNDIR=$(CURDIR)/debian/zoneminder/var/run ZM_RUNDIR=$(CURDIR)/debian/zoneminder/var/run
install -D -m 0644 db/zm_create.sql $(CURDIR)/debian/zoneminder/usr/share/zoneminder/db
install -D -m 0644 db/zm_update-*.sql $(CURDIR)/debian/zoneminder/usr/share/zoneminder/db
install -D -m 0644 debian/apache.conf $(CURDIR)/debian/zoneminder/etc/zm
# #
# NOTE: This is a short-term kludge; hopefully changes in the next # NOTE: This is a short-term kludge; hopefully changes in the next
# upstream version will render this unnecessary. # upstream version will render this unnecessary.
rm -rf debian/zoneminder/usr/share/zoneminder/events rm -rf debian/zoneminder/usr/share/zoneminder/events
rm -rf debian/zoneminder/usr/share/zoneminder/images rm -rf debian/zoneminder/usr/share/zoneminder/images
rm -rf debian/zoneminder/usr/share/zoneminder/temp rm -rf debian/zoneminder/usr/share/zoneminder/temp
ln -s /var/cache/zoneminder/events debian/zoneminder/usr/share/zoneminder/ dh_link var/cache/zoneminder/events usr/share/zoneminder/events
ln -s /var/cache/zoneminder/images debian/zoneminder/usr/share/zoneminder/ dh_link var/cache/zoneminder/images usr/share/zoneminder/images
ln -s /var/cache/zoneminder/temp debian/zoneminder/usr/share/zoneminder/ dh_link var/cache/zoneminder/temp usr/share/zoneminder/temp
# #
# This is a slightly lesser kludge; moving the cgi stuff to # This is a slightly lesser kludge; moving the cgi stuff to
# /usr/share/zoneminder/cgi-bin breaks one set of behavior, # /usr/share/zoneminder/cgi-bin breaks one set of behavior,
# having it just in /usr/lib/cgi-bin breaks another bit of # having it just in /usr/lib/cgi-bin breaks another bit of
# behavior. # behavior.
# #
ln -s /usr/lib/cgi-bin debian/zoneminder/usr/share/zoneminder/ dh_link usr/lib/cgi-bin usr/share/zoneminder/cgi-bin
override_dh_fixperms: override_dh_fixperms:
dh_fixperms dh_fixperms

View File

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

View File

@ -0,0 +1 @@
[type: gettext/rfc822deb] zoneminder.templates

252
distros/debian8/po/fr.po Normal file
View File

@ -0,0 +1,252 @@
# debconf french translation file for ZoneMinder.
# Copyright (C) 2001-2008 Philip Coombes
# This file is distributed under the same license as the zoneminder package.
# First author: Emmanuel Papin <manupap01@gmail.com>, 2014.
#
msgid ""
msgstr ""
"Project-Id-Version: zoneminder\n"
"Report-Msgid-Bugs-To: zoneminder@packages.debian.org\n"
"POT-Creation-Date: 2014-12-12 12:28+0100\n"
"PO-Revision-Date: 2014-12-07 00:40+0100\n"
"Last-Translator: Emmanuel Papin <manupap01@gmail.com>\n"
"Language-Team: French <debian-l10n-french@lists.debian.org>\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. Type: select
#. Choices
#: ../zoneminder.templates:1001
msgid "local"
msgstr "local"
#. Type: select
#. Choices
#: ../zoneminder.templates:1001
msgid "remote"
msgstr "distant"
#. Type: select
#. Description
#: ../zoneminder.templates:1002
msgid "Database location:"
msgstr "Emplacement de la base de donnée :"
#. Type: select
#. Description
#: ../zoneminder.templates:1002
msgid ""
"A database server is required to run ZoneMinder. The database can be "
"installed either locally or remotely on a machine of your network."
msgstr ""
"Un serveur de base de données est requis pour ZoneMinder. La base de donnée "
"peut être installée localement ou à distance sur une machine de votre réseau."
#. Type: select
#. Description
#: ../zoneminder.templates:1002
msgid ""
"If you choose a remote location, you will have to select the 'tcp/ip' "
"connection method and enter the hostname or ip address of the remote machine "
"in the next configuration screens."
msgstr ""
"Si vous choisissez un emplacement distant, vous devrez sélectionner la "
"méthode de connexion 'tcp/ip' et entrer le nom réseau ou l'adresse ip de la "
"machine distante dans les écrans de configuration suivants."
#. Type: error
#. Description
#: ../zoneminder.templates:2001
msgid "No local database server is available:"
msgstr "Aucun serveur local de base de données n'est disponible :"
#. Type: error
#. Description
#: ../zoneminder.templates:2001
msgid ""
"Currently ZoneMinder supports mysql or mariadb database server but none of "
"them appears to be installed on this machine."
msgstr ""
"Actuellement ZoneMinder supporte les serveurs de base de données mysql et "
"mariadb mais aucun d'entre eux n'est installé sur cette machine."
#. Type: error
#. Description
#: ../zoneminder.templates:2001
msgid ""
"In order to complete ZoneMinder's installation, after ending of this "
"assistant, please install a compatible database server and then restart the "
"assistant by invoking:"
msgstr ""
"Afin de compléter l'installation de ZoneMinder, après la fermeture de cet "
"assitant, veuillez installer un serveur de base de données compatible et "
"ensuite redémarrez l'assistant en invoquant :"
#. Type: error
#. Description
#. Type: error
#. Description
#: ../zoneminder.templates:2001 ../zoneminder.templates:3001
msgid "$ sudo dpkg-reconfigure zoneminder"
msgstr "$ sudo dpkg-reconfigure zoneminder"
#. Type: error
#. Description
#: ../zoneminder.templates:3001
msgid "Remote database servers are not allowed:"
msgstr "Les serveurs de base de données distants ne sont pas autorisés :"
#. Type: error
#. Description
#: ../zoneminder.templates:3001
msgid ""
"The current configuration of dbconfig-common does not allow installation of "
"a database on remote servers."
msgstr ""
"La configuration actuelle de dbconfig-common ne permet pas l'installation de "
"bases de données sur des serveurs distants."
#. Type: error
#. Description
#: ../zoneminder.templates:3001
msgid ""
"In order to reconfigure dbconfig-common, please invoke the following command "
"after ending of this assistant:"
msgstr ""
"Afin de reconfigurer dbconfig-common, veuillez invoquer la commande suivante "
"après la fermeture de cet assitant :"
#. Type: error
#. Description
#: ../zoneminder.templates:3001
msgid "$ sudo dpkg-reconfigure dbconfig-common"
msgstr "$ sudo dpkg-reconfigure dbconfig-common"
#. Type: error
#. Description
#: ../zoneminder.templates:3001
msgid ""
"Then, to complete ZoneMinder's installation, please restart this assistant "
"by invoking:"
msgstr ""
"Ensuite, pour compléter l'installation de ZoneMinder, veuillez redémarrer "
"cet assistant en invoquant :"
#. Type: multiselect
#. Description
#: ../zoneminder.templates:4001
msgid "Web server to reconfigure automatically:"
msgstr "Serveur web à reconfigurer automatiquement :"
#. Type: multiselect
#. Description
#: ../zoneminder.templates:4001
msgid ""
"Please choose the web server that should be automatically configured for "
"ZoneMinder's web portal access."
msgstr ""
"Veuillez choisir le serveur web à reconfigurer automatiquement pour l'accès "
"au portail web de ZoneMinder."
#. Type: password
#. Description
#: ../zoneminder.templates:5001
msgid "New password for the ZoneMinder 'admin' user:"
msgstr "Nouveau mot de passe pour le compte 'admin' de ZoneMinder :"
#. Type: password
#. Description
#: ../zoneminder.templates:5001
msgid "Please enter the password of the default administrative user."
msgstr "Veuillez entrer le mot de passe du compte administrateur par défaut."
#. Type: password
#. Description
#: ../zoneminder.templates:5001
msgid ""
"While not mandatory, it is highly recommended that you set a custom password "
"for the administrative 'admin' user."
msgstr ""
"Bien que cela ne soit pas obligatoire, il est fortement recommandé de "
"fournir un mot de passe personnalisé pour le compte administrateur 'admin'."
#. Type: password
#. Description
#: ../zoneminder.templates:5001
msgid "If this field is left blank, the password will not be changed."
msgstr "Si le champ est laissé vide, le mot de passe ne sera pas changé."
#. Type: password
#. Description
#: ../zoneminder.templates:6001
msgid "Repeat password for the ZoneMinder 'admin' user:"
msgstr "Répéter le mot de passe pour le compte 'admin' de ZoneMinder :"
#. Type: error
#. Description
#: ../zoneminder.templates:7001
msgid "Password input error"
msgstr "Erreur de mot de passe"
#. Type: error
#. Description
#: ../zoneminder.templates:7001
msgid "The two passwords you entered were not the same. Please try again."
msgstr ""
"Les deux mots de passe saisis ne sont pas les mêmes. Veuillez essayer à "
"nouveau."
#. Type: boolean
#. Description
#: ../zoneminder.templates:8001
msgid "Delete this non empty directory?"
msgstr "Supprimer ce répertoire non vide ?"
#. Type: boolean
#. Description
#: ../zoneminder.templates:8001
msgid ""
"A purge of the ZoneMinder package is performed but the directory '/var/cache/"
"zoneminder' is not empty so it will not be deleted."
msgstr ""
"Une purge du paquet ZoneMinder est en cours mais le répertoire '/var/cache/"
"zoneminder' n'est pas vide et sera donc conservé."
#. Type: boolean
#. Description
#: ../zoneminder.templates:8001
msgid ""
"Please consider that this directory is designed to contain data resulting "
"from event detection. Therefore, \"proof of evidence\" could be lost!\""
msgstr ""
"Veuillez considérer que ce répertoire est conçu pour contenir des données "
"résultants de la détection d'événements. Par conséquent, des preuves "
"pourraient être perdues !"
#. Type: boolean
#. Description
#: ../zoneminder.templates:8001
msgid ""
"If you are not sure of your decision, please do not delete this directory "
"but perform a manual checkup."
msgstr ""
"Si vous n'êtes pas sûr de votre décision, veuillez conserver ce répertoire "
"et effectuer une vérification manuelle."
#. Type: boolean
#. Description
#: ../zoneminder.templates:9001
msgid "Deletion confirmed?"
msgstr "Supression confirmée ?"
#. Type: boolean
#. Description
#: ../zoneminder.templates:9001
msgid ""
"You have allowed the deletion of directory '/var/cache/zoneminder' although "
"it may contain critical data."
msgstr ""
"Vous avez autorisé la suppression du répertoire '/var/cache/zoneminder' bien "
"qu'il puisse contenir des données critiques."

View File

@ -0,0 +1,222 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: zoneminder\n"
"Report-Msgid-Bugs-To: zoneminder@packages.debian.org\n"
"POT-Creation-Date: 2014-12-12 12:28+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#. Type: select
#. Choices
#: ../zoneminder.templates:1001
msgid "local"
msgstr ""
#. Type: select
#. Choices
#: ../zoneminder.templates:1001
msgid "remote"
msgstr ""
#. Type: select
#. Description
#: ../zoneminder.templates:1002
msgid "Database location:"
msgstr ""
#. Type: select
#. Description
#: ../zoneminder.templates:1002
msgid ""
"A database server is required to run ZoneMinder. The database can be "
"installed either locally or remotely on a machine of your network."
msgstr ""
#. Type: select
#. Description
#: ../zoneminder.templates:1002
msgid ""
"If you choose a remote location, you will have to select the 'tcp/ip' "
"connection method and enter the hostname or ip address of the remote machine "
"in the next configuration screens."
msgstr ""
#. Type: error
#. Description
#: ../zoneminder.templates:2001
msgid "No local database server is available:"
msgstr ""
#. Type: error
#. Description
#: ../zoneminder.templates:2001
msgid ""
"Currently ZoneMinder supports mysql or mariadb database server but none of "
"them appears to be installed on this machine."
msgstr ""
#. Type: error
#. Description
#: ../zoneminder.templates:2001
msgid ""
"In order to complete ZoneMinder's installation, after ending of this "
"assistant, please install a compatible database server and then restart the "
"assistant by invoking:"
msgstr ""
#. Type: error
#. Description
#. Type: error
#. Description
#: ../zoneminder.templates:2001 ../zoneminder.templates:3001
msgid "$ sudo dpkg-reconfigure zoneminder"
msgstr ""
#. Type: error
#. Description
#: ../zoneminder.templates:3001
msgid "Remote database servers are not allowed:"
msgstr ""
#. Type: error
#. Description
#: ../zoneminder.templates:3001
msgid ""
"The current configuration of dbconfig-common does not allow installation of "
"a database on remote servers."
msgstr ""
#. Type: error
#. Description
#: ../zoneminder.templates:3001
msgid ""
"In order to reconfigure dbconfig-common, please invoke the following command "
"after ending of this assistant:"
msgstr ""
#. Type: error
#. Description
#: ../zoneminder.templates:3001
msgid "$ sudo dpkg-reconfigure dbconfig-common"
msgstr ""
#. Type: error
#. Description
#: ../zoneminder.templates:3001
msgid ""
"Then, to complete ZoneMinder's installation, please restart this assistant "
"by invoking:"
msgstr ""
#. Type: multiselect
#. Description
#: ../zoneminder.templates:4001
msgid "Web server to reconfigure automatically:"
msgstr ""
#. Type: multiselect
#. Description
#: ../zoneminder.templates:4001
msgid ""
"Please choose the web server that should be automatically configured for "
"ZoneMinder's web portal access."
msgstr ""
#. Type: password
#. Description
#: ../zoneminder.templates:5001
msgid "New password for the ZoneMinder 'admin' user:"
msgstr ""
#. Type: password
#. Description
#: ../zoneminder.templates:5001
msgid "Please enter the password of the default administrative user."
msgstr ""
#. Type: password
#. Description
#: ../zoneminder.templates:5001
msgid ""
"While not mandatory, it is highly recommended that you set a custom password "
"for the administrative 'admin' user."
msgstr ""
#. Type: password
#. Description
#: ../zoneminder.templates:5001
msgid "If this field is left blank, the password will not be changed."
msgstr ""
#. Type: password
#. Description
#: ../zoneminder.templates:6001
msgid "Repeat password for the ZoneMinder 'admin' user:"
msgstr ""
#. Type: error
#. Description
#: ../zoneminder.templates:7001
msgid "Password input error"
msgstr ""
#. Type: error
#. Description
#: ../zoneminder.templates:7001
msgid "The two passwords you entered were not the same. Please try again."
msgstr ""
#. Type: boolean
#. Description
#: ../zoneminder.templates:8001
msgid "Delete this non empty directory?"
msgstr ""
#. Type: boolean
#. Description
#: ../zoneminder.templates:8001
msgid ""
"A purge of the ZoneMinder package is performed but the directory '/var/cache/"
"zoneminder' is not empty so it will not be deleted."
msgstr ""
#. Type: boolean
#. Description
#: ../zoneminder.templates:8001
msgid ""
"Please consider that this directory is designed to contain data resulting "
"from event detection. Therefore, \"proof of evidence\" could be lost!\""
msgstr ""
#. Type: boolean
#. Description
#: ../zoneminder.templates:8001
msgid ""
"If you are not sure of your decision, please do not delete this directory "
"but perform a manual checkup."
msgstr ""
#. Type: boolean
#. Description
#: ../zoneminder.templates:9001
msgid "Deletion confirmed?"
msgstr ""
#. Type: boolean
#. Description
#: ../zoneminder.templates:9001
msgid ""
"You have allowed the deletion of directory '/var/cache/zoneminder' although "
"it may contain critical data."
msgstr ""

View File

@ -73,6 +73,7 @@ override_dh_clean:
done || true done || true
override_dh_install: override_dh_install:
dh_install --fail-missing
# #
# NOTE: This is a short-term kludge; hopefully changes in the next # NOTE: This is a short-term kludge; hopefully changes in the next
# upstream version will render this unnecessary. # upstream version will render this unnecessary.
@ -82,7 +83,6 @@ override_dh_install:
dh_link var/cache/zoneminder/events usr/share/zoneminder/events dh_link var/cache/zoneminder/events usr/share/zoneminder/events
dh_link var/cache/zoneminder/images usr/share/zoneminder/images dh_link var/cache/zoneminder/images usr/share/zoneminder/images
dh_link var/cache/zoneminder/temp usr/share/zoneminder/temp dh_link var/cache/zoneminder/temp usr/share/zoneminder/temp
# #
# This is a slightly lesser kludge; moving the cgi stuff to # This is a slightly lesser kludge; moving the cgi stuff to
# /usr/share/zoneminder/cgi-bin breaks one set of behavior, # /usr/share/zoneminder/cgi-bin breaks one set of behavior,
@ -91,11 +91,12 @@ override_dh_install:
# #
dh_link usr/lib/cgi-bin usr/share/zoneminder/cgi-bin dh_link usr/lib/cgi-bin usr/share/zoneminder/cgi-bin
dh_install --fail-missing
override_dh_fixperms: override_dh_fixperms:
dh_fixperms dh_fixperms
chown root:root debian/zoneminder/etc/zm/zm.conf #
# As requested by the Debian Webapps Policy Manual §3.2.1
chown root:www-data debian/zoneminder/etc/zm/zm.conf
chmod 640 debian/zoneminder/etc/zm/zm.conf
override_dh_auto_test: override_dh_auto_test:
# do not run tests... # do not run tests...

View File

@ -0,0 +1,134 @@
#!/bin/sh
# config maintainer script for zoneminder
set -e
# Source the debconf stuff
. /usr/share/debconf/confmodule
# Set the first version in which dbconfig-common was introduced in the package
dbc_first_version="1.28.0"
# Source the config file if exists
CONFIGFILE=/etc/zm/zm.conf
if [ -e $CONFIGFILE ]; then
. $CONFIGFILE
fi
if [ -f /usr/share/dbconfig-common/dpkg/config ]; then
# Default use dbconfig-common
dbc_install="true"
# Currently we only support mysql database
dbc_dbtypes="mysql"
# Set authentication method to password
dbc_authmethod_user="password"
# Re-use data from ZM config file
dbc_dbserver="$ZM_DB_HOST"
dbc_dbname="$ZM_DB_NAME"
dbc_dbuser="$ZM_DB_USER"
# Source the dbconfig-common stuff
. /usr/share/dbconfig-common/dpkg/config
fi
# Do this when the package is installed, upgraded or reconfigured
# Most of answers are cached so the questions will not be asked again
if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ]; then
# Ask the user if the database shall be installed locally or remotely
db_input high zoneminder/debconf_dblocation || true
db_go || true
db_get zoneminder/debconf_dblocation
if [ "$RET" = "local" ]; then
if [ ! -e "/usr/sbin/mysqld" ]; then
# Display a message and exit if the user want a local database but
# no database server is available
db_input high zoneminder/debconf_dblocalmissingerror || true
db_go || true
exit 0
else
# Set the database server to localhost
dbc_dbserver="localhost"
fi
else
# Source the dbconfig main configuration file
if [ -f /etc/dbconfig-common/config ]; then
. /etc/dbconfig-common/config
fi
if [ "$dbc_remote_questions_default" = "false" ]; then
# Display a message and exit if the dbconfig configuration does not
# allow installation of remote databases
# Note: To overcome this issue, we could think to override the
# default setting by using dbc_remote_questions_default='true' in
# maintainer scripts but unfortunately this does not work due to
# current dbconfig design
# More information here:
# https://bugs.launchpad.net/ubuntu/+source/dbconfig-common/+bug/1065331
db_input high zoneminder/debconf_dbconfigerror || true
db_go || true
exit 0
fi
fi
# Ask the user for all database settings
dbc_go zoneminder $@
# Ask the user for the web server(s) to configure
db_input high zoneminder/webserver || true
db_go || true
# Ask the user for the password of the database administrator if the user
# has not yet answered to this question.
# This situation may occur if the user skipped the database creation step
# when reconfiguring the package.
RET=""
db_get zoneminder/mysql/admin-pass
if [ -z "$RET" ]; then
db_input high zoneminder/mysql/admin-pass || true
db_go || true
fi
# Do this only when not upgrading the package (no old version in argument)
if [ -z "$2" ]; then
# Ask for the password of 'admin' user
while :; do
RET=""
db_input high zoneminder/admin_password || true
db_go || true
db_get zoneminder/admin_password
# If password isn't empty we ask for password verification
if [ -z "$RET" ]; then
db_fset zoneminder/admin_password seen false
db_fset zoneminder/admin_password_again seen false
break
fi
ROOT_PW="$RET"
db_input high zoneminder/admin_password_again || true
db_go || true
db_get zoneminder/admin_password_again
if [ "$RET" = "$ROOT_PW" ]; then
ROOT_PW=""
break
fi
db_fset zoneminder/password_mismatch seen false
db_input critical zoneminder/password_mismatch || true
db_set zoneminder/admin_password ""
db_set zoneminder/admin_password_again ""
db_go || true
done
else
# If we are upgrading the package, set an empty password to disable
# password update in ZoneMinder database
db_set zoneminder/admin_password ""
fi
fi
#DEBHELPER#
exit 0

View File

@ -4,5 +4,5 @@ var/cache/zoneminder/events
var/cache/zoneminder/images var/cache/zoneminder/images
var/cache/zoneminder/temp var/cache/zoneminder/temp
usr/share/zoneminder/db usr/share/zoneminder/db
etc/zm/plugins.d usr/share/dbconfig-common/data/zoneminder/install
usr/share/zoneminder/plugins usr/share/dbconfig-common/data/zoneminder/upgrade/mysql

View File

@ -1,8 +1,19 @@
#! /bin/sh #! /bin/sh
# postinst maintainer script for zoneminder
set -e set -e
# Source the debconf stuff
. /usr/share/debconf/confmodule
# Source the config file if exists
CONFIGFILE=/etc/zm/zm.conf
if [ -e $CONFIGFILE ]; then
. $CONFIGFILE
fi
apache_install() { apache_install() {
mkdir -p /etc/apache2/conf-available mkdir -p /etc/apache2/conf-available
ln -sf ../../zm/apache.conf /etc/apache2/conf-available/zoneminder.conf ln -sf ../../zm/apache.conf /etc/apache2/conf-available/zoneminder.conf
@ -14,55 +25,156 @@ apache_install() {
elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then
[ -d /etc/apache2/conf.d/ ] && [ ! -L /etc/apache2/conf.d/zoneminder.conf ] && ln -s ../conf-available/zoneminder.conf /etc/apache2/conf.d/zoneminder.conf [ -d /etc/apache2/conf.d/ ] && [ ! -L /etc/apache2/conf.d/zoneminder.conf ] && ln -s ../conf-available/zoneminder.conf /etc/apache2/conf.d/zoneminder.conf
fi fi
# Enable CGI script module in apache (not enabled by default on jessie)
a2enmod cgi >/dev/null 2>&1
# Reload the web server
deb-systemd-invoke reload apache2.service || true
} }
if [ "$1" = "configure" ]; then mysql_update() {
if [ -e "/etc/init.d/mysql" ]; then
#
# Get mysql started if it isn't
#
if ! $(/etc/init.d/mysql status >/dev/null 2>&1); then
invoke-rc.d mysql start
fi
if $(/etc/init.d/mysql status >/dev/null 2>&1); then
mysqladmin --defaults-file=/etc/mysql/debian.cnf -f reload
# test if database if already present...
if ! $(echo quit | mysql --defaults-file=/etc/mysql/debian.cnf zm > /dev/null 2> /dev/null) ; then
cat /usr/share/zoneminder/db/zm_create.sql | mysql --defaults-file=/etc/mysql/debian.cnf
echo 'grant lock tables, alter,select,insert,update,delete on zm.* to 'zmuser'@localhost identified by "zmpass";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql
fi
deb-systemd-invoke stop zoneminder.service || true # Source the dbconfig stuff
zmupdate.pl --nointeractive . /usr/share/dbconfig-common/internal/mysql
else # Update the password of the hard-coded default 'admin' account
echo 'NOTE: mysql not running, please start mysql and run dpkg-reconfigure zoneminder when it is running.' test -z $ADMIN_PASSWORD || dbc_mysql_exec_command "UPDATE Users SET Password = password('$ADMIN_PASSWORD') WHERE Username = 'admin';" || true
fi
else # Update the database version
echo 'mysql not found, assuming remote server.' dbc_mysql_exec_command "UPDATE Config SET Value = '$DB_VERSION' WHERE Name = 'ZM_DYN_DB_VERSION';" || true
fi }
chown www-data:www-data /var/log/zm
chown www-data:www-data /var/lib/zm/ if [ -f /usr/share/dbconfig-common/dpkg/postinst ]; then
if [ -z "$2" ]; then
chown www-data:www-data -R /var/cache/zoneminder # Set the first version in which dbconfig-common was introduced in the package
fi dbc_first_version="1.28.0"
# Set the database type
dbc_dbtypes="mysql"
# Source the dbconfig-common stuff
. /usr/share/dbconfig-common/dpkg/postinst
fi fi
# Ensure zoneminder is stopped...
deb-systemd-invoke stop zoneminder.service || exit $?
if [ "$1" = "configure" ]; then # Do this when the package is installed, upgraded or reconfigured
if [ -z "$2" ]; then if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ]; then
chown www-data:www-data /var/log/zm
chown www-data:www-data /var/lib/zm/ # Install sql database create file for dbconfig
chown www-data:www-data -R /var/cache/zoneminder # (needed at first package installation)
else if [ ! -f /usr/share/dbconfig-common/data/zoneminder/install/mysql ]; then
chown www-data:www-data /var/log/zm install -m 644 /usr/share/zoneminder/db/zm_create.sql \
zmupdate.pl /usr/share/dbconfig-common/data/zoneminder/install/mysql
# Remove unneeded sql requests
# dbconfig will create the underlying database
sed -i "/^ *CREATE DATABASE /d" \
/usr/share/dbconfig-common/data/zoneminder/install/mysql
sed -i "/^ *USE /d" \
/usr/share/dbconfig-common/data/zoneminder/install/mysql
fi fi
# Symlink sql update files for dbconfig (needed when upgrading the package)
for sqlfile in /usr/share/zoneminder/db/zm_update-*.sql; do
lnk=`echo $sqlfile | sed "s/^\/usr\/share\/zoneminder\/db\/zm_update-\(.*\)\.sql/\1/"`
if [ ! -L /usr/share/dbconfig-common/data/zoneminder/upgrade/mysql/$lnk ]; then
ln -sf $sqlfile \
/usr/share/dbconfig-common/data/zoneminder/upgrade/mysql/$lnk
fi
done || true
# Create the underlying database and populate it
# dbconfig will take care of applying any updates which are newer than the
# previously installed version
dbc_go zoneminder $@
# Get the password of ZoneMinder user 'admin' from debconf
db_get zoneminder/admin_password
ADMIN_PASSWORD=$RET
# Remove the password from debconf database
test -z $ADMIN_PASSWORD || db_reset zoneminder/admin_password || true
# Get the lastest database version from dbconfig upgrade folder
DB_VERSION=$(ls -rv /usr/share/dbconfig-common/data/zoneminder/upgrade/$dbc_dbtypes | head -1)
# Update the default admin account and database version
mysql_update
# Retrieve data from dbconfig (inputs from user)
. /etc/dbconfig-common/zoneminder.conf
# ZoneMinder config file handling
# Inspired by: http://manpages.debian.org/cgi-bin/man.cgi?query=debconf-devel&sektion=7
# Backup the config file
cp -a -f $CONFIGFILE ${CONFIGFILE}.postinst.bak
# Redeclare variables if missing in config file
test -z $dbc_dbserver || grep -Eq "^ *ZM_DB_HOST=" $CONFIGFILE \
|| echo "ZM_DB_HOST=" >> ${CONFIGFILE}.postinst.bak
test -z $dbc_dbname || grep -Eq "^ *ZM_DB_NAME=" $CONFIGFILE \
|| echo "ZM_DB_NAME=" >> ${CONFIGFILE}.postinst.bak
test -z $dbc_dbuser || grep -Eq "^ *ZM_DB_USER=" $CONFIGFILE \
|| echo "ZM_DB_USER=" >> ${CONFIGFILE}.postinst.bak
test -z $dbc_dbpass || grep -Eq "^ *ZM_DB_PASS=" $CONFIGFILE \
|| echo "ZM_DB_PASS=" >> ${CONFIGFILE}.postinst.bak
# Prevent ZM_DB_HOST to be empty if user selected the 'unix socket' method
if test -z $dbc_dbserver; then
dbc_dbserver_override="localhost"
else
dbc_dbserver_override=$dbc_dbserver
fi
# Update variables in config file
sed -i "s/^ *ZM_DB_HOST=.*/ZM_DB_HOST=$dbc_dbserver_override/" \
${CONFIGFILE}.postinst.bak
test -z $dbc_dbname || sed -i "s/^ *ZM_DB_NAME=.*/ZM_DB_NAME=$dbc_dbname/" \
${CONFIGFILE}.postinst.bak
test -z $dbc_dbuser || sed -i "s/^ *ZM_DB_USER=.*/ZM_DB_USER=$dbc_dbuser/" \
${CONFIGFILE}.postinst.bak
test -z $dbc_dbpass || sed -i "s/^ *ZM_DB_PASS=.*/ZM_DB_PASS=$dbc_dbpass/" \
${CONFIGFILE}.postinst.bak
# Clean-up backup file
mv -f ${CONFIGFILE}.postinst.bak $CONFIGFILE
# Set some file permissions
chown $ZM_WEB_USER:$ZM_WEB_GROUP /var/log/zm
chown $ZM_WEB_USER:$ZM_WEB_GROUP /var/lib/zm
if [ -z "$2" ]; then
chown $ZM_WEB_USER:$ZM_WEB_GROUP -R /var/cache/zoneminder
fi
# As requested by the Debian Webapps Policy Manual §3.2.1
chown root:$ZM_WEB_GROUP /etc/zm/zm.conf
chmod 640 /etc/zm/zm.conf
# Configure the web server
db_get zoneminder/webserver
webservers="$RET"
for webserver in $webservers; do
webserver=${webserver%,}
# Currently we only support apache2
if [ "$webserver" = "apache2" ] ; then
apache_install $1 apache_install $1
a2enmod cgi >/dev/null 2>&1
if [ -f /etc/init.d/apache2 ] ; then
invoke-rc.d apache2 reload 3>/dev/null || true
fi fi
done
fi fi
# Do this every time the package is installed or upgraded
# Test for database presence to avoid failure of zmupdate.pl
if [ "$dbc_install" = "true" ] && [ "$1" = "configure" ]; then
# Ensure zoneminder is stopped
deb-systemd-invoke stop zoneminder.service || exit $?
# Run the ZoneMinder update tool
zmupdate.pl
fi
#DEBHELPER# #DEBHELPER#
exit 0

View File

@ -1,7 +1,13 @@
#! /bin/sh #! /bin/sh
# postrm maintainer script for zoneminder
set -e set -e
# Source the debconf stuff
if [ -f /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
fi
apache_remove() { apache_remove() {
COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true) COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true)
if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
@ -11,22 +17,62 @@ apache_remove() {
rm -f /etc/apache2/conf.d/zoneminder.conf rm -f /etc/apache2/conf.d/zoneminder.conf
fi fi
rm -f /etc/apache2/conf-available/zoneminder.conf rm -f /etc/apache2/conf-available/zoneminder.conf
# Reload the web server
deb-systemd-invoke reload apache2.service || true
} }
# Source the dbconfig stuff
if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then
. /usr/share/dbconfig-common/dpkg/postrm
# Ask the user what do to with dbconfig when removing the package
dbc_go zoneminder $@
fi
if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
# Deconfigure the web server
db_get zoneminder/webserver
for webserver in $RET; do
webserver=${webserver%,}
# Currently we only support apache2
if [ "$webserver" = "apache2" ] ; then
apache_remove $1 apache_remove $1
if [ -f /etc/init.d/apache2 ] ; then
invoke-rc.d apache2 reload 3>/dev/null || true
fi fi
done
# Remove dbconfig stuff added in postinst script
rm -rf /usr/share/dbconfig-common/data/zoneminder
# No need to manually remove the zm database, dbconfig take care of this
fi fi
if [ "$1" = "purge" ]; then if [ "$1" = "purge" ]; then
if [ -e "/etc/init.d/mysql" ]; then
echo 'delete from user where User="zmuser";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql # Delete a potential remaining file used in postinst script
echo 'delete from db where User="zmuser";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql rm -f /etc/zm/zm.conf.postinst.bak
mysqladmin --defaults-file=/etc/mysql/debian.cnf -f drop zm
else # Ask the user if we have to remove the cache directory even if not empty
echo 'mysql not found, assuming remote server.' if [ -d /var/cache/zoneminder ] \
&& [ ! $(find /var/cache/zoneminder -maxdepth 0 -type d -empty 2>/dev/null) ]; then
RET=""
db_input high zoneminder/ask_delete || true
db_go || true
db_get zoneminder/ask_delete
if [ "$RET" = "true" ]; then
RET=""
db_input high zoneminder/ask_delete_again || true
db_go || true
db_get zoneminder/ask_delete_again
if [ "$RET" = "true" ]; then
rm -rf /var/cache/zoneminder
fi
fi
fi fi
fi fi
#DEBHELPER# #DEBHELPER#
# postrm rm may freeze without that
db_stop
exit 0

View File

@ -1,4 +1,5 @@
#!/bin/sh #!/bin/sh
# preinst maintainer script for zoneminder
set -e set -e

View File

@ -0,0 +1,22 @@
#!/bin/sh
# prerm script for zoneminder
set -e
# Source the debconf stuff if file exists
if [ -f /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
fi
# If dbconfig-common is installed and has been used by zoneminder
if [ -f /usr/share/dbconfig-common/dpkg/prerm ] \
&& [ -f /etc/dbconfig-common/zoneminder.conf ]; then
# Source the dbconfig stuff
. /usr/share/dbconfig-common/dpkg/prerm
# Ask the user what do to with dbconfig before removing the package
dbc_go zoneminder $@
fi
# #DEBHELPER#
exit 0

View File

@ -4,14 +4,15 @@
[Unit] [Unit]
Description=ZoneMinder CCTV recording and security system Description=ZoneMinder CCTV recording and security system
After=network.target mysql.service apache2.service After=network.target mysql.service apache2.service
Requires=mysql.service apache2.service Requires=apache2.service
Wants=mysql.service
[Service] [Service]
User=www-data User=www-data
Type=forking Type=forking
ExecStart=/usr/bin/zmpkg.pl start ExecStart=/usr/bin/zmpkg.pl start
ExecReload=/usr/bin/zmpkg.pl restart ExecReload=/usr/bin/zmpkg.pl restart
ExecStop=/bin/bash -c '[[ "$(/usr/bin/pgrep zmdc.pl)" > 0 ]] && /usr/bin/zmpkg.pl stop' ExecStop=/usr/bin/zmpkg.pl stop
PIDFile=/var/run/zm/zm.pid PIDFile=/var/run/zm/zm.pid
[Install] [Install]

View File

@ -0,0 +1,86 @@
Template: zoneminder/debconf_dblocation
Type: select
__Choices: local, remote
Default: local
_Description: Database location:
A database server is required to run ZoneMinder. The database can be installed
either locally or remotely on a machine of your network.
.
If you choose a remote location, you will have to select the 'tcp/ip'
connection method and enter the hostname or ip address of the remote machine
in the next configuration screens.
Template: zoneminder/debconf_dblocalmissingerror
Type: error
_Description: No local database server is available:
Currently ZoneMinder supports mysql or mariadb database server but none of them
appears to be installed on this machine.
.
In order to complete ZoneMinder's installation, after ending of this assistant,
please install a compatible database server and then restart the assistant by
invoking:
.
$ sudo dpkg-reconfigure zoneminder
Template: zoneminder/debconf_dbconfigerror
Type: error
_Description: Remote database servers are not allowed:
The current configuration of dbconfig-common does not allow installation of
a database on remote servers.
.
In order to reconfigure dbconfig-common, please invoke the following command
after ending of this assistant:
.
$ sudo dpkg-reconfigure dbconfig-common
.
Then, to complete ZoneMinder's installation, please restart this assistant by
invoking:
.
$ sudo dpkg-reconfigure zoneminder
Template: zoneminder/webserver
Type: multiselect
Choices: apache2
Default: apache2
_Description: Web server to reconfigure automatically:
Please choose the web server that should be automatically configured for
ZoneMinder's web portal access.
Template: zoneminder/admin_password
Type: password
_Description: New password for the ZoneMinder 'admin' user:
Please enter the password of the default administrative user.
.
While not mandatory, it is highly recommended that you set a custom password
for the administrative 'admin' user.
.
If this field is left blank, the password will not be changed.
Template: zoneminder/admin_password_again
Type: password
_Description: Repeat password for the ZoneMinder 'admin' user:
Template: zoneminder/password_mismatch
Type: error
_Description: Password input error
The two passwords you entered were not the same. Please try again.
Template: zoneminder/ask_delete
Type: boolean
Default: false
_Description: Delete this non empty directory?
A purge of the ZoneMinder package is performed but the directory
'/var/cache/zoneminder' is not empty so it will not be deleted.
.
Please consider that this directory is designed to contain data resulting from
event detection. Therefore, "proof of evidence" could be lost!"
.
If you are not sure of your decision, please do not delete this directory but
perform a manual checkup.
Template: zoneminder/ask_delete_again
Type: boolean
Default: false
_Description: Deletion confirmed?
You have allowed the deletion of directory '/var/cache/zoneminder' although
it may contain critical data.

View File

@ -1,3 +1,9 @@
zoneminder (1.28.0+1-trusty-SNAPSHOT2014121201) trusty; urgency=medium
* Merge of security fixes and a few other things. See github for more info.
-- Isaac Connor <iconnor@connortechnology.com> Fri, 12 Dec 2014 16:38:36 -0500
zoneminder (1.28.0+1-utopic-SNAPSHOT2014112001) utopic; urgency=medium zoneminder (1.28.0+1-utopic-SNAPSHOT2014112001) utopic; urgency=medium
* Various fixes and developments since 1.28.0. Includes Digest-Auth for HTTP and better for RTSP * Various fixes and developments since 1.28.0. Includes Digest-Auth for HTTP and better for RTSP

View File

@ -2,14 +2,14 @@ Source: zoneminder
Section: net Section: net
Priority: optional Priority: optional
Maintainer: Isaac Connor <iconnor@connortechnology.com> Maintainer: Isaac Connor <iconnor@connortechnology.com>
Build-Depends: debhelper (>= 7.0.50), autoconf, automake, dpatch, libphp-serialization-perl, libgnutls-dev, libmysqlclient-dev | libmariadbclient-dev, libdbd-mysql-perl, libdate-manip-perl, libwww-perl, libjpeg8-dev, libpcre3-dev, libavcodec-dev, libavformat-dev (>= 3:0.svn20090204), libswscale-dev (>= 3:0.svn20090204), libavutil-dev, libv4l-dev (>= 0.8.3), libbz2-dev, libtool, libsys-mmap-perl, ffmpeg | libav-tools, libnetpbm10-dev, libavdevice-dev, libdevice-serialport-perl, libpcre3, libarchive-zip-perl, libmime-lite-perl, libjpeg8, dh-autoreconf, libvlccore-dev, libvlc-dev, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libgcrypt11-dev, libpolkit-gobject-1-dev Build-Depends: debhelper (>= 9), autoconf, automake, quilt, libphp-serialization-perl, libgnutls-dev, libmysqlclient-dev | libmariadbclient-dev, libdbd-mysql-perl, libdate-manip-perl, libwww-perl, libjpeg8-dev|libjpeg9-dev|libjpeg62-turbo-dev, libpcre3-dev, libavcodec-dev, libavformat-dev (>= 3:0.svn20090204), libswscale-dev (>= 3:0.svn20090204), libavutil-dev, libv4l-dev (>= 0.8.3), libbz2-dev, libtool, libsys-mmap-perl, ffmpeg | libav-tools, libnetpbm10-dev, libavdevice-dev, libdevice-serialport-perl, libpcre3, libarchive-zip-perl, libmime-lite-perl, dh-autoreconf, libvlccore-dev, libvlc-dev, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libgcrypt11-dev, libpolkit-gobject-1-dev
Standards-Version: 3.9.2 Standards-Version: 3.9.4
Package: zoneminder Package: zoneminder
Architecture: any Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice53 | libavdevice55, libjpeg8, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7 | libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0, liburi-encode-perl Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice53 | libavdevice55, libjpeg8|libjpeg9|libjpeg62-turbo, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7 | libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0, liburi-encode-perl
Recommends: mysql-server|mariadb-server Recommends: mysql-server|mariadb-server
Description: A video camera security and surveillance solution Description: Video camera security and surveillance solution
ZoneMinder is intended for use in single or multi-camera video security ZoneMinder is intended for use in single or multi-camera video security
applications, including commercial or home CCTV, theft prevention and child applications, including commercial or home CCTV, theft prevention and child
or family member or home monitoring and other care scenarios. It or family member or home monitoring and other care scenarios. It
@ -22,11 +22,11 @@ Description: A video camera security and surveillance solution
via X.10 or other protocols. via X.10 or other protocols.
Package: zoneminder-dbg Package: zoneminder-dbg
Section: debug
Priority: extra
Architecture: any Architecture: any
Depends: Depends: zoneminder (= ${binary:Version}), ${misc:Depends}
zoneminder (= ${binary:Version}), Description: Debugging symbols for zoneminder.
${misc:Depends}
Description: debugging syumbols for zoneminder.
ZoneMinder is a video camera security and surveillance solution. ZoneMinder is a video camera security and surveillance solution.
ZoneMinder is intended for use in single or multi-camera video security ZoneMinder is intended for use in single or multi-camera video security
applications, including commercial or home CCTV, theft prevention and child applications, including commercial or home CCTV, theft prevention and child

View File

@ -0,0 +1,12 @@
usr/bin
usr/lib/cgi-bin
usr/share/man
usr/share/perl5/ZoneMinder
usr/share/perl5/ZoneMinder.pm
usr/share/polkit-1/actions
usr/share/polkit-1/rules.d
usr/share/zoneminder
etc/zm
db/zm_create.sql usr/share/zoneminder/db
db/zm_update-*.sql usr/share/zoneminder/db
debian/apache.conf etc/zm

4
distros/ubuntu1204/links Normal file
View File

@ -0,0 +1,4 @@
var/cache/zoneminder/events usr/share/zoneminder/events
var/cache/zoneminder/images usr/share/zoneminder/images
var/cache/zoneminder/temp usr/share/zoneminder/temp
usr/lib/cgi-bin usr/share/zoneminder/cgi-bin

View File

@ -0,0 +1,17 @@
Index: ZoneMinder/configure.ac
===================================================================
--- ZoneMinder.orig/configure.ac 2014-12-13 15:10:27.705191682 +0100
+++ ZoneMinder/configure.ac 2014-12-13 16:50:07.101049743 +0100
@@ -443,10 +443,10 @@
PERL_SITE_LIB=`perl -V:installsitelib | sed -e "s/.*='\(.*\)';/\1/"`
PERL_LIB_PATH=`echo $PERL_SITE_LIB | sed -e "s|^$PERL_SITE_PREFIX||"`
EXTRA_PERL_LIB="use lib '$prefix$PERL_LIB_PATH'; # Include custom perl install path"
- PERL_MM_PARMS="PREFIX=$prefix"
+ PERL_MM_PARMS="\"PREFIX=$prefix INSTALLDIRS=vendor\""
else
EXTRA_PERL_LIB="# Include from system perl paths only"
- PERL_MM_PARMS=
+ PERL_MM_PARMS="\"INSTALLDIRS=vendor\""
fi
AC_SUBST(PERL_MM_PARMS)
AC_SUBST(EXTRA_PERL_LIB)

View File

@ -0,0 +1 @@
01_vendor-perl.diff

View File

@ -25,10 +25,10 @@ else
endif endif
%: %:
dh $@ --with autoreconf dh $@ --with quilt,autoreconf
override_dh_auto_configure: override_dh_auto_configure:
CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --sysconfdir=/etc/zm --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --with-mysql=/usr --with-mariadb=/usr --with-webdir=/usr/share/zoneminder --with-ffmpeg=/usr --with-cgidir=/usr/lib/cgi-bin --with-webuser=www-data --with-webgroup=www-data --enable-crashtrace=no --enable-mmap=yes CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" dh_auto_configure -- --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --sysconfdir=/etc/zm --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --with-mysql=/usr --with-mariadb=/usr --with-webdir=/usr/share/zoneminder --with-ffmpeg=/usr --with-cgidir=/usr/lib/cgi-bin --with-webuser=www-data --with-webgroup=www-data --enable-crashtrace=no --enable-mmap=yes
override_dh_clean: override_dh_clean:
# Add here commands to clean up after the build process. # Add here commands to clean up after the build process.
@ -36,20 +36,16 @@ override_dh_clean:
dh_clean dh_clean
override_dh_install: override_dh_install:
# Add here commands to install the package into debian/zm. dh_install --fail-missing
$(MAKE) install DESTDIR=$(CURDIR)/debian/zoneminder RUNDIR=$(CURDIR)/debian/zoneminder/var/run ZM_RUNDIR=$(CURDIR)/debian/zoneminder/var/run
install -D -m 0644 db/zm_create.sql $(CURDIR)/debian/zoneminder/usr/share/zoneminder/db
install -D -m 0644 db/zm_update-*.sql $(CURDIR)/debian/zoneminder/usr/share/zoneminder/db
install -D -m 0644 debian/apache.conf $(CURDIR)/debian/zoneminder/etc/zm
# #
# NOTE: This is a short-term kludge; hopefully changes in the next # NOTE: This is a short-term kludge; hopefully changes in the next
# upstream version will render this unnecessary. # upstream version will render this unnecessary.
rm -rf debian/zoneminder/usr/share/zoneminder/events rm -rf debian/zoneminder/usr/share/zoneminder/events
rm -rf debian/zoneminder/usr/share/zoneminder/images rm -rf debian/zoneminder/usr/share/zoneminder/images
rm -rf debian/zoneminder/usr/share/zoneminder/temp rm -rf debian/zoneminder/usr/share/zoneminder/temp
ln -s /var/cache/zoneminder/events debian/zoneminder/usr/share/zoneminder/ dh_link var/cache/zoneminder/events usr/share/zoneminder/events
ln -s /var/cache/zoneminder/images debian/zoneminder/usr/share/zoneminder/ dh_link var/cache/zoneminder/images usr/share/zoneminder/images
ln -s /var/cache/zoneminder/temp debian/zoneminder/usr/share/zoneminder/ dh_link var/cache/zoneminder/temp usr/share/zoneminder/temp
# #
# This is a slightly lesser kludge; moving the cgi stuff to # This is a slightly lesser kludge; moving the cgi stuff to
@ -57,7 +53,7 @@ override_dh_install:
# having it just in /usr/lib/cgi-bin breaks another bit of # having it just in /usr/lib/cgi-bin breaks another bit of
# behavior. # behavior.
# #
ln -s /usr/lib/cgi-bin debian/zoneminder/usr/share/zoneminder/ dh_link usr/lib/cgi-bin usr/share/zoneminder/cgi-bin
override_dh_fixperms: override_dh_fixperms:
dh_fixperms dh_fixperms

View File

@ -92,6 +92,22 @@ our %types =
our @options = our @options =
( (
{
name => "ZM_SKIN_DEFAULT",
default => "classic",
description => "Default skin used by web interface",
help => "ZoneMinder allows the use of many different web interfaces. This option allows you to set the default skin used by the website. Users can change their skin later, this merely sets the default.",
type => $types{string},
category => "system",
},
{
name => "ZM_CSS_DEFAULT",
default => "classic",
description => "Default set of css files used by web interface",
help => "ZoneMinder allows the use of many different web interfaces, and some skins allow the use of different set of CSS files to control the appearance. This option allows you to set the default set of css files used by the website. Users can change their css later, this merely sets the default.",
type => $types{string},
category => "system",
},
{ {
name => "ZM_LANG_DEFAULT", name => "ZM_LANG_DEFAULT",
default => "en_gb", default => "en_gb",

View File

@ -33,7 +33,7 @@ use Getopt::Long;
use POSIX qw/strftime EPIPE/; use POSIX qw/strftime EPIPE/;
use Socket; use Socket;
#use Data::Dumper; #use Data::Dumper;
use Module::Load; use Module::Load::Conditional qw{can_load};;
use constant MAX_CONNECT_DELAY => 10; use constant MAX_CONNECT_DELAY => 10;
use constant MAX_COMMAND_WAIT => 1800; use constant MAX_COMMAND_WAIT => 1800;
@ -129,6 +129,10 @@ if ( !$server_up )
Info( "Starting control server $id/$protocol" ); Info( "Starting control server $id/$protocol" );
close( CLIENT ); close( CLIENT );
if ( ! can_load( modules => { "ZoneMinder::Control::$protocol" => undef } ) ) {
Fatal("Can't load ZoneMinder::Control::$protocol");
}
if ( my $cpid = fork() ) if ( my $cpid = fork() )
{ {
logReinit(); logReinit();
@ -156,8 +160,6 @@ if ( !$server_up )
$0 = $0." --id $id"; $0 = $0." --id $id";
load "ZoneMinder::Control::$protocol";
my $control = "ZoneMinder::Control::$protocol"->new( $id ); my $control = "ZoneMinder::Control::$protocol"->new( $id );
my $control_key = $control->getKey(); my $control_key = $control->getKey();
$control->loadMonitor(); $control->loadMonitor();

12
scripts/zmfilter.pl.in Normal file → Executable file
View File

@ -275,7 +275,7 @@ sub getFilters
{ {
Debug( "Found filter '$db_filter->{Name}'\n" ); Debug( "Found filter '$db_filter->{Name}'\n" );
my $filter_expr = jsonDecode( $db_filter->{Query} ); my $filter_expr = jsonDecode( $db_filter->{Query} );
my $sql = "select E.Id,E.MonitorId,M.Name as MonitorName,M.DefaultRate,M.DefaultScale,E.Name,E.Cause,E.Notes,E.StartTime,unix_timestamp(E.StartTime) as Time,E.Length,E.Frames,E.AlarmFrames,E.TotScore,E.AvgScore,E.MaxScore,E.Archived,E.Videoed,E.Uploaded,E.Emailed,E.Messaged,E.Executed from Events as E inner join Monitors as M on M.Id = E.MonitorId where not isnull(E.EndTime)"; my $sql = "select E.Id,E.MonitorId,M.Name as MonitorName,M.DefaultRate,M.DefaultScale,E.Name,E.Cause,E.Notes,E.StartTime,unix_timestamp(E.StartTime) as Time,E.Length,E.Frames,E.AlarmFrames,E.TotScore,E.AvgScore,E.MaxScore,E.Archived,E.Videoed,E.Uploaded,E.Emailed,E.Messaged,E.Executed from Events as E inner join Monitors as M on M.Id = E.MonitorId";
$db_filter->{Sql} = ''; $db_filter->{Sql} = '';
if ( @{$filter_expr->{terms}} ) if ( @{$filter_expr->{terms}} )
@ -414,8 +414,18 @@ sub getFilters
} }
if ( $db_filter->{Sql} ) if ( $db_filter->{Sql} )
{ {
if ( $db_filter->{AutoMessage} )
{
# Include all events, including events that are still ongoing
# and have no EndTime yet
$sql .= " and ( ".$db_filter->{Sql}." )"; $sql .= " and ( ".$db_filter->{Sql}." )";
} }
else
{
# Only include closed events (events with valid EndTime)
$sql .= " where not isnull(E.EndTime) and ( ".$db_filter->{Sql}." )";
}
}
my @auto_terms; my @auto_terms;
if ( $db_filter->{AutoArchive} ) if ( $db_filter->{AutoArchive} )
{ {

View File

@ -141,7 +141,7 @@ sub Track
my ( $detaint_x ) = $x =~ /^(\d+)$/; $x = $detaint_x; my ( $detaint_x ) = $x =~ /^(\d+)$/; $x = $detaint_x;
my ( $detaint_y ) = $y =~ /^(\d+)$/; $y = $detaint_y; my ( $detaint_y ) = $y =~ /^(\d+)$/; $y = $detaint_y;
my $ctrlCommand = ZM_PATH_BIN."/zmcontrol.pl -i ".$monitor->{Id}; my $ctrlCommand = $Config{ZM_PATH_BIN}."/zmcontrol.pl -i ".$monitor->{Id};
$ctrlCommand .= " --command=".($monitor->{CanMoveMap}?"moveMap":"movePseudoMap")." --xcoord=$x --ycoord=$y"; $ctrlCommand .= " --command=".($monitor->{CanMoveMap}?"moveMap":"movePseudoMap")." --xcoord=$x --ycoord=$y";
executeShellCommand( $ctrlCommand ); executeShellCommand( $ctrlCommand );
} }
@ -150,7 +150,7 @@ sub Return
{ {
my $monitor = shift; my $monitor = shift;
my $ctrlCommand = ZM_PATH_BIN."/zmcontrol.pl -i ".$monitor->{Id}; my $ctrlCommand = $Config{ZM_PATH_BIN}."/zmcontrol.pl -i ".$monitor->{Id};
if ( $monitor->{ReturnLocation} > 0 ) if ( $monitor->{ReturnLocation} > 0 )
{ {
$ctrlCommand .= " --command=presetGoto --preset=".$monitor->{ReturnLocation}; $ctrlCommand .= " --command=presetGoto --preset=".$monitor->{ReturnLocation};

View File

@ -60,6 +60,8 @@ if ( isset($_GET['skin']) )
$skin = $_GET['skin']; $skin = $_GET['skin'];
elseif ( isset($_COOKIE['zmSkin']) ) elseif ( isset($_COOKIE['zmSkin']) )
$skin = $_COOKIE['zmSkin']; $skin = $_COOKIE['zmSkin'];
elseif ( ZM_SKIN_DEFAULT )
$skin = ZM_SKIN_DEFAULT;
else else
$skin = "classic"; $skin = "classic";
@ -67,6 +69,8 @@ if ( isset($_GET['css']) )
$css = $_GET['css']; $css = $_GET['css'];
elseif ( isset($_COOKIE['zmCSS']) ) elseif ( isset($_COOKIE['zmCSS']) )
$css = $_COOKIE['zmCSS']; $css = $_COOKIE['zmCSS'];
elseif (ZM_CSS_DEFAULT)
$css = ZM_CSS_DEFAULT;
else else
$css = "classic"; $css = "classic";
@ -122,6 +126,11 @@ foreach ( getSkinIncludes( 'skin.php' ) as $includeFile )
require_once( 'includes/actions.php' ); require_once( 'includes/actions.php' );
# If I put this here, it protects all views and popups, but it has to go after actions.php because actions.php does the actual logging in.
if ( ZM_OPT_USE_AUTH && ! isset($user) && $view != 'login' ) {
$view = 'login';
}
if ( isset( $_REQUEST['request'] ) ) if ( isset( $_REQUEST['request'] ) )
{ {
foreach ( getSkinIncludes( 'ajax/'.$request.'.php', true, true ) as $includeFile ) foreach ( getSkinIncludes( 'ajax/'.$request.'.php', true, true ) as $includeFile )
@ -142,7 +151,18 @@ else
Fatal( "View '$view' does not exist" ); Fatal( "View '$view' does not exist" );
require_once $includeFile; require_once $includeFile;
} }
// If the view overrides $view to 'error', and the user is not logged in, then the
// issue is probably resolvable by logging in, so provide the opportunity to do so.
// The login view should handle redirecting to the correct location afterward.
if ( $view == 'error' && !isset($user) )
{
$view = 'login';
foreach ( getSkinIncludes( 'views/login.php', true, true ) as $includeFile )
require_once $includeFile;
} }
}
// If the view is missing or the view still returned error with the user logged in,
// then it is not recoverable.
if ( !$includeFiles || $view == 'error' ) if ( !$includeFiles || $view == 'error' )
{ {
foreach ( getSkinIncludes( 'views/error.php', true, true ) as $includeFile ) foreach ( getSkinIncludes( 'views/error.php', true, true ) as $includeFile )

View File

@ -18,11 +18,6 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// //
if ( ZM_OPT_USE_AUTH && ! isset($user) ) {
$view = "error";
return;
}
$eventCounts = array( $eventCounts = array(
array( array(
"title" => $SLANG['Events'], "title" => $SLANG['Events'],

View File

@ -205,7 +205,7 @@ foreach ( $events as $event )
<td class="colMonitorName"><?php echo $event['MonitorName'] ?></td> <td class="colMonitorName"><?php echo $event['MonitorName'] ?></td>
<td class="colCause"><?php echo makePopupLink( '?view=eventdetail&amp;eid='.$event['Id'], 'zmEventDetail', 'eventdetail', validHtmlStr($event['Cause']), canEdit( 'Events' ), 'title="'.htmlspecialchars($event['Notes']).'"' ) ?></td> <td class="colCause"><?php echo makePopupLink( '?view=eventdetail&amp;eid='.$event['Id'], 'zmEventDetail', 'eventdetail', validHtmlStr($event['Cause']), canEdit( 'Events' ), 'title="'.htmlspecialchars($event['Notes']).'"' ) ?></td>
<td class="colTime"><?php echo strftime( STRF_FMT_DATETIME_SHORTER, strtotime($event['StartTime']) ) ?></td> <td class="colTime"><?php echo strftime( STRF_FMT_DATETIME_SHORTER, strtotime($event['StartTime']) ) ?></td>
<td class="colDuration"><?php echo $event['Length'] ?></td> <td class="colDuration"><?php echo gmdate("H:i:s", $event['Length'] ) ?></td>
<td class="colFrames"><?php echo makePopupLink( '?view=frames&amp;eid='.$event['Id'], 'zmFrames', 'frames', $event['Frames'] ) ?></td> <td class="colFrames"><?php echo makePopupLink( '?view=frames&amp;eid='.$event['Id'], 'zmFrames', 'frames', $event['Frames'] ) ?></td>
<td class="colAlarmFrames"><?php echo makePopupLink( '?view=frames&amp;eid='.$event['Id'], 'zmFrames', 'frames', $event['AlarmFrames'] ) ?></td> <td class="colAlarmFrames"><?php echo makePopupLink( '?view=frames&amp;eid='.$event['Id'], 'zmFrames', 'frames', $event['AlarmFrames'] ) ?></td>
<td class="colTotScore"><?php echo $event['TotScore'] ?></td> <td class="colTotScore"><?php echo $event['TotScore'] ?></td>

View File

@ -33,9 +33,7 @@ dist_web_DATA = \
montage.js \ montage.js \
montage.js.php \ montage.js.php \
options.js.php \ options.js.php \
plugin.js \ postlogin.js.php \
plugin.js.php \
postlogin.js \
state.js \ state.js \
state.js.php \ state.js.php \
timeline.js \ timeline.js \

View File

@ -1 +0,0 @@
(function () { window.location.replace( thisUrl ); }).delay( 500 );

View File

@ -0,0 +1,23 @@
<?php
// $thisUrl is the base URL used to access ZoneMinder.
//
// If the user attempts to access a privileged view but is not logged in, then he may
// be given the opportunity to log in via the login view. In that case, the login view
// will save the GET request via the postLoginQuery variable. After logging in, this
// view receives the postLoginQuery via the login form submission, and we can then
// redirect the user to his original intended destination by appending it to the URL.
?>
(
function ()
{
// Append '?(GET query)' to URL if the GET query is not empty.
var querySuffix = "<?php
if (!empty($_POST["postLoginQuery"]))
echo "?".$_POST["postLoginQuery"];
?>";
var newUrl = thisUrl + querySuffix;
window.location.replace(newUrl);
}
).delay( 500 );

View File

@ -29,6 +29,7 @@ xhtmlHeaders(__FILE__, $SLANG['Login'] );
<form name="loginForm" id="loginForm" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>"> <form name="loginForm" id="loginForm" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
<input type="hidden" name="action" value="login"/> <input type="hidden" name="action" value="login"/>
<input type="hidden" name="view" value="postlogin"/> <input type="hidden" name="view" value="postlogin"/>
<input type="hidden" name="postLoginQuery" value="<?php echo $_SERVER['QUERY_STRING'] ?>">
<table id="loginTable" class="minor" cellspacing="0"> <table id="loginTable" class="minor" cellspacing="0">
<tbody> <tbody>
<tr> <tr>

View File

@ -81,6 +81,7 @@ foreach ( $tabs as $name=>$value )
</ul> </ul>
<div class="clear"></div> <div class="clear"></div>
<?php <?php
$skin_options = array_map( 'basename', glob('skins/*',GLOB_ONLYDIR) );
if($tab == 'skins') { if($tab == 'skins') {
$current_skin = $_COOKIE['zmSkin']; $current_skin = $_COOKIE['zmSkin'];
$reload = false; $reload = false;
@ -95,6 +96,7 @@ if($tab == 'skins') {
//header("Location: index.php?view=options&tab=skins&reset_parent=1"); //header("Location: index.php?view=options&tab=skins&reset_parent=1");
$reload = true; $reload = true;
} }
if ( $reload ) if ( $reload )
echo "<script type=\"text/javascript\">window.opener.location.reload();window.location.href=\"{$_SERVER['PHP_SELF']}?view={$view}&tab={$tab}\"</script>"; echo "<script type=\"text/javascript\">window.opener.location.reload();window.location.href=\"{$_SERVER['PHP_SELF']}?view={$view}&tab={$tab}\"</script>";
@ -110,8 +112,7 @@ if($tab == 'skins') {
<td><?php echo $SLANG['SkinDescription']; ?></td> <td><?php echo $SLANG['SkinDescription']; ?></td>
<td><select name="skin-choice"> <td><select name="skin-choice">
<?php <?php
foreach(glob('skins/*',GLOB_ONLYDIR) as $dir) { foreach($skin_options as $dir) {
$dir = basename($dir);
echo '<option value="'.$dir.'" '.($current_skin==$dir ? 'SELECTED="SELECTED"' : '').'>'.$dir.'</option>'; echo '<option value="'.$dir.'" '.($current_skin==$dir ? 'SELECTED="SELECTED"' : '').'>'.$dir.'</option>';
} }
?> ?>
@ -123,8 +124,7 @@ if($tab == 'skins') {
<td><?php echo $SLANG['CSSDescription']; ?></td> <td><?php echo $SLANG['CSSDescription']; ?></td>
<td><select name="css-choice"> <td><select name="css-choice">
<?php <?php
foreach(glob('skins/'.$current_skin.'/css/*',GLOB_ONLYDIR) as $dir) { foreach( array_map( 'basename', glob('skins/'.$current_skin.'/css/*',GLOB_ONLYDIR) ) as $dir) {
$dir = basename($dir);
echo '<option value="'.$dir.'" '.($current_css==$dir ? 'SELECTED="SELECTED"' : '').'>'.$dir.'</option>'; echo '<option value="'.$dir.'" '.($current_css==$dir ? 'SELECTED="SELECTED"' : '').'>'.$dir.'</option>';
} }
?> ?>
@ -208,12 +208,12 @@ elseif ( $tab == "users" )
</div> </div>
</form> </form>
<?php <?php
} } else {
else if ( $tab == "system" ) {
{
if ( $tab == "system" )
{
$configCats[$tab]['ZM_LANG_DEFAULT']['Hint'] = join( '|', getLanguages() ); $configCats[$tab]['ZM_LANG_DEFAULT']['Hint'] = join( '|', getLanguages() );
$configCats[$tab]['ZM_SKIN_DEFAULT']['Hint'] = join( '|', $skin_options );
$configCats[$tab]['ZM_CSS_DEFAULT']['Hint'] = join( '|', array_map ( 'basename', glob('skins/'.ZM_SKIN_DEFAULT.'/css/*',GLOB_ONLYDIR) ) );
} }
?> ?>
<form name="optionsForm" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>"> <form name="optionsForm" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">

View File

@ -23,6 +23,10 @@ if ( !canView( 'Stream' ) )
$view = "error"; $view = "error";
return; return;
} }
if ( ! visibleMonitor( $_REQUEST['mid'] ) ) {
$view = "error";
return;
}
$sql = 'SELECT C.*, M.* FROM Monitors AS M LEFT JOIN Controls AS C ON (M.ControlId = C.Id ) WHERE M.Id = ?'; $sql = 'SELECT C.*, M.* FROM Monitors AS M LEFT JOIN Controls AS C ON (M.ControlId = C.Id ) WHERE M.Id = ?';
$monitor = dbFetchOne( $sql, NULL, array( $_REQUEST['mid'] ) ); $monitor = dbFetchOne( $sql, NULL, array( $_REQUEST['mid'] ) );