diff --git a/.gitignore b/.gitignore index fa066279c..bd66e684a 100644 --- a/.gitignore +++ b/.gitignore @@ -63,7 +63,6 @@ src/zma src/zmc src/zmf src/zms -src/zmstreamer src/zmu web/includes/config.php zm.conf diff --git a/.travis.yml b/.travis.yml index d44973e2e..835f267f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,6 @@ env: - CXXFLAGS="$CFLAGS" matrix: - ZM_BUILDMETHOD=cmake - - ZM_BUILDMETHOD=autotools compiler: - gcc before_install: @@ -32,16 +31,10 @@ install: - sudo make install-libs before_script: - cd $TRAVIS_BUILD_DIR - - if [ "$ZM_BUILDMETHOD" = "autotools" ]; then libtoolize -v --force; fi - - if [ "$ZM_BUILDMETHOD" = "autotools" ]; then aclocal -I m4; fi - - if [ "$ZM_BUILDMETHOD" = "autotools" ]; then autoheader; fi - - if [ "$ZM_BUILDMETHOD" = "autotools" ]; then automake --force-missing --add-missing; fi - - if [ "$ZM_BUILDMETHOD" = "autotools" ]; then autoconf; fi - mysql -uroot -e "CREATE DATABASE IF NOT EXISTS zm" - mysql -uroot -e "GRANT ALL ON zm.* TO 'zmuser'@'localhost' IDENTIFIED BY 'zmpass'"; - mysql -uroot -e "FLUSH PRIVILEGES" script: - - if [ "$ZM_BUILDMETHOD" = "autotools" ]; then ./configure --prefix=/usr --with-libarch=lib/$DEB_HOST_GNU_TYPE --host=$DEB_HOST_GNU_TYPE --build=$DEB_BUILD_GNU_TYPE --with-mysql=/usr --with-ffmpeg=/usr --with-webdir=/usr/share/zoneminder/www --with-cgidir=/usr/libexec/zoneminder/cgi-bin --with-webuser=www-data --with-webgroup=www-data --enable-crashtrace=yes --disable-debug --enable-mmap=yes ZM_SSL_LIB=openssl; fi - if [ "$ZM_BUILDMETHOD" = "cmake" ]; then cmake -DCMAKE_INSTALL_PREFIX="/usr"; fi - make - sudo make install diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 62f767e75..000000000 --- a/Makefile.am +++ /dev/null @@ -1,40 +0,0 @@ -AUTOMAKE_OPTIONS = foreign -ACLOCAL_AMFLAGS = -I m4 - -# And these to the user and group of your webserver -webuser = @WEB_USER@ -webgroup = @WEB_GROUP@ -zmconfigdir = @ZM_CONFIG_DIR@ - -zmconfig_DATA = \ - zm.conf - -if COND_ONVIF - MAYBE_ONVIF = onvif -endif - -SUBDIRS = \ - src \ - web \ - scripts \ - db \ - misc \ - $(MAYBE_ONVIF) - -EXTRA_DIST = \ - zm.conf.in \ - zmconfgen.pl.in - -# Yes, you are correct. This is a HACK! -install-data-hook: - ( cd $(DESTDIR)$(zmconfigdir); chown $(webuser):$(webgroup) $(zmconfig_DATA); chmod 600 $(zmconfig_DATA) ) - ( if ! test -e $(DESTDIR)$(ZM_RUNDIR); then mkdir -p $(DESTDIR)$(ZM_RUNDIR); fi; if test "$(DESTDIR)$(ZM_RUNDIR)" != "/var/run"; then chown $(webuser):$(webgroup) $(DESTDIR)$(ZM_RUNDIR); chmod u+w $(DESTDIR)$(ZM_RUNDIR); fi ) - ( if ! test -e $(DESTDIR)$(ZM_SOCKDIR); then mkdir -p $(DESTDIR)$(ZM_SOCKDIR); fi; if test "$(DESTDIR)$(ZM_SOCKDIR)" != "/var/run"; then chown $(webuser):$(webgroup) $(DESTDIR)$(ZM_SOCKDIR); chmod u+w $(DESTDIR)$(ZM_SOCKDIR); fi ) - ( if ! test -e $(DESTDIR)$(ZM_TMPDIR); then mkdir -m 700 -p $(DESTDIR)$(ZM_TMPDIR); fi; if test "$(DESTDIR)$(ZM_TMPDIR)" != "/tmp" && test "$(DESTDIR)$(ZM_TMPDIR)" != "/var/tmp"; then chown $(webuser):$(webgroup) $(DESTDIR)$(ZM_TMPDIR); chmod u+w $(DESTDIR)$(ZM_TMPDIR); fi ) - -uninstall-hook: - @-( cd $(DESTDIR)$(webdir); rm -rf events graphics images sounds temp ) - @-( if test "$(DESTDIR)$(ZM_RUNDIR)" != "/var/run"; then rm -rf $(DESTDIR)$(ZM_RUNDIR); fi ) - @-( if test "$(DESTDIR)$(ZM_SOCKDIR)" != "/var/run"; then rm -rf $(DESTDIR)$(ZM_SOCKDIR); fi ) - @-( if test "$(DESTDIR)$(ZM_TMPDIR)" != "/tmp" && test "$(DESTDIR)$(ZM_TMPDIR)" != "/var/tmp"; then rm -rf $(DESTDIR)$(ZM_TMPDIR); fi ) - @-( if test "$(DESTDIR)$(ZM_LOGDIR)" != "/var/log"; then rm -rf $(DESTDIR)$(ZM_LOGDIR); fi ) diff --git a/acinclude.m4 b/acinclude.m4 deleted file mode 100644 index 605842149..000000000 --- a/acinclude.m4 +++ /dev/null @@ -1,74 +0,0 @@ -AC_DEFUN([AC_DEFINE_DIR], [ - prefix_NONE= - exec_prefix_NONE= - test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix - test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix -dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn -dnl refers to ${prefix}. Thus we have to use `eval' twice. - eval ac_define_dir="\"[$]$2\"" - eval ac_define_dir="\"$ac_define_dir\"" - AC_SUBST($1, "$ac_define_dir") - AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3]) - test "$prefix_NONE" && prefix=NONE - test "$exec_prefix_NONE" && exec_prefix=NONE -]) - -AC_DEFUN([AC_PROG_PERL_VERSION],[dnl -# Make sure we have perl -if test -z "$PERL"; then -AC_CHECK_PROG(PERL,perl,perl) -fi - -# Check if version of Perl is sufficient -ac_perl_version="$1" - -if test "x$PERL" != "x"; then - AC_MSG_CHECKING(for perl version greater than or equal to $ac_perl_version) - # NB: It would be nice to log the error if there is one, but we cannot rely - # on autoconf internals - $PERL -e "use $ac_perl_version;" > /dev/null 2>&1 - if test $? -ne 0; then - AC_MSG_RESULT(no); - $3 - else - AC_MSG_RESULT(ok); - $2 - fi -else - AC_MSG_WARN(could not find perl) -fi -])dnl - -AC_DEFUN([AC_PROG_PERL_MODULES],[dnl -ac_perl_modules="$1" -# Make sure we have perl -if test -z "$PERL"; then -AC_CHECK_PROG(PERL,perl,perl) -fi - -if test "x$PERL" != x; then - ac_perl_modules_failed=0 - for ac_perl_module in $ac_perl_modules; do - AC_MSG_CHECKING(for perl module $ac_perl_module) - - # Would be nice to log result here, but can't rely on autoconf internals - $PERL "-M$ac_perl_module" -e exit > /dev/null 2>&1 - if test $? -ne 0; then - AC_MSG_RESULT(no); - ac_perl_modules_failed=1 - else - AC_MSG_RESULT(ok); - fi - done - - # Run optional shell commands - if test "$ac_perl_modules_failed" = 0; then - : - $2 - else - : - $3 - fi -else - AC_MSG_WARN(could not find perl) -fi])dnl diff --git a/bootstrap.sh b/bootstrap.sh deleted file mode 100755 index 0bc041f18..000000000 --- a/bootstrap.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -aclocal -I m4 -autoheader -automake --add-missing -autoconf diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 503ac1afb..000000000 --- a/configure.ac +++ /dev/null @@ -1,512 +0,0 @@ -# -# Building ZoneMinder via Autotools will be depreciated soon -# For instructions on building with cmake, please see INSTALL -# -AC_PREREQ(2.59) -AC_INIT(zm,1.29.0,[http://www.zoneminder.com/forums/ - Please check FAQ first],zoneminder,http://www.zoneminder.com/downloads.html) -AM_INIT_AUTOMAKE -AC_CONFIG_SRCDIR(src/zm.h) -AC_CONFIG_HEADERS(config.h) -AC_CONFIG_MACRO_DIR([m4]) - -AC_SUBST([AM_CXXFLAGS], [-D__STDC_CONSTANT_MACROS]) - -AC_SUBST(VERSION) -# -# Platform specific setup -# -############################# -AC_CANONICAL_HOST -# Check for which host we are on and setup a few things -# specifically based on the host -case $host_os in - darwin* ) - # Do something specific for mac - HOST_OS='darwin' - ;; - linux*) - # Do something specific for linux - HOST_OS='linux' - ;; - *BSD*) - # Do something specific for BSD - HOST_OS='BSD' - AC_DEFINE(BSD,1,"This is a BSD system") - ;; - *bsd*) - # Do something specific for BSD - HOST_OS='BSD' - AC_DEFINE(BSD,1,"This is a BSD system") - ;; - *solaris*) - # Do something specific for Solaris - HOST_OS='solaris' - AC_DEFINE(SOLARIS,1,"We are running a Solaroid OS [tested on OmniOS]") - ;; - *) - #Default Case - AC_MSG_ERROR([Your platform is not currently supported]) - ;; -esac - -AC_SUBST(HOST_OS) - -AC_ARG_VAR(ZM_DB_TYPE,[Type of the ZoneMinder database, default mysql]) -AC_ARG_VAR(ZM_DB_HOST,[Hostname where ZoneMinder database located, default localhost]) -AC_ARG_VAR(ZM_DB_NAME,[Name of ZoneMinder database, default zm]) -AC_ARG_VAR(ZM_DB_USER,[Name of ZoneMinder database user, default zmuser]) -AC_ARG_VAR(ZM_DB_PASS,[Password of ZoneMinder database user, default zmpass]) -AC_ARG_VAR(ZM_SSL_LIB,[Library to use for ssl functions, default gnutls]) -AC_ARG_VAR(ZM_MYSQL_ENGINE,[MySQL engine to use with database, default InnoDB]) -AC_ARG_VAR(ZM_RUNDIR,[Location of transient process files, default /var/run/zm]) -AC_ARG_VAR(ZM_SOCKDIR,[Location of Unix domain socket files, default /var/run/zm]) -AC_ARG_VAR(ZM_TMPDIR,[Location of temporary files, default /var/tmp/zm]) -AC_ARG_VAR(ZM_LOGDIR,[Location of generated log files, default /var/log/zm]) -AC_ARG_VAR(ZM_CONFIG_DIR,[Location of ZoneMinder configuration, default system config directory]) - -if test "$ZM_DB_TYPE" == ""; then - AC_SUBST(ZM_DB_TYPE,[mysql]) -fi -if test "$ZM_DB_HOST" == ""; then - AC_SUBST(ZM_DB_HOST,[localhost]) -fi -if test "$ZM_DB_NAME" == ""; then - AC_SUBST(ZM_DB_NAME,[zm]) -fi -if test "$ZM_DB_USER" == ""; then - AC_SUBST(ZM_DB_USER,[zmuser]) -fi -if test "$ZM_DB_PASS" == ""; then - AC_SUBST(ZM_DB_PASS,[zmpass]) -fi -if test "$ZM_SSL_LIB" == ""; then - AC_SUBST(ZM_SSL_LIB,gnutls) -fi -if test "$ZM_MYSQL_ENGINE" == ""; then - AC_SUBST(ZM_MYSQL_ENGINE,InnoDB) -fi -if test "$ZM_RUNDIR" == ""; then - AC_SUBST(ZM_RUNDIR,[/var/run/zm]) -fi -if test "$ZM_SOCKDIR" == ""; then - AC_SUBST(ZM_SOCKDIR,[/var/run/zm]) -fi -if test "$ZM_TMPDIR" == ""; then - AC_SUBST(ZM_TMPDIR,[/tmp/zm]) -fi -if test "$ZM_LOGDIR" == ""; then - AC_SUBST(ZM_LOGDIR,[/var/log/zm]) -fi -AC_DEFINE_DIR([SYSCONFDIR],[sysconfdir],[Expanded configuration directory]) -if test "$ZM_CONFIG_DIR" == ""; then - AC_SUBST(ZM_CONFIG_DIR,[$SYSCONFDIR]) -fi - -LIB_ARCH=lib -AC_ARG_WITH(libarch, - [ --with-libarch= architecture library path to use, default lib], - [LIB_ARCH=$with_libarch], - AC_MSG_WARN([You can call configure with the --with-libarch option. - This tells configure where to find architecture specific libraries. - The default of 'lib' is usually ok but 64 bit machines may require lib64. - e.g. --with-libarch=lib or --with-libarch=lib64]) -) -AC_SUBST(LIB_ARCH) - -LDFLAGS="-L/usr/lib/${build_alias} ${LDFLAGS}" - -MYSQL_PREFIX=/usr -AC_ARG_WITH(mysql, - [ --with-mysql= prefix of MySQL installation, default /usr], - [MYSQL_PREFIX=$with_mysql], - AC_MSG_WARN([You can call configure with the --with-mysql option. - This tells configure where to find the MySql C library and headers if configure cannot - locate them automatically. - e.g. --with-mysql=/usr/local or --with-mysql=/usr]) -) -AC_SUBST(MYSQL_PREFIX) -MYSQL_LIBS="-L${MYSQL_PREFIX}/${LIB_ARCH}/mysql" -MYSQL_CFLAGS="-I${MYSQL_PREFIX}/include" -AC_SUBST(MYSQL_LIBS) -AC_SUBST(MYSQL_CFLAGS) -LDFLAGS="$LDFLAGS ${MYSQL_LIBS}" - - -MARIADB_PREFIX=/usr -AC_ARG_WITH(mariadb, - [ --with-mariadb= prefix of MariaDB installation, default /usr], - [MYSQL_PREFIX=$with_mariadb], - AC_MSG_WARN([You can call configure with the --with-mariadb option. - This tells configure where to find the mariaDB C library and headers if configure cannot - locate them automatically. - e.g. --with-mariadb=/usr/local or --with-mariadb=/usr]) -) -AC_SUBST(MARIADB_PREFIX) -MARIADB_LIBS="-L${MARIADB_PREFIX}/${LIB_ARCH}/mariadb" -MARIADB_CFLAGS="-I${MARIADB_PREFIX}/include" -AC_SUBST(MARIADB_LIBS) -AC_SUBST(MARIADB_CFLAGS) -LDFLAGS="$LDFLAGS ${MARIADB_LIBS}" - -POLKIT_PREFIX=/usr -AC_ARG_WITH(polkit, -[ --with-polkit= prefix of polkit root directory, default /usr], -[POLKIT_PREFIX=$with_polkit], -AC_MSG_WARN([You can call configure with the --with-polkit option. -This tells configure where to place the polkit policy files.]) -) -AC_SUBST(POLKIT_PREFIX) -PKG_CHECK_MODULES(POLKIT, polkit-gobject-1) - -FFMPEG_PREFIX=/usr -AC_ARG_WITH(ffmpeg, - [ --with-ffmpeg= prefix of ffmpeg root directory for libavcodec etc, default /usr], - [FFMPEG_PREFIX=$with_ffmpeg], - AC_MSG_WARN([You can call configure with the --with-ffmpeg option. - This tells configure where to find the ffmpeg root directory within which are the libavcodec - and libavformat files that can be used to build true MPEG streaming into ZoneMinder. Ensure that - your copy of ffmpeg has installed libraries as well as binaries (use 'make installlib'). If you - are using a local install of ffmpeg you may have to remove or rename a previous real installation - as the headers and libraries from that will probably be picked up before your local copy. - e.g. --with-ffmpeg=/usr/local]) -) -AC_SUBST(FFMPEG_PREFIX) -FFMPEG_LIBS="-L${FFMPEG_PREFIX}/${LIB_ARCH}" -FFMPEG_CFLAGS="-I${FFMPEG_PREFIX}/include -D__STDC_CONSTANT_MACROS" -AC_SUBST(FFMPEG_LIBS) -AC_SUBST(FFMPEG_CFLAGS) - -LDFLAGS="${FFMPEG_LIBS} $LDFLAGS" -CFLAGS="${FFMPEG_CFLAGS} $CFLAGS" -CPPFLAGS="${FFMPEG_CFLAGS} $CPPFLAGS" - -EXTRA_LIBS= -AC_ARG_WITH(extralibs, - [ --with-extralibs="" string containing extra libraries to pass to link, default empty], - [EXTRA_LIBS=$with_extralibs], - AC_MSG_WARN([You can call configure with the --with-extralibs option. - Ordinarily you will need to use this option only when your copy of ffmpeg has been built - with support for additional formats and you would use this option to detail which additional - libraries ffmpeg was built with so that it is able to link successfully with ZoneMinder. - You will need to wrap this option in quotes if it contains any spaces. - e.g. --with-extralibs="-lmp3lame"]) -) -AC_SUBST(EXTRA_LIBS) - -LDFLAGS="$LDFLAGS ${EXTRA_LIBS}" - -AC_ARG_WITH(webdir, - [ --with-webdir= prefix of web directory], - [WEB_PREFIX=$with_webdir], - AC_MSG_ERROR([You must call configure with the --with-webdir option. - This tells configure where to install PHP and web files and scripts. - e.g. --with-webdir=/var/www/html or --with-webdir=/www/vhtdocs/]) -) -AC_SUBST(WEB_PREFIX) - -AC_ARG_WITH(cgidir, - [ --with-cgidir= prefix of cgi directory], - [CGI_PREFIX=$with_cgidir], - AC_MSG_ERROR([You must call configure with the --with-cgidir option. - This tells configure where to install cgi files and scripts. - e.g. --with-cgidir=/var/www/cgi-bin or --with-webdir=/www/vhtdocs//cgi-bin]) -) -AC_SUBST(CGI_PREFIX) - -WEB_USER=apache -AC_ARG_WITH(webuser, - [ --with-webuser= name of web user, default apache], - [WEB_USER=$with_webuser], - AC_MSG_WARN([You can call configure with the --with-webuser option. - This tells configure what the user name of the web user is if it is not the default of 'apache'. - e.g. --with-webuser=apache or --with-webuser=web]) -) -AC_SUBST(WEB_USER) - -WEB_GROUP=apache -AC_ARG_WITH(webgroup, - [ --with-webgroup= name of web group, default apache], - [WEB_GROUP=$with_webgroup], - AC_MSG_WARN([You can call configure with the --with-webgroup option. - This tells configure what the group name of the web group is if it is not the default of 'apache'. - e.g. --with-webgroup=apache or --with-webgroup=web]) -) -AC_SUBST(WEB_GROUP) - -WEB_HOST=zm.local -AC_ARG_WITH(webhost, - [ --with-webhost= name of web hostname, default zm.local], - [WEB_HOST=$with_webhost], - AC_MSG_WARN([You can call configure with the --with-webhost option. - This tells configure what the host name is for name based virtual hosting. This is only used to populate the sample web/zmHttpd.conf file. - e.g. --with-webhost=zm.localdomain]) -) -AC_SUBST(WEB_HOST) - -ENABLE_DEBUG=yes -AC_ARG_ENABLE(debug, - [ --enable-debug= enable or disable debug, default enabled], - [ENABLE_DEBUG=$enable_debug], - AC_MSG_WARN([You can call configure with the --enable-debug= or --disable-debug option. - This tells configure whether to compile ZoneMinder with debug included. Although debug is included - by default it is not output unless explicitly switched on elsewhere. These checks may induce a - small penalty on performance and if you are after squeezing the maximum possible performance out - of ZoneMinder you may use this switch to prevent debug from being compiled in. - e.g. --enable-debug=yes or --disable-debug]) -) -if test "$ENABLE_DEBUG" != "yes"; then - AC_DEFINE(ZM_DBG_OFF,1,"Whether debug is switched off and compiled out") -fi - -ENABLE_MMAP=yes -AC_ARG_ENABLE(mmap, - [ --enable-mmap= enable or disabled mapped memory versus shared memory, default mapped], - [ENABLE_MMAP=$enable_mmap], - AC_MSG_WARN([You can call configure with the --enable-mmap= or --disable-mmap option. - This tells configure whether to compile ZoneMinder with mmap support rather than IPC shared - memory. This is a feature that uses memory mapped into files which all processes can share. - Memory mapping requires less configuration and is more flexible than shared memory but may - slow down your system unless the mapped files are configured to reside on a fast or RAM based - filesystem which will normally be the case by default. - e.g. --enable-mmap=yes or --disable-mmap]) -) -if test "$ENABLE_MMAP" == "yes"; then - AC_DEFINE(ZM_MEM_MAPPED,1,"Whether to use mapped rather than shared memory") -else - AC_DEFINE(ZM_MEM_MAPPED,0,"Whether to use mapped rather than shared memory") -fi -AC_SUBST(ENABLE_MMAP) - -ENABLE_ONVIF=no -AC_ARG_ENABLE(onvif, - [ --enable-onvif= enable or disable basic onvif support, default disabled], - [ENABLE_ONVIF=$enable_onvif], - AC_MSG_WARN([You can call configure with the --enable-onvif= or --enable-onvif option. - This tells configure whether to compile ZoneMinder with basic ONVIF support. This feature will - probe for ONVIF compliant cameras on your network and allow you the option to auto-configure them as - monitors in zoneminder. This option is EXPERIMENTAL and may not work with all cameras that claim to - be ONVIF compliant. - e.g. --enable-onvif=yes or --disable-onvif]) -) -AM_CONDITIONAL([COND_ONVIF], [test "$enable_onvif" = yes]) - -# Compiler -AC_LANG_CPLUSPLUS -if test "$ENABLE_ONVIF" == "yes"; then - AC_SUBST(ZM_HAS_ONVIF,1) -else - AC_SUBST(ZM_HAS_ONVIF,0) -fi - -# Checks for programs. -AC_PROG_CXX -AC_PROG_CC -AC_PROG_INSTALL -AC_PROG_LN_S -AC_PROG_RANLIB -AC_PROG_MAKE_SET - -# Checks for typedefs, structures, and compiler characteristics. -AC_HEADER_STDBOOL -AC_C_CONST -AC_TYPE_UID_T -AC_C_INLINE -AC_TYPE_MODE_T -AC_TYPE_SIZE_T -AC_HEADER_TIME -AC_STRUCT_TM -AC_TYPE_SIGNAL - -AC_CHECK_TYPES(siginfo_t,,,[#include ]) -AC_CHECK_TYPES(ucontext_t,,,[#include ]) - -# Checks for library functions. -AC_PROG_GCC_TRADITIONAL -AC_FUNC_MALLOC -AC_FUNC_MMAP -AC_FUNC_SELECT_ARGTYPES -AC_FUNC_STAT -AC_FUNC_STRFTIME -AC_FUNC_STRTOD -AC_FUNC_VPRINTF -AC_CHECK_FUNCS([gethostbyname gethostname gettimeofday memmove memset mkdir munmap posix_memalign putenv select sendfile socket sqrt strcasecmp strchr strcspn strerror strncasecmp strrchr strspn strstr strtol strtoull]) -AC_CHECK_FUNCS([syscall sleep usleep ioctl ioctlsocket sigaction]) -# this is required for freebsd to compile. Look for it in m4/ac_check_sendfile.m4 -AC_CHECK_SENDFILE -# Other programs -AC_CHECK_PROG(OPT_FFMPEG,ffmpeg,yes,no) -AC_PATH_PROG(PATH_FFMPEG,ffmpeg) - -# Checks for libraries. -AC_CHECK_LIB(rt,clock_gettime,,AC_MSG_ERROR(zm requires librt)) -AC_SEARCH_LIBS(mysql_init,[mysqlclient mariadbclient],,AC_MSG_ERROR(zm requires libmysqlclient.a or libmariadbclient.a)) -AC_CHECK_LIB(jpeg,jpeg_start_compress,,AC_MSG_ERROR(zm requires libjpeg.a)) -AC_CHECK_LIB(pthread,pthread_create,,AC_MSG_ERROR(zm requires libpthread.a)) -if test "$BSD" == "0"; then -AC_CHECK_LIB(dl,dlsym,,AC_MSG_ERROR(zm requires libdl.a)) -fi -if test "$ZM_SSL_LIB" == "openssl"; then -AC_CHECK_HEADERS(openssl/md5.h,,AC_MSG_WARN(zm requires openssl/md5.h header to be installed for openssl),) -AC_CHECK_LIB(crypto,MD5,,AC_MSG_WARN([libcrypto.a is required for authenticated streaming - use ZM_SSL_LIB option to select gnutls instead])) -else -AC_CHECK_HEADERS(gnutls/openssl.h,AC_SUBST(ZM_HAS_GNUTLS_OPENSSL,1),AC_SUBST(ZM_HAS_GNUTLS_OPENSSL,0),) -AC_CHECK_HEADERS(gnutls/gnutls.h,AC_SUBST(ZM_HAS_GNUTLS,1),AC_SUBST(ZM_HAS_GNUTLS,0),) -if test "$ZM_HAS_GNUTLS_OPENSSL" == "0" && test "$ZM_HAS_GNUTLS" == "0"; then -AC_MSG_WARN(gnutls is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead) -fi -AC_CHECK_HEADERS(gcrypt.h,,AC_MSG_WARN(zm requires libgcrypt headers to be installed for gnutls),) -AC_CHECK_LIB(gcrypt,gcry_check_version,,AC_MSG_WARN([libgcrypt.a is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead])) -AC_CHECK_LIB(gnutls,gnutls_fingerprint,,AC_MSG_WARN([libgnutls.a is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead])) -if test "$ZM_HAS_GNUTLS_OPENSSL" == "1"; then -AC_CHECK_LIB(gnutls-openssl,MD5,,AC_MSG_WARN([libgnutls.a is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead])) -fi -fi -AC_CHECK_LIB(pcre,pcre_compile,,AC_MSG_WARN(libpcre.a may be required for remote/network camera support)) -AC_CHECK_LIB(z,zlibVersion) -AC_CHECK_LIB(x264,x264_predict_16x16_init) -AC_CHECK_LIB(mp4v2,MP4AddH264VideoTrack) -AC_CHECK_LIB(avutil,av_malloc,,AC_MSG_WARN(libavutil.a may be required for MPEG streaming)) -# Don't bother to warn about this one -AC_CHECK_LIB(avcore,av_image_copy,,) -AC_CHECK_LIB(avcodec,avcodec_version,,AC_MSG_WARN(libavcodec.a is required for MPEG streaming)) -AC_CHECK_LIB(avformat,avformat_version,,AC_MSG_WARN(libavformat.a is required for MPEG streaming)) -#AC_CHECK_LIB(avcodec,avcodec_open,,AC_MSG_WARN(libavcodec.a is required for MPEG streaming)) -#AC_CHECK_LIB(avformat,av_new_stream,,AC_MSG_WARN(libavformat.a is required for MPEG streaming)) -AC_CHECK_LIB(avdevice,avdevice_register_all,,AC_MSG_WARN(libavdevice.a may be required for MPEG streaming)) -AC_CHECK_LIB(swscale,sws_scale,,,-lswscale) -AC_CHECK_LIB(vlc,libvlc_new,,AC_MSG_WARN(libvlc.a may be required for streaming)) -AC_CHECK_LIB(bz2,BZ2_bzCompress,,AC_MSG_WARN(zm requires libbz2.a for recent versions of ffmpeg)) -AC_CHECK_LIB(z,compress,,) -AC_CHECK_LIB(curl,curl_global_init,,) - -# Checks for header files. -AC_FUNC_ALLOCA -AC_HEADER_STDC -AC_CHECK_HEADERS([fcntl.h limits.h memory.h stddef.h stdlib.h string.h strings.h sys/param.h sys/time.h syslog.h unistd.h values.h]) -AC_CHECK_HEADERS([netdb.h netinet/in.h arpa/inet.h sys/ioctl.h sys/socket.h sys/un.h glob.h sys/sendfile.h]) -AC_CHECK_HEADERS(execinfo.h,,,) -AC_CHECK_HEADERS(ucontext.h,,,) -AC_CHECK_HEADERS(sys/syscall.h,,,) -AC_CHECK_HEADERS(pthread.h,,,) - -# Check for Video for Linux 1 Header Files -ZM_HAS_V4L1=0 -AC_CHECK_HEADERS([libv4l1-videodev.h linux/videodev.h],[ZM_HAS_V4L1=1; break;],,) -AC_SUBST(ZM_HAS_V4L1) - -# Check for Video for Linux 2 Header Files -ZM_HAS_V4L2=0 -AC_CHECK_HEADERS(linux/videodev2.h,ZM_HAS_V4L2=1,,) -AC_SUBST(ZM_HAS_V4L2) - -# Set global Video for Linux flag -ZM_HAS_V4L=0 -if test "$ZM_HAS_V4L1" == "1" || test "$ZM_HAS_V4L2" == "1"; then -ZM_HAS_V4L=1 -else -AC_MSG_WARN(zm requires Video4Linux or Video4Linux2 to be installed for analog or USB camera support) -fi -AC_SUBST(ZM_HAS_V4L) - -AC_CHECK_HEADERS(jpeglib.h,,AC_MSG_ERROR(zm requires libjpeg headers to be installed),) -AC_CHECK_HEADERS(mysql/mysql.h,,AC_MSG_ERROR(zm requires MySQL headers - check that MySQL development packages are installed),) -AC_LANG_PUSH([C]) -AC_CHECK_HEADERS(libavutil/avutil.h,,,) -AC_CHECK_HEADERS(libavcodec/avcodec.h,,,) -AC_CHECK_HEADERS(libavformat/avformat.h,,,) -AC_CHECK_HEADERS(libswscale/swscale.h,,,) -AC_LANG_POP([C]) -AC_CHECK_HEADERS(pcre/pcre.h,AC_SUBST(ZM_PCRE,"1"),,) -AC_CHECK_HEADERS(pcre.h,AC_SUBST(ZM_PCRE,"1"),,) -if test "$ENABLE_MMAP" == "yes"; then -AC_CHECK_HEADERS(sys/mman.h,,,) -AC_CHECK_HEADERS(fcntl.h,,,) -else -AC_CHECK_HEADERS(sys/ipc.h,,,) -AC_CHECK_HEADERS(sys/shm.h,,,) -fi -AC_CHECK_HEADERS(zlib.h,,,) -AC_CHECK_HEADERS(x264.h,,,) -AC_CHECK_HEADERS([mp4v2/mp4v2.h mp4v2.h mp4.h],,,) -AC_CHECK_HEADERS(vlc/vlc.h,,,) -AC_CHECK_HEADERS(curl/curl.h,,,) - -if test "$ZM_SSL_LIB" == "openssl"; then -AC_CHECK_DECLS(MD5,,AC_MSG_ERROR([zm requires openssl/md5.h - use ZM_SSL_LIB option to select gnutls instead]),[#include -#include ]) -else -if test "$ZM_HAS_GNUTLS_OPENSSL" == "1"; then -AC_CHECK_DECLS(MD5,,AC_MSG_ERROR([zm requires gnutls/openssl.h - use ZM_SSL_LIB option to select openssl instead]),[#include -#include ]) -else -AC_CHECK_DECLS(gnutls_fingerprint,,AC_MSG_ERROR([zm requires gnutls/gnutls.h - use ZM_SSL_LIB option to select openssl instead]),[#include -#include ]) -fi -fi -AC_CHECK_DECLS(backtrace,,,[#include ]) -AC_CHECK_DECLS(backtrace_symbols,,,[#include ]) -AC_CHECK_LIB(execinfo,backtrace) - -AC_SUBST(LDFLAGS) - -AC_PROG_PERL_VERSION(5.6.0) - -# Compulsory perl modules -AC_PROG_PERL_MODULES(Sys::Syslog,,AC_MSG_ERROR(zm requires SYS:Syslog)) -AC_PROG_PERL_MODULES(DBI,,AC_MSG_ERROR(zm requires DBI)) -AC_PROG_PERL_MODULES(DBD::mysql,,AC_MSG_ERROR(zm requires DBD::mysql)) -AC_PROG_PERL_MODULES(Getopt::Long,,AC_MSG_ERROR(zm requires Getopt::Long)) -AC_PROG_PERL_MODULES(Time::HiRes,,AC_MSG_ERROR(zm requires Time::HiRes)) -AC_PROG_PERL_MODULES(Date::Manip,,AC_MSG_ERROR(zm requires Date::Manip)) -AC_PROG_PERL_MODULES(LWP::UserAgent,,AC_MSG_ERROR(zm requires LWP::UserAgent)) -AC_PROG_PERL_MODULES(ExtUtils::MakeMaker,,AC_MSG_ERROR(zm requires ExtUtils::MakeMaker)) -if test "$ENABLE_MMAP" == "yes"; then -AC_PROG_PERL_MODULES(Sys::Mmap,,AC_MSG_ERROR(zm requires Sys::Mmap for mapped memory - set --enable-mmap=no to use IPC shared memory instead)) -fi - -# Optional perl modules -AC_PROG_PERL_MODULES(Module::Load,,AC_MSG_WARN(Module::Load is required for PTZ camera control)) -AC_PROG_PERL_MODULES(Device::SerialPort,,AC_MSG_WARN(Device::SerialPort is required for RS232/RS485 PTZ camera control)) -AC_PROG_PERL_MODULES(Net::FTP,,AC_MSG_WARN(Net::FTP is required for automatic event uploading using ftp)) -AC_PROG_PERL_MODULES(Net::SFTP::Foreign,,AC_MSG_WARN(Net::SFTP::Foreign is required for automatic event uploading using sftp)) -AC_PROG_PERL_MODULES(Expect,,AC_MSG_WARN(Expect is required for automatic event uploading using sftp)) -AC_PROG_PERL_MODULES(Archive::Tar,,AC_MSG_WARN(Archive::Tar may be required for automatic event uploading)) -AC_PROG_PERL_MODULES(Archive::Zip,,AC_MSG_WARN(Archive::Zip may be required for automatic event uploading)) -AC_PROG_PERL_MODULES(Net::SMTP,,AC_MSG_WARN(Net::SMTP may be required for automatic event email notification)) -AC_PROG_PERL_MODULES(MIME::Lite,,AC_MSG_WARN(MIME::Lite may be required for automatic event email notification)) -AC_PROG_PERL_MODULES(MIME::Entity,,AC_MSG_WARN(MIME::Entity may be required for automatic event email notification)) -AC_PROG_PERL_MODULES(X10::ActiveHome,,AC_MSG_WARN(X10::ActiveHome is required for X.10 support)) - -AC_DEFINE_DIR([BINDIR],[bindir],[Expanded binary directory]) -AC_DEFINE_DIR([LIBDIR],[libdir],[Expanded library directory]) -AC_DEFINE_DIR([DATADIR],[datadir],[Expanded data directory]) -AC_SUBST(PKGDATADIR,"$DATADIR/$PACKAGE") -AC_SUBST(ZM_PID,"$ZM_RUNDIR/zm.pid") -#AC_DEFINE_DIR([SYSCONFDIR],[sysconfdir],[Expanded configuration directory]) -#AC_SUBST(ZM_CONFIG,"$SYSCONFDIR/zm.conf") -AC_SUBST(ZM_CONFIG,"$ZM_CONFIG_DIR/zm.conf") - -# Slight hack for non-standard perl install paths -if test "$prefix" != "NONE"; then - PERL_SITE_PREFIX=`perl -V:siteprefix | 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||"` - EXTRA_PERL_LIB="use lib '$prefix$PERL_LIB_PATH'; # Include custom perl install path" - PERL_MM_PARMS="\"PREFIX=$prefix INSTALLDIRS=vendor\"" -else - EXTRA_PERL_LIB="# Include from system perl paths only" - PERL_MM_PARMS="\"INSTALLDIRS=vendor\"" -fi -AC_SUBST(PERL_MM_PARMS) -AC_SUBST(EXTRA_PERL_LIB) - -AC_CONFIG_FILES([Makefile zm.conf zmconfgen.pl db/Makefile db/zm_create.sql misc/Makefile misc/apache.conf misc/logrotate.conf misc/syslog.conf misc/com.zoneminder.systemctl.policy misc/com.zoneminder.systemctl.rules onvif/Makefile onvif/scripts/Makefile scripts/Makefile scripts/zm scripts/zmaudit.pl scripts/zmcontrol.pl scripts/zmdc.pl scripts/zmfilter.pl scripts/zmpkg.pl scripts/zmtelemetry.pl scripts/zmtrack.pl scripts/zmcamtool.pl scripts/zmsystemctl.pl scripts/zmtrigger.pl scripts/zmupdate.pl scripts/zmvideo.pl scripts/zmwatch.pl scripts/zmx10.pl scripts/zmdbbackup scripts/zmdbrestore scripts/zmeventdump scripts/zmlogrotate.conf scripts/ZoneMinder/lib/ZoneMinder/Base.pm scripts/ZoneMinder/lib/ZoneMinder/Config.pm scripts/ZoneMinder/lib/ZoneMinder/Memory.pm scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm src/Makefile src/zm_config.h web/Makefile web/ajax/Makefile web/css/Makefile web/graphics/Makefile web/includes/Makefile web/includes/config.php web/js/Makefile web/lang/Makefile web/skins/Makefile web/skins/classic/Makefile web/skins/classic/ajax/Makefile web/skins/classic/css/Makefile web/skins/classic/css/classic/Makefile web/skins/classic/css/classic/views/Makefile web/skins/classic/css/dark/Makefile web/skins/classic/css/dark/views/Makefile web/skins/classic/css/flat/Makefile web/skins/classic/css/flat/views/Makefile web/skins/classic/graphics/Makefile web/skins/classic/includes/Makefile web/skins/classic/js/Makefile web/skins/classic/lang/Makefile web/skins/classic/views/Makefile web/skins/classic/views/js/Makefile web/skins/mobile/Makefile web/skins/mobile/ajax/Makefile web/skins/mobile/css/Makefile web/skins/mobile/graphics/Makefile web/skins/mobile/includes/Makefile web/skins/mobile/lang/Makefile web/skins/mobile/views/Makefile web/skins/mobile/views/css/Makefile web/tools/Makefile web/tools/mootools/Makefile web/views/Makefile web/skins/xml/Makefile web/skins/xml/views/Makefile web/skins/xml/includes/Makefile]) - -# Create the definitions for compilation and defaults for the database -AC_CONFIG_COMMANDS([src/zm_config_defines.h],[perl ./zmconfgen.pl]) -# Manually generate the perl Makefile maker -AC_CONFIG_COMMANDS([scripts/ZoneMinder/Makefile],[(cd scripts/ZoneMinder; echo "perl Makefile.PL $PERL_MM_PARMS"; perl Makefile.PL $PERL_MM_PARMS)],[PERL_MM_PARMS=$PERL_MM_PARMS]) -AC_CONFIG_COMMANDS([onvif/modules/Makefile],[(cd onvif/modules; echo "perl Makefile.PL $PERL_MM_PARMS"; perl Makefile.PL $PERL_MM_PARMS)],[PERL_MM_PARMS=$PERL_MM_PARMS]) -AC_CONFIG_COMMANDS([onvif/proxy/Makefile],[(cd onvif/proxy; echo "perl Makefile.PL $PERL_MM_PARMS"; perl Makefile.PL $PERL_MM_PARMS)],[PERL_MM_PARMS=$PERL_MM_PARMS]) - -AC_OUTPUT diff --git a/db/Makefile.am b/db/Makefile.am deleted file mode 100644 index 9cb4e197c..000000000 --- a/db/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -AUTOMAKE_OPTIONS = foreign - -zmdbdatadir = $(pkgdatadir)/db - -EXTRA_DIST = \ - zm_create.sql.in \ - $(dbupgrade_scripts) - -dist_zmdbdata_DATA = \ - zm_create.sql \ - $(dbupgrade_scripts) - -dbupgrade_scripts = $(wildcard zm_update-*.sql) - diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index 3614bfedd..029f20989 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -270,7 +270,7 @@ CREATE TABLE `Logs` ( `TimeKey` decimal(16,6) NOT NULL, `Component` varchar(32) NOT NULL, `ServerId` int(10) unsigned, - `Pid` smallint(6) DEFAULT NULL, + `Pid` int(10) DEFAULT NULL, `Level` tinyint(3) NOT NULL, `Code` char(3) NOT NULL, `Message` text NOT NULL, diff --git a/db/zm_update-1.29.1.sql b/db/zm_update-1.29.1.sql new file mode 100644 index 000000000..8fd43c318 --- /dev/null +++ b/db/zm_update-1.29.1.sql @@ -0,0 +1,7 @@ +-- +-- This updates a 1.29.0 database to 1.29.1 +-- +-- + +-- Increase the size of the Pid field for FreeBSD +ALTER TABLE Logs MODIFY Pid int(10); diff --git a/distros/debian8/control b/distros/debian8/control index 4839e0033..dcee8d28c 100644 --- a/distros/debian8/control +++ b/distros/debian8/control @@ -13,9 +13,7 @@ Depends: ${misc:Depends}, zoneminder-database (>= ${source:Version}), zoneminder-core (>= ${binary:Version}), zoneminder-ui-base (>= ${source:Version}), - zoneminder-ui-classic (>= ${source:Version}), - zoneminder-ui-mobile (>= ${source:Version}), - zoneminder-ui-xml (>= ${source:Version}) + zoneminder-ui-classic (>= ${source:Version}) Description: Video camera security and surveillance solution (metapackage) ZoneMinder is intended for use in single or multi-camera video security applications, including commercial or home CCTV, theft prevention and child @@ -103,22 +101,3 @@ Description: Classic web user interface for ZoneMinder ZoneMinder is a video camera security and surveillance solution. . This package provides the classic web user interface. - -Package: zoneminder-ui-mobile -Section: web -Architecture: all -Depends: zoneminder-ui-base (>= ${source:Version}), ${misc:Depends} -Description: Mobile web user interface for ZoneMinder - ZoneMinder is a video camera security and surveillance solution. - . - This package provides the web user interface for mobile devices. - -Package: zoneminder-ui-xml -Section: web -Architecture: all -Depends: zoneminder-ui-base (>= ${source:Version}), ${misc:Depends} -Description: XML interface for ZoneMinder - ZoneMinder is a video camera security and surveillance solution. - . - This package provides a XML interface mainly intended for use with the eyeZm - iPhone Application, but can be used with any other custom programs as well. diff --git a/distros/debian8/zoneminder-ui-mobile.install b/distros/debian8/zoneminder-ui-mobile.install deleted file mode 100644 index 464bb74eb..000000000 --- a/distros/debian8/zoneminder-ui-mobile.install +++ /dev/null @@ -1 +0,0 @@ -usr/share/zoneminder/skins/mobile diff --git a/distros/debian8/zoneminder-ui-xml.install b/distros/debian8/zoneminder-ui-xml.install deleted file mode 100644 index 6617707f8..000000000 --- a/distros/debian8/zoneminder-ui-xml.install +++ /dev/null @@ -1 +0,0 @@ -usr/share/zoneminder/skins/xml diff --git a/distros/fedora/archive/zoneminder.cmake.f19.spec b/distros/fedora/archive/zoneminder.cmake.f19.spec index 771209247..0af88f41f 100644 --- a/distros/fedora/archive/zoneminder.cmake.f19.spec +++ b/distros/fedora/archive/zoneminder.cmake.f19.spec @@ -140,7 +140,6 @@ fi # zmfix removed from zoneminder 1.26.6 #%attr(4755,root,root) %{_bindir}/zmfix %{_bindir}/zmpkg.pl -%{_bindir}/zmstreamer %{_bindir}/zmtrack.pl %{_bindir}/zmtrigger.pl %{_bindir}/zmu diff --git a/distros/fedora/archive/zoneminder.f19.spec b/distros/fedora/archive/zoneminder.f19.spec index 11a8ba249..d1be12aa2 100644 --- a/distros/fedora/archive/zoneminder.f19.spec +++ b/distros/fedora/archive/zoneminder.f19.spec @@ -232,7 +232,6 @@ fi # zmfix removed from zoneminder 1.26.6 #%attr(4755,root,root) %{_bindir}/zmfix %{_bindir}/zmpkg.pl -%{_bindir}/zmstreamer %{_bindir}/zmtrack.pl %{_bindir}/zmtrigger.pl %{_bindir}/zmu diff --git a/distros/fedora/archive/zoneminder.f20.spec b/distros/fedora/archive/zoneminder.f20.spec index b06db673d..513a9cfee 100644 --- a/distros/fedora/archive/zoneminder.f20.spec +++ b/distros/fedora/archive/zoneminder.f20.spec @@ -142,7 +142,6 @@ fi %{_bindir}/zmf %{_bindir}/zmfilter.pl %{_bindir}/zmpkg.pl -%{_bindir}/zmstreamer %{_bindir}/zmtrack.pl %{_bindir}/zmtrigger.pl %{_bindir}/zmu diff --git a/distros/fedora/archive/zoneminder.f21.spec b/distros/fedora/archive/zoneminder.f21.spec index 6dfabceea..35662bf6c 100644 --- a/distros/fedora/archive/zoneminder.f21.spec +++ b/distros/fedora/archive/zoneminder.f21.spec @@ -142,7 +142,6 @@ fi %{_bindir}/zmf %{_bindir}/zmfilter.pl %{_bindir}/zmpkg.pl -%{_bindir}/zmstreamer %{_bindir}/zmtrack.pl %{_bindir}/zmtrigger.pl %{_bindir}/zmu diff --git a/distros/fedora/zoneminder.f22.spec b/distros/fedora/zoneminder.f22.spec new file mode 100644 index 000000000..40343090f --- /dev/null +++ b/distros/fedora/zoneminder.f22.spec @@ -0,0 +1,408 @@ +%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.29.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 + +%build +%cmake \ + -DZM_TARGET_DISTRO="f22" \ +%{?_without_ffmpeg:-DZM_NO_FFMPEG=ON} \ +%{?_without_x10:-DZM_NO_X10=ON} \ + . + +make %{?_smp_mflags} + +%install +export DESTDIR=%{buildroot} +make install + +%post +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 + # Freshen the database + /usr/bin/zmupdate.pl -f + + # 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 +%{!?_without_x10:%{_bindir}/zmx10.pl} + +%{perl_vendorlib}/ZoneMinder* +%{_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 +* Sat Feb 14 2015 Andrew Bauer - 1.28.1 +- Bump version for 1.28.1 release on Fedora 21. + +* Sun Oct 5 2014 Andrew Bauer - 1.28.0 +- Bump version for 1.28.0 release. + +* Fri Mar 14 2014 Andrew Bauer - 1.27 +- Tweak build requirements for cmake + +* Sat Feb 01 2014 Andrew Bauer - 1.27 +- Add zmcamtool.pl. Bump version for 1.27 release. + +* Mon Dec 16 2013 Andrew Bauer - 1.26.5 +- This is a bug fixe release +- RTSP fixes, cmake enhancements, couple other misc fixes + +* Mon Oct 07 2013 Andrew Bauer - 1.26.4 +- Initial cmake build. + +* Sat Oct 05 2013 Andrew Bauer - 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 - 1.26.3 +- Initial rebuild for ZoneMinder 1.26.3 release. + +* Fri Feb 15 2013 Fedora Release Engineering - 1.25.0-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Mon Jan 21 2013 Adam Tkac - 1.25.0-12 +- rebuild due to "jpeg8-ABI" feature drop + +* Mon Jan 7 2013 Remi Collet - 1.25.0-11 +- fix configuration file for httpd 2.4, #871502 + +* Fri Dec 21 2012 Adam Tkac - 1.25.0-10 +- rebuild against new libjpeg + +* Thu Aug 09 2012 Jason L Tibbitts III - 1.25.0-9 +- Add patch to work around v4l2 api breakage in 3.5 kernel. + +* Sun Jul 22 2012 Fedora Release Engineering - 1.25.0-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Sat Jun 23 2012 Petr Pisar - 1.25.0-7 +- Perl 5.16 rebuild + +* Wed Mar 21 2012 Jason L Tibbitts III - 1.25.0-6 +- Fix stupid thinko in sql modifications. + +* Sat Feb 25 2012 Jason L Tibbitts III - 1.25.0-5 +- Clean up macro usage. + +* Sat Feb 25 2012 Jason L Tibbitts III - 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 - 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 - 1.25.0-2 +- Rebuild for new pcre. + +* Thu Jan 19 2012 Jason L Tibbitts III - 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 - 1.24.4-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Thu Sep 15 2011 Jason L Tibbitts III - 1.24.4-3 +- Re-add the dist-tag that somehow got lost. + +* Thu Sep 15 2011 Jason L Tibbitts III - 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 - 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 - 1.24.3-7.20110324svn3310 +- Perl mass rebuild + +* Wed Jul 20 2011 Petr Sabata - 1.24.3-6.20110324svn3310 +- Perl mass rebuild + +* Mon May 09 2011 Jason L Tibbitts III - 1.24.3-5.20110324svn3310 +- Bump for gnutls update. + +* Thu Mar 24 2011 Jason L Tibbitts III - 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 - 1.24.3-3 +- rebuilt for mysql 5.5.10 (soname bump in libmysqlclient) + +* Tue Feb 08 2011 Fedora Release Engineering - 1.24.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Jan 25 2011 Jason L Tibbitts III - 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 - 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 - 1.24.2-5 +- Mass rebuild with perl-5.12.0 + +* Fri Dec 4 2009 Stepan Kasal - 1.24.2-4 +- rebuild against perl 5.10.1 +- use Perl vendorarch and archlib variables correctly + +* Mon Jul 27 2009 Fedora Release Engineering - 1.24.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed Jul 22 2009 Jason L Tibbitts III - 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 - 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 - 1.24.1-3 +- Remove unused Sys::Mmap perl dependency RPM is finding + +* Sat Apr 11 2009 Martin Ebourne - 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 - 1.24.1-1 +- Patch for gcc 4.4 compilation errors +- Upgrade to 1.24.1 + +* Wed Feb 25 2009 Fedora Release Engineering - 1.23.3-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Sat Jan 24 2009 Caolán McNamara - 1.23.3-3 +- rebuild for dependencies + +* Mon Dec 15 2008 Martin Ebourne - 1.23.3-2 +- Fix permissions on zm.conf + +* Fri Jul 11 2008 Jason L Tibbitts III - 1.23.3-1 +- Initial attempt at packaging 1.23. + +* Tue Jul 1 2008 Martin Ebourne - 1.22.3-15 +- Add perl module compat dependency, bz #453590 + +* Tue May 6 2008 Martin Ebourne - 1.22.3-14 +- Remove default runlevel, bz #441315 + +* Mon Apr 28 2008 Jason L Tibbitts III - 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 - 1.22.3-12 +- Autorebuild for GCC 4.3 + +* Thu Jan 3 2008 Martin Ebourne - 1.22.3-11 +- Fix compilation on gcc 4.3 + +* Thu Dec 6 2007 Martin Ebourne - 1.22.3-10 +- Rebuild for new openssl + +* Thu Aug 2 2007 Martin Ebourne - 1.22.3-8 +- Fix licence tag + +* Thu Jul 12 2007 Martin Ebourne - 1.22.3-7 +- Fixes from testing by Jitz including missing dependencies and database creation + +* Sat Jun 30 2007 Martin Ebourne - 1.22.3-6 +- Disable crashtrace on ppc + +* Sat Jun 30 2007 Martin Ebourne - 1.22.3-5 +- Fix uid for directories in /var/lib/zoneminder + +* Tue Jun 26 2007 Martin Ebourne - 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 - 1.22.3-3 +- Changes recommended in review by Jason Tibbitts + +* Mon Apr 2 2007 Martin Ebourne - 1.22.3-2 +- Standardised on package name of zoneminder + +* Thu Dec 28 2006 Martin Ebourne - 1.22.3-1 +- First version. Uses some parts from zm-1.20.1 by Corey DeLasaux and Serg Oskin diff --git a/distros/fedora/zoneminder.f23.spec b/distros/fedora/zoneminder.f23.spec index 435a3ba58..1f44e5671 100644 --- a/distros/fedora/zoneminder.f23.spec +++ b/distros/fedora/zoneminder.f23.spec @@ -163,7 +163,6 @@ fi %{_bindir}/zmf %{_bindir}/zmfilter.pl %{_bindir}/zmpkg.pl -%{_bindir}/zmstreamer %{_bindir}/zmtrack.pl %{_bindir}/zmtrigger.pl %{_bindir}/zmu diff --git a/distros/redhat/archive/zoneminder.el6.spec b/distros/redhat/archive/zoneminder.el6.spec index d61a153e7..46bce099a 100644 --- a/distros/redhat/archive/zoneminder.el6.spec +++ b/distros/redhat/archive/zoneminder.el6.spec @@ -237,7 +237,6 @@ fi # zmfix removed from zoneminder 1.26.6 #%attr(4755,root,root) %{_bindir}/zmfix %{_bindir}/zmpkg.pl -%{_bindir}/zmstreamer %{_bindir}/zmtrack.pl %{_bindir}/zmtrigger.pl %{_bindir}/zmu diff --git a/distros/redhat/zoneminder.el6.spec b/distros/redhat/zoneminder.el6.spec index 69e3b972f..baf89ca8a 100644 --- a/distros/redhat/zoneminder.el6.spec +++ b/distros/redhat/zoneminder.el6.spec @@ -150,7 +150,6 @@ rm -rf %{_docdir}/%{name}-%{version} %{_bindir}/zmf %{_bindir}/zmfilter.pl %{_bindir}/zmpkg.pl -%{_bindir}/zmstreamer %{_bindir}/zmtrack.pl %{_bindir}/zmtrigger.pl %{_bindir}/zmu diff --git a/distros/redhat/zoneminder.el7.spec b/distros/redhat/zoneminder.el7.spec index 485c214c2..3ec03b746 100644 --- a/distros/redhat/zoneminder.el7.spec +++ b/distros/redhat/zoneminder.el7.spec @@ -159,7 +159,6 @@ fi %{_bindir}/zmf %{_bindir}/zmfilter.pl %{_bindir}/zmpkg.pl -%{_bindir}/zmstreamer %{_bindir}/zmtrack.pl %{_bindir}/zmtrigger.pl %{_bindir}/zmu diff --git a/distros/ubuntu1504_cmake_split_packages/control b/distros/ubuntu1504_cmake_split_packages/control index d6d318e96..5f313897f 100644 --- a/distros/ubuntu1504_cmake_split_packages/control +++ b/distros/ubuntu1504_cmake_split_packages/control @@ -28,9 +28,7 @@ Depends: ${misc:Depends}, zoneminder-database (>= ${source:Version}), zoneminder-core (>= ${binary:Version}), zoneminder-ui-base (>= ${source:Version}), - zoneminder-ui-classic (>= ${source:Version}), - zoneminder-ui-mobile (>= ${source:Version}), - zoneminder-ui-xml (>= ${source:Version}) + zoneminder-ui-classic (>= ${source:Version}) Description: Video camera security and surveillance solution (metapackage) ZoneMinder is intended for use in single or multi-camera video security applications, including commercial or home CCTV, theft prevention and child @@ -119,25 +117,6 @@ Description: Classic web user interface for ZoneMinder . This package provides the classic web user interface. -Package: zoneminder-ui-mobile -Section: web -Architecture: all -Depends: zoneminder-ui-base (>= ${source:Version}), ${misc:Depends} -Description: Mobile web user interface for ZoneMinder - ZoneMinder is a video camera security and surveillance solution. - . - This package provides the web user interface for mobile devices. - -Package: zoneminder-ui-xml -Section: web -Architecture: all -Depends: zoneminder-ui-base (>= ${source:Version}), ${misc:Depends} -Description: XML interface for ZoneMinder - ZoneMinder is a video camera security and surveillance solution. - . - This package provides a XML interface mainly intended for use with the eyeZm - iPhone Application, but can be used with any other custom programs as well. - Package: zoneminder-ui-api Section: web Architecture: all diff --git a/distros/ubuntu1504_cmake_split_packages/zoneminder-ui-mobile.install b/distros/ubuntu1504_cmake_split_packages/zoneminder-ui-mobile.install deleted file mode 100644 index 464bb74eb..000000000 --- a/distros/ubuntu1504_cmake_split_packages/zoneminder-ui-mobile.install +++ /dev/null @@ -1 +0,0 @@ -usr/share/zoneminder/skins/mobile diff --git a/distros/ubuntu1504_cmake_split_packages/zoneminder-ui-xml.install b/distros/ubuntu1504_cmake_split_packages/zoneminder-ui-xml.install deleted file mode 100644 index 6617707f8..000000000 --- a/distros/ubuntu1504_cmake_split_packages/zoneminder-ui-xml.install +++ /dev/null @@ -1 +0,0 @@ -usr/share/zoneminder/skins/xml diff --git a/docs/userguide/components.rst b/docs/userguide/components.rst index ebedc8c7e..48aff0be4 100644 --- a/docs/userguide/components.rst +++ b/docs/userguide/components.rst @@ -26,16 +26,13 @@ Binaries PHP --- -As well as this there are the web PHP files in the web directory. Currently these consist of 4 possible skins. +As well as this there are the web PHP files in the web directory. Currently these consist of a single skin with Classic and Flat styles. **Classic** Original ZoneMinder skin **Flat** - An updated version of classic skin, retaining the same layout with a more modern style -**XML** - Displays certain views as XML. Used by eyeZM as an interfacing skin (Note that eyeZM no longer seems to work with later versions of Zoneminder). New developers of 3rd party clients should use the API instead (:doc:`../api`) -**Mobile** - A skin that displays views in a more condensed and single page format, likely suitable for smaller mobile devices, should one choose to access the ZoneMinder console using such devices. Note that there are also third party mobile clients one could use (:doc:`mobile`) + An updated version of Classic skin, retaining the same layout with a more modern style. Originally a skin this is now just a CSS style. + Perl ---- diff --git a/docs/userguide/options.rst b/docs/userguide/options.rst index 4a0b357f6..8186d8b6a 100644 --- a/docs/userguide/options.rst +++ b/docs/userguide/options.rst @@ -19,6 +19,4 @@ If you have changed the value of an option you should then ‘save’ it. A numb options/options_upload options/options_x10 options/options_bw - options/options_phonebw - options/options_eyezm options/options_users diff --git a/docs/userguide/options/options_eyezm.rst b/docs/userguide/options/options_eyezm.rst deleted file mode 100644 index 21c780bc0..000000000 --- a/docs/userguide/options/options_eyezm.rst +++ /dev/null @@ -1,26 +0,0 @@ -Options - eyeZM ---------------- - -.. NOTE:: - eyeZM does not seem to be actively maintained by the developers and does not work with later versions of ZoneMinder. - - -.. image:: images/Options_eyezm.png - -EYEZM_DEBUG - Enable or Disable extra debugging from the eyeZm Plugin. Extra debugging information will be displayed in it's own file (EYEZM_LOG_TO_FILE is set), or your Apache error log - -EYEZM_LOG_TO_FILE - When EYEZM_DEBUG is on and EYEZM_LOG_TO_FILE is on, output generated from the eyeZm Plugin will go to it's own file. Otherwise it will go to the apache error log. - -EYEZM_LOG_FILE - Default filename to use when logging eyeZm Output and EYEZM_LOG_TO_FILE is enabled. This file will contain it's own output from the eyeZm Plugin when EYEZM_LOG_TO_FILE and EYEZM_DEBUG are both enabled. - -EYEZM_EVENT_VCODEC - The eyeZm Plugin calls FFMPEG externally to encode the captured images. If your FFMPEG is not built with support for H264, change this to MPEG-4. If using H264, please check http://www.eyezm.com for H264 requirements and that your eyeZm version supports H264 (v1.2+). - -EYEZM_FEED_VCODEC - Determines whether the live stream is generated using native MJPEG streaming with ZoneMinder, or H264 using FFMPEG and HTML-5 streaming. If using H264, please check http://www.eyezm.com for H264 requirements and that your eyeZm version supports H264 (v1.2+). This is just a default parameter, and can be overridden with eyeZm. - -EYEZM_H264_DEFAULT_BR - Default bit-rate to use with FFMPEG for H264 streaming. When using the eyeZm Plugin to stream H264 data, FFMPEG requires a bitrate to control the quality and bandwidth of the video. This should be specified in a format acceptable to FFMPEG. The default value is sufficient for most installations. This is just a default parameter, and can be overridden with eyeZm. - -EYEZM_H264_DEFAULT_EVBR - Default bit-rate to use with FFMPEG for H264 event viewing. When using the eyeZm Plugin to view events in H264, FFMPEG requires a bitrate to control the quality and bandwidth of the video. This should be specified in a format acceptable to FFMPEG. The default value is sufficient for most installations. This is just a default parameter, and can be overridden with eyeZm. - -EYEZM_H264_TIMEOUT - Timeout (sec) to wait for H264 stream to start before terminating. The eyeZm Plugin will attempt to spawn an H264 stream when requested, and require that it complete within the timeout specified. If you have a slow system or find through the logs that the H264 stream is not starting because the timeout is expiring, even though FFMPEG is running, try increasing this value. If you have a fast system, decreasing this value can improve the responsiveness when there are issues starting H264 streams. - -EYEZM_SEG_DURATION - Segment duration used for streaming using HTTP-5 Streaming protocol. The HTTP-5 Live Streaming Protocol segments the input video stream into small chunks of a duration specified by this parameter. Increasing the segment duration will help with choppy connections on the other end, but will increase the latency in starting a stream. diff --git a/docs/userguide/options/options_phonebw.rst b/docs/userguide/options/options_phonebw.rst deleted file mode 100644 index e2389bccf..000000000 --- a/docs/userguide/options/options_phonebw.rst +++ /dev/null @@ -1,20 +0,0 @@ -Options - Phone Bandwidth -------------------------- - -.. image:: images/Options_BW_Phone.png - -WEB_P_CAN_STREAM - Override the automatic detection of browser streaming capability. If you know that your browser can handle image streams of the type 'multipart/x-mixed-replace' but ZoneMinder does not detect this correctly you can set this option to ensure that the stream is delivered with or without the use of the Cambozola plugin. Selecting 'yes' will tell ZoneMinder that your browser can handle the streams natively, 'no' means that it can't and so the plugin will be used while 'auto' lets ZoneMinder decide. - -WEB_P_STREAM_METHOD - ZoneMinder can be configured to use either mpeg encoded video or a series or still jpeg images when sending video streams. This option defines which is used. If you choose mpeg you should ensure that you have the appropriate plugins available on your browser whereas choosing jpeg will work natively on Mozilla and related browsers and with a Java applet on Internet Explorer" - -WEB_P_DEFAULT_SCALE - Normally ZoneMinder will display 'live' or 'event' streams in their native size. However if you have monitors with large dimensions or a slow link you may prefer to reduce this size, alternatively for small monitors you can enlarge it. This options lets you specify what the default scaling factor will be. It is expressed as a percentage so 100 is normal size, 200 is double size etc. - -WEB_P_DEFAULT_RATE - Normally ZoneMinder will display 'event' streams at their native rate, i.e. as close to real-time as possible. However if you have long events it is often convenient to replay them at a faster rate for review. This option lets you specify what the default replay rate will be. It is expressed as a percentage so 100 is normal rate, 200 is double speed etc. - -WEB_P_VIDEO_BITRATE - When encoding real video via the ffmpeg library a bit rate can be specified which roughly corresponds to the available bandwidth used for the stream. This setting effectively corresponds to a 'quality' setting for the video. A low value will result in a blocky image whereas a high value will produce a clearer view. Note that this setting does not control the frame rate of the video however the quality of the video produced is affected both by this setting and the frame rate that the video is produced at. A higher frame rate at a particular bit rate result in individual frames being at a lower quality. - -WEB_P_VIDEO_MAXFPS - When using streamed video the main control is the bitrate which determines how much data can be transmitted. However a lower bitrate at high frame rates results in a lower quality image. This option allows you to limit the maximum frame rate to ensure that video quality is maintained. An additional advantage is that encoding video at high frame rates is a processor intensive task when for the most part a very high frame rate offers little perceptible improvement over one that has a more manageable resource requirement. Note, this option is implemented as a cap beyond which binary reduction takes place. So if you have a device capturing at 15fps and set this option to 10fps then the video is not produced at 10fps, but rather at 7.5fps (15 divided by 2) as the final frame rate must be the original divided by a power of 2. - -WEB_P_SCALE_THUMBS - If unset, this option sends the whole image to the browser which resizes it in the window. If set the image is scaled down on the server before sending a reduced size image to the browser to conserve bandwidth at the cost of cpu on the server. Note that ZM can only perform the resizing if the appropriate PHP graphics functionality is installed. This is usually available in the php-gd package. - -WEB_P_AJAX_TIMEOUT - The newer versions of the live feed and event views use Ajax to request information from the server and populate the views dynamically. This option allows you to specify a timeout if required after which requests are abandoned. A timeout may be necessary if requests would overwise hang such as on a slow connection. This would tend to consume a lot of browser memory and make the interface unresponsive. Ordinarily no requests should timeout so this setting should be set to a value greater than the slowest expected response. This value is in milliseconds but if set to zero then no timeout will be used. \ No newline at end of file diff --git a/m4/ac_check_sendfile.m4 b/m4/ac_check_sendfile.m4 deleted file mode 100644 index 12605d588..000000000 --- a/m4/ac_check_sendfile.m4 +++ /dev/null @@ -1,63 +0,0 @@ -AC_DEFUN([AC_CHECK_SENDFILE],[ -AC_MSG_CHECKING([whether sendfile() is supported and what prototype it has]) - -saved_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Werror-implicit-function-declaration" -ac_sendfile_supported=no -AC_TRY_LINK([#include - #include ], - [sendfile(1, 1, NULL, 0);], - [ - AC_DEFINE(HAVE_SENDFILE4_SUPPORT, 1, - [Define this if Linux/Solaris sendfile() is supported]) - AC_MSG_RESULT([Linux sendfile()]) - ac_sendfile_supported=yes - ], []) - -if test x$ac_sendfile_supported = xno; then - dnl Checking wether we need libsendfile - dnl Presumably on Solaris - AC_CHECK_LIB(sendfile, sendfile, - [ - AC_DEFINE(HAVE_SENDFILE4_SUPPORT, 1, - [Define this if Linux/Solaris sendfile() is supported]) - SENDFILE_LIBS="-lsendfile" - AC_SUBST(SENDFILE_LIBS) - AC_MSG_RESULT([Solaris sendfile()]) - ac_sendfile_supported=yes - ], []) -fi - -if test x$ac_sendfile_supported = xno; then - dnl Checking wether we have FreeBSD-like sendfile() support. - AC_TRY_LINK([#include - #include ], - [sendfile(1, 1, 0, 0, NULL, NULL, 0);], - [ - AC_DEFINE(HAVE_SENDFILE7_SUPPORT, 1, - [Define this if FreeBSD sendfile() is supported]) - AC_MSG_RESULT([FreeBSD sendfile()]) - ac_sendfile_supported=yes - ], []) -fi - -if test x$ac_sendfile_supported = xno; then - dnl Checking wether we have MacOS-like sendfile() support. - AC_TRY_LINK([#include - #include - #include ], - [sendfile(1, 1, 0, NULL, NULL, 0);], - [ - AC_DEFINE(HAVE_SENDFILE6_SUPPORT, 1, - [Define this if MacOS sendfile() is supported]) - AC_MSG_RESULT([MacOS sendfile()]) - ac_sendfile_supported=yes - ], []) -fi - -CFLAGS="$saved_CFLAGS" - -if test x$ac_sendfile_supported = xno; then - AC_MSG_RESULT([no sendfile() support, using read/send]) -fi -]) diff --git a/misc/Makefile.am b/misc/Makefile.am deleted file mode 100644 index 5578e4373..000000000 --- a/misc/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -EXTRA_DIST = \ - apache.conf.in \ - logrotate.conf.in \ - syslog.conf.in \ - zoneminder-tmpfiles.conf.in \ - zoneminder.service.in \ - com.zoneminder.systemctl.policy.in \ - com.zoneminder.systemctl.rules.in - -polkit_actiondir = @POLKIT_PREFIX@/share/polkit-1/actions -dist_polkit_action_DATA = com.zoneminder.systemctl.policy - -polkit_rulesdir = @POLKIT_PREFIX@/share/polkit-1/rules.d -dist_polkit_rules_DATA = com.zoneminder.systemctl.rules - diff --git a/onvif/Makefile.am b/onvif/Makefile.am deleted file mode 100644 index 8cc9d700a..000000000 --- a/onvif/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -# Ack! Nasty hack to get modules Makefile regenerated if wiped with make clean -all-local: proxy/Makefile modules/Makefile - -proxy/Makefile: proxy/Makefile.PL - ( cd proxy; perl Makefile.PL ) - -modules/Makefile: modules/Makefile.PL - ( cd modules; perl Makefile.PL ) - -SUBDIRS = \ - . \ - proxy \ - modules \ - scripts - - -EXTRA_DIST = \ - proxy/Makefile.PL \ - proxy/lib \ - modules/Makefile.PL \ - modules/lib \ - wsdl \ - doc \ - patches diff --git a/onvif/scripts/Makefile.am b/onvif/scripts/Makefile.am deleted file mode 100644 index 80db9755c..000000000 --- a/onvif/scripts/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -bin_SCRIPTS = \ - zmonvif-probe.pl - diff --git a/scripts/Makefile.am b/scripts/Makefile.am deleted file mode 100644 index 1d9de2893..000000000 --- a/scripts/Makefile.am +++ /dev/null @@ -1,77 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -# Ack! Nasty hack to get modules Makefile regenerated if wiped with make clean -all-local: ZoneMinder/Makefile - -ZoneMinder/Makefile: ZoneMinder/Makefile.PL - ( cd ZoneMinder; perl Makefile.PL ) - -bin_SCRIPTS = \ - zmdc.pl \ - zmaudit.pl \ - zmfilter.pl \ - zmtelemetry.pl \ - zmtrigger.pl \ - zmx10.pl \ - zmwatch.pl \ - zmpkg.pl \ - zmupdate.pl \ - zmvideo.pl \ - zmcontrol.pl \ - zmtrack.pl \ - zmcamtool.pl \ - zmsystemctl.pl - -SUBDIRS = \ - . \ - ZoneMinder - -EXTRA_DIST = \ - zmdc.pl.in \ - zmaudit.pl.in \ - zmfilter.pl.in \ - zmtelemetry.pl.in \ - zmtrigger.pl.in \ - zmx10.pl.in \ - zmwatch.pl.in \ - zmpkg.pl.in \ - zmupdate.pl.in \ - zmvideo.pl.in \ - zmcontrol.pl.in \ - zmtrack.pl.in \ - zmcamtool.pl.in \ - zmsystemctl.pl.in \ - ZoneMinder/Makefile.PL \ - ZoneMinder/README \ - ZoneMinder/Changes \ - ZoneMinder/META.yml \ - ZoneMinder/MANIFEST \ - ZoneMinder/t/ZoneMinder.t \ - ZoneMinder/lib/ZoneMinder.pm \ - ZoneMinder/lib/ZoneMinder/Base.pm.in \ - ZoneMinder/lib/ZoneMinder/Config.pm.in \ - ZoneMinder/lib/ZoneMinder/Logger.pm \ - ZoneMinder/lib/ZoneMinder/General.pm \ - ZoneMinder/lib/ZoneMinder/Database.pm \ - ZoneMinder/lib/ZoneMinder/Memory.pm.in \ - ZoneMinder/lib/ZoneMinder/Memory/Shared.pm \ - ZoneMinder/lib/ZoneMinder/Memory/Mapped.pm \ - ZoneMinder/lib/ZoneMinder/ConfigAdmin.pm \ - ZoneMinder/lib/ZoneMinder/ConfigData.pm.in \ - ZoneMinder/lib/ZoneMinder/Control.pm \ - ZoneMinder/lib/ZoneMinder/Control \ - ZoneMinder/lib/ZoneMinder/Trigger/Channel.pm \ - ZoneMinder/lib/ZoneMinder/Trigger/Channel/Handle.pm \ - ZoneMinder/lib/ZoneMinder/Trigger/Channel/Spawning.pm \ - ZoneMinder/lib/ZoneMinder/Trigger/Channel/Inet.pm \ - ZoneMinder/lib/ZoneMinder/Trigger/Channel/Unix.pm \ - ZoneMinder/lib/ZoneMinder/Trigger/Channel/File.pm \ - ZoneMinder/lib/ZoneMinder/Trigger/Channel/Serial.pm \ - ZoneMinder/lib/ZoneMinder/Trigger/Connection.pm \ - ZoneMinder/lib/ZoneMinder/Trigger/Connection/Example.pm \ - zm.in \ - zmdbbackup.in \ - zmdbrestore.in \ - zmeventdump.in \ - zmlogrotate.conf.in - diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in b/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in index 0c5a82a30..3a226cdc8 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in +++ b/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in @@ -66,12 +66,6 @@ use Carp; BEGIN { my $config_file = ZM_CONFIG; - ( my $local_config_file = $config_file ) =~ s|^.*/|./|; - if ( -s $local_config_file and -r $local_config_file ) - { - print( STDERR "Warning, overriding installed $local_config_file file with local copy\n" ); - $config_file = $local_config_file; - } open( my $CONFIG, "<", $config_file ) or croak( "Can't open config file '$config_file': $!" ); foreach my $str ( <$CONFIG> ) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in index 8c4ea5d95..18306e52f 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in +++ b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in @@ -3759,161 +3759,6 @@ body = "ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% s type => $types{integer}, category => "lowband", }, - { - name => "ZM_WEB_P_CAN_STREAM", - default => "auto", - description => "Override the automatic detection of browser streaming capability", - help => qqq(" - If you know that your browser can handle image streams of the - type 'multipart/x-mixed-replace' but ZoneMinder does not detect - this correctly you can set this option to ensure that the - stream is delivered with or without the use of the Cambozola - plugin. Selecting 'yes' will tell ZoneMinder that your browser - can handle the streams natively, 'no' means that it can't and - so the plugin will be used while 'auto' lets ZoneMinder decide. - "), - type => $types{tristate}, - category => "phoneband", - }, - { - name => "ZM_WEB_P_STREAM_METHOD", - default => "jpeg", - description => "Which method should be used to send video streams to your browser.", - help => qqq(" - ZoneMinder can be configured to use either mpeg encoded video - or a series or still jpeg images when sending video streams. - This option defines which is used. If you choose mpeg you - should ensure that you have the appropriate plugins available - on your browser whereas choosing jpeg will work natively on - Mozilla and related browsers and with a Java applet on Internet - Explorer - "), - type => { - db_type =>"string", - hint =>"mpeg|jpeg", - pattern =>qr|^([mj])|i, - format =>q( $1 =~ /^m/ ? "mpeg" : "jpeg" ) - }, - category => "phoneband", - }, - { - name => "ZM_WEB_P_DEFAULT_SCALE", - default => "100", - description => "What the default scaling factor applied to 'live' or 'event' views is (%)", - help => qqq(" - Normally ZoneMinder will display 'live' or 'event' streams in - their native size. However if you have monitors with large - dimensions or a slow link you may prefer to reduce this size, - alternatively for small monitors you can enlarge it. This - options lets you specify what the default scaling factor will - be. It is expressed as a percentage so 100 is normal size, 200 - is double size etc. - "), - type => { - db_type =>"integer", - hint =>"25|33|50|75|100|150|200|300|400", - pattern =>qr|^(\d+)$|, format=>q( $1 ) - }, - category => "phoneband", - }, - { - name => "ZM_WEB_P_DEFAULT_RATE", - default => "100", - description => "What the default replay rate factor applied to 'event' views is (%)", - help => qqq(" - Normally ZoneMinder will display 'event' streams at their - native rate, i.e. as close to real-time as possible. However if - you have long events it is often convenient to replay them at a - faster rate for review. This option lets you specify what the - default replay rate will be. It is expressed as a percentage so - 100 is normal rate, 200 is double speed etc. - "), - type => { - db_type =>"integer", - hint =>"25|50|100|150|200|400|1000|2500|5000|10000", - pattern =>qr|^(\d+)$|, - format =>q( $1 ) - }, - category => "phoneband", - }, - { - name => "ZM_WEB_P_VIDEO_BITRATE", - default => "8000", - description => "What the bitrate of the video encoded stream should be set to", - help => qqq(" - When encoding real video via the ffmpeg library a bit rate can - be specified which roughly corresponds to the available - bandwidth used for the stream. This setting effectively - corresponds to a 'quality' setting for the video. A low value - will result in a blocky image whereas a high value will produce - a clearer view. Note that this setting does not control the - frame rate of the video however the quality of the video - produced is affected both by this setting and the frame rate - that the video is produced at. A higher frame rate at a - particular bit rate result in individual frames being at a - lower quality. - "), - type => $types{integer}, - category => "phoneband", - }, - { - name => "ZM_WEB_P_VIDEO_MAXFPS", - default => "5", - description => "What the maximum frame rate for streamed video should be", - help => qqq(" - When using streamed video the main control is the bitrate which - determines how much data can be transmitted. However a lower - bitrate at high frame rates results in a lower quality image. - This option allows you to limit the maximum frame rate to - ensure that video quality is maintained. An additional - advantage is that encoding video at high frame rates is a - processor intensive task when for the most part a very high - frame rate offers little perceptible improvement over one that - has a more manageable resource requirement. Note, this option - is implemented as a cap beyond which binary reduction takes - place. So if you have a device capturing at 15fps and set this - option to 10fps then the video is not produced at 10fps, but - rather at 7.5fps (15 divided by 2) as the final frame rate must - be the original divided by a power of 2. - "), - type => $types{integer}, - category => "phoneband", - }, - { - name => "ZM_WEB_P_SCALE_THUMBS", - default => "yes", - description => "Scale thumbnails in events, bandwidth versus cpu in rescaling", - help => qqq(" - If unset, this option sends the whole image to the browser - which resizes it in the window. If set the image is scaled down - on the server before sending a reduced size image to the - browser to conserve bandwidth at the cost of cpu on the server. - Note that ZM can only perform the resizing if the appropriate - PHP graphics functionality is installed. This is usually - available in the php-gd package. - "), - type => $types{boolean}, - category => "phoneband", - }, - { - name => "ZM_WEB_P_AJAX_TIMEOUT", - default => "10000", - description => "How long to wait for Ajax request responses (ms)", - help => qqq(" - The newer versions of the live feed and event views use Ajax to - request information from the server and populate the views - dynamically. This option allows you to specify a timeout if - required after which requests are abandoned. A timeout may be - necessary if requests would overwise hang such as on a slow - connection. This would tend to consume a lot of browser memory - and make the interface unresponsive. Ordinarily no requests - should timeout so this setting should be set to a value greater - than the slowest expected response. This value is in - milliseconds but if set to zero then no timeout will be used. - "), - type => $types{integer}, - category => "phoneband", - }, { name => "ZM_DYN_LAST_VERSION", default => "", @@ -3980,141 +3825,6 @@ body = "ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% s readonly => 1, category => "dynamic", }, - { - name => "ZM_EYEZM_DEBUG", - default => "no", - description => "Switch additional debugging on for eyeZm Plugin", - help => qqq(" - Enable or Disable extra debugging from the eyeZm Plugin. Extra - debugging information will be displayed in it's own file - (EYEZM_LOG_TO_FILE is set), or your Apache error log - "), - type => $types{boolean}, - category => "eyeZm", - }, - { - name => "ZM_EYEZM_LOG_TO_FILE", - default => "yes", - description => "When eyeZm Debugging is enabled, enabling this logs output to it's own file", - help => qqq(" - When EYEZM_DEBUG is on and EYEZM_LOG_TO_FILE is on, output - generated from the eyeZm Plugin will go to it's own file. - Otherwise it will go to the apache error log. - "), - type => $types{boolean}, - category => "eyeZm", - }, - { - name => "ZM_EYEZM_LOG_FILE", - default => "@ZM_LOGDIR@/zm_xml.log", - description => "Default filename to use when logging eyeZm Output and EYEZM_LOG_TO_FILE is enabled", - help => qqq(" - This file will contain it's own output from the eyeZm Plugin - when EYEZM_LOG_TO_FILE and EYEZM_DEBUG are both enabled - "), - type => $types{string}, - category => "eyeZm", - }, - { - name => "ZM_EYEZM_EVENT_VCODEC", - default => "mpeg4", - description => "Default video-codec to use for encoding events", - help => qqq(" - The eyeZm Plugin calls FFMPEG externally to encode the captured - images. If your FFMPEG is not built with support for H264, - change this to MPEG-4. If using H264, please check - http://www.eyezm.com for H264 requirements and that your eyeZm - version supports H264 (v1.2+). - "), - type => { - db_type =>"string", - hint =>"mpeg4|h264", - pattern =>qr|^([mh])|i, - format =>q( $1 =~ /^m/ ? "mpeg4" : "h264" ) - }, - category => "eyeZm", - }, - { - name => "ZM_EYEZM_FEED_VCODEC", - default => "mjpeg", - description => "Default video-codec to use for streaming the live feed", - help => qqq(" - Determines whether the live stream is generated using native - MJPEG streaming with ZoneMinder, or H264 using FFMPEG and - HTML-5 streaming. If using H264, please check - http://www.eyezm.com for H264 requirements and that your eyeZm - version supports H264 (v1.2+). This is just a default - parameter, and can be overridden with eyeZm. - "), - type => { - db_type =>"string", - hint =>"mjpeg|h264", - pattern =>qr|^([mh])|i, - format =>q( $1 =~ /^m/ ? "mjpeg" : "h264" ) - }, - category => "eyeZm", - }, - { - name => "ZM_EYEZM_H264_DEFAULT_BR", - default => "96k", - description => "Default bit-rate to use with FFMPEG for H264 streaming", - help => qqq(" - When using the eyeZm Plugin to stream H264 data, FFMPEG - requires a bitrate to control the quality and bandwidth of the - video. This should be specified in a format acceptable to - FFMPEG. The default value is sufficient for most installations. - This is just a default parameter, and can be overridden with - eyeZm. - "), - type => $types{string}, - category => "eyeZm", - }, - { - name => "ZM_EYEZM_H264_DEFAULT_EVBR", - default => "128k", - description => "Default bit-rate to use with FFMPEG for H264 event viewing", - help => qqq(" - When using the eyeZm Plugin to view events in H264, FFMPEG - requires a bitrate to control the quality and bandwidth of the - video. This should be specified in a format acceptable to - FFMPEG. The default value is sufficient for most installations. - This is just a default parameter, and can be overridden with - eyeZm. - "), - type => $types{string}, - category => "eyeZm", - }, - { - name => "ZM_EYEZM_H264_TIMEOUT", - default => "20", - description => "Timeout (sec) to wait for H264 stream to start before terminating", - help => qqq(" - The eyeZm Plugin will attempt to spawn an H264 stream when - requested, and require that it complete within the timeout - specified. If you have a slow system or find through the logs - that the H264 stream is not starting because the timeout is - expiring, even though FFMPEG is running, try increasing this - value. If you have a fast system, decreasing this value can - improve the responsiveness when there are issues starting H264 - streams - "), - type => $types{string}, - category => "eyeZm", - }, - { - name => "ZM_EYEZM_SEG_DURATION", - default => "3", - description => "Segment duration used for streaming using HTTP-5 Streaming protocol", - help => qqq(" - The HTTP-5 Live Streaming Protocol segments the input video - stream into small chunks of a duration specified by this - parameter. Increasing the segment duration will help with - choppy connections on the other end, but will increase the - latency in starting a stream. - "), - type => $types{string}, - category => "eyeZm", - }, ); our %options_hash = map { ( $_->{name}, $_ ) } @options; diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e29717642..505169eda 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,21 +14,19 @@ add_executable(zma zma.cpp) add_executable(zmu zmu.cpp) add_executable(zmf zmf.cpp) add_executable(zms zms.cpp) -add_executable(zmstreamer zmstreamer.cpp) target_link_libraries(zmc zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS}) target_link_libraries(zma zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS}) target_link_libraries(zmu zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS}) target_link_libraries(zmf zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS}) target_link_libraries(zms zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS}) -target_link_libraries(zmstreamer zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS}) # Generate man files for the binaries destined for the bin folder -FOREACH(CBINARY zma zmc zmf zmu zmstreamer) +FOREACH(CBINARY zma zmc zmf zmu) POD2MAN(${CMAKE_CURRENT_SOURCE_DIR}/${CBINARY}.cpp zoneminder-${CBINARY} 8) -ENDFOREACH(CBINARY zma zmc zmf zmu zmstreamer) +ENDFOREACH(CBINARY zma zmc zmf zmu) -install(TARGETS zmc zma zmu zmf zmstreamer RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}" PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) +install(TARGETS zmc zma zmu zmf RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}" PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) install(TARGETS zms RUNTIME DESTINATION "${ZM_CGIDIR}" PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) install(CODE "execute_process(COMMAND ln -sf zms nph-zms WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})" ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/nph-zms DESTINATION "${ZM_CGIDIR}") diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index aad3deb23..000000000 --- a/src/Makefile.am +++ /dev/null @@ -1,139 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -AM_CPPFLAGS = @MYSQL_CFLAGS@ @MARIADB_CFLAGS@ @FFMPEG_CFLAGS@ -Wall -finline-functions -fomit-frame-pointer -#AM_CXXFLAGS = -frepo - -CLEANFILES = *.rpo - -# This should be set to your CGI directory -cgidir = @CGI_PREFIX@ -# And these to the user and group of your webserver -webuser = @WEB_USER@ -webgroup = @WEB_GROUP@ - -bin_PROGRAMS = \ - zmc \ - zma \ - zmu \ - zms \ - zmf \ - zmstreamer - -zm_SOURCES = \ - zm_box.cpp \ - zm_buffer.cpp \ - zm_camera.cpp \ - zm_comms.cpp \ - zm_config.cpp \ - zm_coord.cpp \ - zm_curl_camera.cpp \ - zm.cpp \ - zm_db.cpp \ - zm_logger.cpp \ - zm_event.cpp \ - zm_exception.cpp \ - zm_file_camera.cpp \ - zm_ffmpeg_camera.cpp \ - zm_image.cpp \ - zm_jpeg.cpp \ - zm_libvlc_camera.cpp \ - zm_local_camera.cpp \ - zm_monitor.cpp \ - zm_ffmpeg.cpp \ - zm_mpeg.cpp \ - zm_poly.cpp \ - zm_regexp.cpp \ - zm_remote_camera.cpp \ - zm_remote_camera_http.cpp \ - zm_remote_camera_rtsp.cpp \ - zm_rtp.cpp \ - zm_rtp_ctrl.cpp \ - zm_rtp_data.cpp \ - zm_rtp_source.cpp \ - zm_rtsp.cpp \ - zm_rtsp_auth.cpp \ - zm_sdp.cpp \ - zm_signal.cpp \ - zm_stream.cpp \ - zm_thread.cpp \ - zm_time.cpp \ - zm_timer.cpp \ - zm_user.cpp \ - zm_utils.cpp \ - zm_video.cpp \ - zm_videostore.cpp \ - zm_zone.cpp - -zmc_SOURCES = zmc.cpp $(zm_SOURCES) -zma_SOURCES = zma.cpp $(zm_SOURCES) -zms_SOURCES = zms.cpp $(zm_SOURCES) -zmu_SOURCES = zmu.cpp $(zm_SOURCES) -zmf_SOURCES = zmf.cpp $(zm_SOURCES) -zmstreamer_SOURCES = zmstreamer.cpp $(zm_SOURCES) - -noinst_HEADERS = \ - jinclude.h \ - zm_box.h \ - zm_buffer.h \ - zm_camera.h \ - zm_comms.h \ - zm_config_defines.h \ - zm_config.h \ - zm_coord.h \ - zm_curl_camera.h \ - zm_db.h \ - zm_logger.h \ - zm_event.h \ - zm_exception.h \ - zmf.h \ - zm_file_camera.h \ - zm_ffmpeg_camera.h \ - zm_font.h \ - zm_font.h \ - zm.h \ - zm_image.h \ - zm_jpeg.h \ - zm_libvlc_camera.h \ - zm_local_camera.h \ - zm_mem_utils.h \ - zm_monitor.h \ - zm_ffmpeg.h \ - zm_mpeg.h \ - zm_poly.h \ - zm_regexp.h \ - zm_remote_camera.h \ - zm_remote_camera_http.h \ - zm_remote_camera_rtsp.h \ - zm_rgb.h \ - zm_rtp_ctrl.h \ - zm_rtp_data.h \ - zm_rtp.h \ - zm_rtp_source.h \ - zm_rtsp.h \ - zm_sdp.h \ - zm_signal.h \ - zm_stream.h \ - zm_thread.h \ - zm_time.h \ - zm_timer.h \ - zm_user.h \ - zm_utils.h \ - zm_video.h \ - zm_videostore.h \ - zm_zone.h - -EXTRA_DIST = \ - zm_config.h.in \ - zm_threaddata.cpp - -dist-hook: - @( rm $(distdir)/zm_config.h ) - -# Yes, you are correct. This is a HACK! -install-exec-hook: - ( cd $(DESTDIR)@bindir@; mkdir -p $(DESTDIR)$(cgidir); mv zms $(DESTDIR)$(cgidir) ) - ( cd $(DESTDIR)$(cgidir); chown $(webuser):$(webgroup) zms; ln -f zms nph-zms ) - -uninstall-hook: - ( cd $(DESTDIR)$(cgidir); rm -f zms nph-zms ) - diff --git a/src/zmstreamer.cpp b/src/zmstreamer.cpp deleted file mode 100644 index a16e50704..000000000 --- a/src/zmstreamer.cpp +++ /dev/null @@ -1,252 +0,0 @@ -// -// ZoneMinder Streamer, $Date: 2010-10-14 23:21:00 +0200 (Thu, 14 Oct 2010) $ -// Copyright (C) 2001-2010 Philip Coombes, Chris Kistner -// -// This program is based on revision 3143 of -// http://svn.zoneminder.com/svn/zm/trunk/src/zms.cpp -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -/* - -=head1 NAME - -zmstreamer - eyeZM video streamer - -=head1 SYNOPSIS - - zmstreamer -e - zmstreamer -o - zmstreamer -u - zmstreamer -f - zmstreamer -s - zmstreamer -b - zmstreamer -m - zmstreamer -d - zmstreamer -i - zmstreamer -? - zmstreamer -h - zmstreamer -v - -=head1 DESCRIPTION - -*DEPRECIATED* The xml skin and all files associated with the xml skin are now -depreciated. Please use the ZoneMinder API instead. - -This binary works in conjunction with the XML skin to stream video to iPhones -running the eyeZm app. - -=head1 OPTIONS - - -e - Specify output mode: mpeg/jpg/zip/single/raw. - -o - Specify output format. - -u - Specify buffer size in ms. - -f - Specify maximum framerate. - -s - Specify scale. - -b - Specify bitrate. - -m - Specify monitor id. - -d - 0 = off, 1 = no streaming, 2 = with streaming. - -i, -?, -h - Display usage information - -v - Print the installed version of ZoneMinder - -=cut - -*/ - -#include -#include - -#include -#include - -#include "zm.h" -#include "zm_db.h" -#include "zm_user.h" -#include "zm_signal.h" -#include "zm_monitor.h" -#include "zm_stream.h" - -// Possible command-line options -#define OPTIONS "e:o:u:f:s:b:m:d:i:?:h:v" - -// Default ZMS values -#define ZMS_DEFAULT_DEBUG 0 -#define ZMS_DEFAULT_ID 1 -#define ZMS_DEFAULT_BITRATE 100000 -#define ZMS_DEFAULT_SCALE 100 -#define ZMS_DEFAULT_MODE "mpeg" -#define ZMS_DEFAULT_FORMAT "asf" -#define ZMS_DEFAULT_FPS 25.0 -#define ZMS_DEFAULT_BUFFER 1000 - -int main(int argc, char** argv) { - self = argv[0]; - // Set initial values to the default values - int debug = ZMS_DEFAULT_DEBUG; - int id = ZMS_DEFAULT_ID; - int bitrate = ZMS_DEFAULT_BITRATE; - int scale = ZMS_DEFAULT_SCALE; - char mode[32]; - sprintf(mode, "%s", ZMS_DEFAULT_MODE); - char format[32]; - sprintf(format, "%s", ZMS_DEFAULT_FORMAT); - double maxfps = ZMS_DEFAULT_FPS; - int buffer = ZMS_DEFAULT_BUFFER; - - // Parse command-line options - int arg; - while ((arg = getopt(argc, argv, OPTIONS)) != -1) { - switch (arg) { - case 'e': - sprintf(mode, "%s", optarg); - break; - case 'o': - sprintf(format, "%s", optarg); - break; - case 'u': - buffer = atoi(optarg); - break; - case 'f': - maxfps = atof(optarg); - break; - case 's': - scale = atoi(optarg); - break; - case 'b': - bitrate = atoi(optarg); - break; - case 'm': - id = atoi(optarg); - break; - case 'd': - debug = atoi(optarg); - break; - case 'h': - case 'i': - case '?': - printf("-e : Specify output mode: mpeg/jpg/zip/single/raw. Default = %s\n", ZMS_DEFAULT_MODE); - printf("-o : Specify output format. Default = %s\n", ZMS_DEFAULT_FORMAT); - printf("-u : Specify buffer size in ms. Default = %d\n", ZMS_DEFAULT_BUFFER); - printf("-f : Specify maximum framerate. Default = %lf\n", ZMS_DEFAULT_FPS); - printf("-s : Specify scale. Default = %d\n", ZMS_DEFAULT_SCALE); - printf("-b : Specify bitrate. Default = %d\n", ZMS_DEFAULT_BITRATE); - printf("-m : Specify monitor id. Default = %d\n", ZMS_DEFAULT_ID); - printf("-d : 0 = off, 1 = no streaming, 2 = with streaming. Default = 0\n"); - printf("-i or -? or -h: This information\n"); - printf("-v : This installed version of ZoneMinder\n"); - return EXIT_SUCCESS; - case 'v': - std::cout << ZM_VERSION << "\n"; - exit(0); - } - } - - // Set stream type - StreamBase::StreamType streamtype; - if (!strcasecmp("raw", mode)) - streamtype = MonitorStream::STREAM_RAW; - else if (!strcasecmp("mpeg", mode)) - streamtype = MonitorStream::STREAM_MPEG; - else if (!strcasecmp("jpg", mode)) - streamtype = MonitorStream::STREAM_JPEG; - else if (!strcasecmp("single", mode)) - streamtype = MonitorStream::STREAM_SINGLE; - else if (!strcasecmp("zip", mode)) - streamtype = MonitorStream::STREAM_ZIP; - else - streamtype = MonitorStream::STREAM_MPEG; - - if (debug) { - // Show stream parameters - printf("Stream parameters:\n"); - switch (streamtype) { - case MonitorStream::STREAM_MPEG: - printf("Output mode (-e) = %s\n", "mpeg"); - printf("Output format (-o) = %s\n", format); - break; - default: - printf("Output mode (-e) = %s\n", mode); - } - printf("Buffer size (-u) = %d ms\n", buffer); - printf("Maximum FPS (-f) = %lf FPS\n", maxfps); - printf("Scale (-s) = %d%%\n", scale); - printf("Bitrate (-b) = %d bps\n", bitrate); - printf("Monitor Id (-m) = %d\n", id); - } - - if (debug) { - // Set ZM debugger to print to stdout - printf("Setting up ZoneMinder debugger to print to stdout..."); - setenv("ZM_DBG_PRINT", "1", 1); - printf("Done.\n"); - } - - // Loading ZM configurations - printf("Loading ZoneMinder configurations..."); - zmLoadConfig(); - printf("Done.\n"); - - logInit("zmstreamer"); - - ssedetect(); - - // Setting stream parameters - MonitorStream stream; - stream.setStreamScale(scale); // default = 100 (scale) - stream.setStreamReplayRate(100); // default = 100 (rate) - stream.setStreamMaxFPS(maxfps); // default = 10 (maxfps) - if (debug) stream.setStreamTTL(1); - else stream.setStreamTTL(0); // default = 0 (ttl) - stream.setStreamQueue(0); // default = 0 (connkey) - stream.setStreamBuffer(buffer); // default = 0 (buffer) - stream.setStreamStart(id); // default = 0 (monitor_id) - stream.setStreamType(streamtype); - if (streamtype == MonitorStream::STREAM_MPEG) { -#if HAVE_LIBAVCODEC - if (debug) printf("HAVE_LIBAVCODEC is set\n"); - stream.setStreamFormat(format); // default = "" (format) - stream.setStreamBitrate(bitrate); // default = 100000 (bitrate) -#else - fprintf(stderr, "MPEG streaming is disabled.\nYou should configure with the --with-ffmpeg option and rebuild to use this functionality.\n"); - logTerm(); - zmDbClose(); - return EXIT_FAILURE; -#endif - } - - if (debug != 1) { - if (debug) printf("Running stream..."); - - // Output headers - fprintf(stdout, "Server: ZoneMinder Video Server/%s\r\n", ZM_VERSION); - time_t now = time(0); - char date_string[64]; - strftime(date_string, sizeof (date_string) - 1, "%a, %d %b %Y %H:%M:%S GMT", gmtime(&now)); - fprintf(stdout, "Expires: Mon, 26 Jul 1997 05:00:00 GMT\r\n"); - fprintf(stdout, "Last-Modified: %s\r\n", date_string); - fprintf(stdout, "Cache-Control: no-store, no-cache, must-revalidate\r\n"); - fprintf(stdout, "Cache-Control: post-check=0, pre-check=0\r\n"); - fprintf(stdout, "Pragma: no-cache\r\n"); - - // Run stream - stream.runStream(); - } - if (debug) printf("Done.\n"); - - logTerm(); - zmDbClose(); - - return (EXIT_SUCCESS); -} diff --git a/web/Makefile.am b/web/Makefile.am deleted file mode 100644 index 077a4ff91..000000000 --- a/web/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -# This should be set to your web directory -webdir = @WEB_PREFIX@ -# And these to the user and group of your webserver -webuser = @WEB_USER@ -webgroup = @WEB_GROUP@ - -SUBDIRS = \ - ajax \ - css \ - graphics \ - includes \ - js \ - lang \ - skins \ - tools \ - views - -dist_web_DATA = \ - index.php - -# Yes, you are correct. This is a HACK! -install-data-hook: - ( cd $(DESTDIR)$(webdir); chown $(webuser):$(webgroup) $(dist_web_DATA) ) - ( cd $(DESTDIR)$(webdir); chown -R $(webuser):$(webgroup) $(SUBDIRS) ) - @-( cd $(DESTDIR)$(webdir); if ! test -e events; then mkdir events; fi; chown $(webuser):$(webgroup) events; chmod u+w events ) - @-( cd $(DESTDIR)$(webdir); if ! test -e images; then mkdir images; fi; chown $(webuser):$(webgroup) images; chmod u+w images ) - @-( cd $(DESTDIR)$(webdir); if ! test -e sounds; then mkdir sounds; fi; chown $(webuser):$(webgroup) sounds; chmod u+w sounds ) - @-( cd $(DESTDIR)$(webdir); if ! test -e tools; then mkdir tools; fi; chown $(webuser):$(webgroup) tools; chmod u+w tools ) - @-( cd $(DESTDIR)$(webdir); if ! test -e temp; then mkdir temp; fi; chown $(webuser):$(webgroup) temp; chmod u+w temp ) - -uninstall-hook: - @-( cd $(DESTDIR)$(webdir); rm -rf $(SUBDIRS) ) - @-( cd $(DESTDIR)$(webdir); rm -rf events images sounds tools temp ) diff --git a/web/ajax/Makefile.am b/web/ajax/Makefile.am deleted file mode 100644 index ef79e6cae..000000000 --- a/web/ajax/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/ajax - -dist_web_DATA = \ - alarm.php \ - control.php \ - event.php \ - log.php \ - status.php \ - stream.php \ - zone.php diff --git a/web/css/Makefile.am b/web/css/Makefile.am deleted file mode 100644 index 917b8f389..000000000 --- a/web/css/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/css - -dist_web_DATA = \ - reset.css \ - spinner.css \ - overlay.css diff --git a/web/graphics/Makefile.am b/web/graphics/Makefile.am deleted file mode 100644 index ec252c82e..000000000 --- a/web/graphics/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/graphics - -dist_web_DATA = \ - favicon.ico \ - spinner.gif \ - transparent.gif diff --git a/web/includes/Makefile.am b/web/includes/Makefile.am deleted file mode 100644 index d4a1ece9b..000000000 --- a/web/includes/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/includes - -web_DATA = \ - config.php - -dist_web_DATA = \ - Monitor.php \ - Server.php \ - actions.php \ - database.php \ - functions.php \ - control_functions.php \ - lang.php \ - logger.php - -EXTRA_DIST = \ - config.php.in diff --git a/web/includes/actions.php b/web/includes/actions.php index 7de7a8238..4cd056116 100644 --- a/web/includes/actions.php +++ b/web/includes/actions.php @@ -921,7 +921,6 @@ if ( !empty($action) ) case "highband" : case "medband" : case "lowband" : - case "phoneband" : break; } } diff --git a/web/includes/functions.php b/web/includes/functions.php index 4645a21aa..5b5b0972f 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -985,7 +985,7 @@ function daemonControl( $command, $daemon=false, $args=false ) function zmcControl( $monitor, $mode=false ) { - if ( (!ZM_SERVER) or ( ZM_SERVER==$monitor[ServerId}) ) { + if ( (!defined('ZM_SERVER_ID')) or ( ZM_SERVER_ID==$monitor['ServerId'] ) ) { $row = NULL; if ( $monitor['Type'] == "Local" ) { @@ -1016,7 +1016,7 @@ function zmcControl( $monitor, $mode=false ) function zmaControl( $monitor, $mode=false ) { - if ( (!ZM_SERVER) or ( ZM_SERVER==$monitor[ServerId}) ) { + if ( (!defined('ZM_SERVER_ID')) or ( ZM_SERVER_ID==$monitor['ServerId'] ) ) { if ( !is_array( $monitor ) ) { $monitor = dbFetchOne( "select C.*, M.* from Monitors as M left join Controls as C on (M.ControlId = C.Id ) where M.Id=?", NULL, array($monitor) ); diff --git a/web/js/Makefile.am b/web/js/Makefile.am deleted file mode 100644 index 23e027180..000000000 --- a/web/js/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/js - -dist_web_DATA = \ - logger.js \ - overlay.js \ - mootools.ext.js \ - videojs.zoomrotate.js diff --git a/web/lang/Makefile.am b/web/lang/Makefile.am deleted file mode 100644 index 22d256a2e..000000000 --- a/web/lang/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/lang - -dist_web_DATA = \ - big5_big5.php \ - cn_zh.php \ - cs_cz.php \ - de_de.php \ - dk_dk.php \ - et_ee.php \ - en_gb.php \ - en_us.php \ - es_ar.php \ - fr_fr.php \ - he_il.php \ - hu_hu.php \ - it_it.php \ - ja_jp.php \ - nl_nl.php \ - pl_pl.php \ - pt_br.php \ - ro_ro.php \ - ru_ru.php \ - se_se.php diff --git a/web/skins/Makefile.am b/web/skins/Makefile.am deleted file mode 100644 index ae0abd8e8..000000000 --- a/web/skins/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -SUBDIRS = \ - classic \ - mobile \ - xml diff --git a/web/skins/classic/Makefile.am b/web/skins/classic/Makefile.am deleted file mode 100644 index 986beae0d..000000000 --- a/web/skins/classic/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/skins/classic - -SUBDIRS = \ - ajax \ - css \ - graphics \ - includes \ - js \ - lang \ - views - -dist_web_DATA = \ - skin.php diff --git a/web/skins/classic/ajax/Makefile.am b/web/skins/classic/ajax/Makefile.am deleted file mode 100644 index f910cbc5c..000000000 --- a/web/skins/classic/ajax/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/skins/classic/ajax - -dist_web_DATA = # No files here diff --git a/web/skins/classic/css/Makefile.am b/web/skins/classic/css/Makefile.am deleted file mode 100644 index 2c43d2e47..000000000 --- a/web/skins/classic/css/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/skins/classic/css - -SUBDIRS = dark \ - flat \ - classic diff --git a/web/skins/classic/css/classic/Makefile.am b/web/skins/classic/css/classic/Makefile.am deleted file mode 100644 index 48dc58ab7..000000000 --- a/web/skins/classic/css/classic/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/skins/classic/css/classic - -SUBDIRS = views - -dist_web_DATA = \ - skin.css \ - control.css \ - export.css diff --git a/web/skins/classic/css/classic/views/Makefile.am b/web/skins/classic/css/classic/views/Makefile.am deleted file mode 100644 index d07eaac4f..000000000 --- a/web/skins/classic/css/classic/views/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/skins/classic/css/classic/views - -dist_web_DATA = \ - console.css \ - controlcaps.css \ - control.css \ - devices.css \ - event.css \ - events.css \ - export.css \ - filter.css \ - frame.css \ - frames.css \ - groups.css \ - log.css \ - monitor.css \ - montage_2wide.css \ - montage_3wide50enlarge.css \ - montage_3wide.css \ - montage_4wide.css \ - montage.css \ - montage_freeform.css \ - options.css \ - stats.css \ - timeline.css \ - timeline.css.php \ - video.css \ - watch.css \ - zone.css diff --git a/web/skins/classic/css/dark/Makefile.am b/web/skins/classic/css/dark/Makefile.am deleted file mode 100644 index 6961860eb..000000000 --- a/web/skins/classic/css/dark/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/skins/classic/css/dark - -SUBDIRS = views - -dist_web_DATA = \ - skin.css \ - control.css \ - export.css diff --git a/web/skins/classic/css/dark/views/Makefile.am b/web/skins/classic/css/dark/views/Makefile.am deleted file mode 100644 index 2180d6432..000000000 --- a/web/skins/classic/css/dark/views/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/skins/classic/css/dark/views - -dist_web_DATA = \ - console.css \ - controlcaps.css \ - control.css \ - devices.css \ - event.css \ - events.css \ - export.css \ - filter.css \ - frame.css \ - frames.css \ - groups.css \ - log.css \ - monitor.css \ - montage_2wide.css \ - montage_3wide50enlarge.css \ - montage_3wide.css \ - montage_4wide.css \ - montage.css \ - montage_freeform.css \ - options.css \ - stats.css \ - timeline.css \ - timeline.css.php \ - video.css \ - watch.css \ - zone.css diff --git a/web/skins/classic/css/flat/Makefile.am b/web/skins/classic/css/flat/Makefile.am deleted file mode 100644 index 297982929..000000000 --- a/web/skins/classic/css/flat/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/skins/classic/css/flat - -SUBDIRS = views - -dist_web_DATA = \ - skin.css \ - control.css \ - export.css diff --git a/web/skins/classic/css/flat/views/Makefile.am b/web/skins/classic/css/flat/views/Makefile.am deleted file mode 100644 index dff0aa29b..000000000 --- a/web/skins/classic/css/flat/views/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/skins/classic/css/flat/views - -dist_web_DATA = \ - console.css \ - controlcaps.css \ - control.css \ - devices.css \ - event.css \ - events.css \ - export.css \ - filter.css \ - frame.css \ - frames.css \ - groups.css \ - log.css \ - monitor.css \ - montage_2wide.css \ - montage_3wide50enlarge.css \ - montage_3wide.css \ - montage_4wide.css \ - montage.css \ - montage_freeform.css \ - options.css \ - stats.css \ - timeline.css \ - timeline.css.php \ - video.css \ - watch.css \ - zone.css diff --git a/web/skins/classic/graphics/Makefile.am b/web/skins/classic/graphics/Makefile.am deleted file mode 100644 index c5c7b6bba..000000000 --- a/web/skins/classic/graphics/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/skins/classic/graphics - -dist_web_DATA = \ - arrow-d.gif \ - arrow-dl.gif \ - arrow-dr.gif \ - arrow-l-d.gif \ - arrow-l.gif \ - arrow-l-u.gif \ - arrow-r.gif \ - arrow-s-d.gif \ - arrow-s-u.gif \ - arrow-u.gif \ - arrow-ul.gif \ - arrow-ur.gif \ - center.gif \ - point-g.gif \ - point-o.gif \ - point-r.gif \ - seq-d.gif \ - seq-u.gif diff --git a/web/skins/classic/includes/Makefile.am b/web/skins/classic/includes/Makefile.am deleted file mode 100644 index 690df231a..000000000 --- a/web/skins/classic/includes/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/skins/classic/includes - -dist_web_DATA = \ - init.php \ - config.php \ - functions.php \ - control_functions.php \ - export_functions.php \ - timeline_functions.php diff --git a/web/skins/classic/js/Makefile.am b/web/skins/classic/js/Makefile.am deleted file mode 100644 index 3f5ffdda2..000000000 --- a/web/skins/classic/js/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/skins/classic/js - -dist_web_DATA = \ - skin.js \ - classic.js \ - dark.js \ - flat.js \ - skin.js.php diff --git a/web/skins/classic/lang/Makefile.am b/web/skins/classic/lang/Makefile.am deleted file mode 100644 index 6a089b4fa..000000000 --- a/web/skins/classic/lang/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/skins/classic/lang - -dist_web_DATA = # No files here diff --git a/web/skins/classic/views/Makefile.am b/web/skins/classic/views/Makefile.am deleted file mode 100644 index 4167a886b..000000000 --- a/web/skins/classic/views/Makefile.am +++ /dev/null @@ -1,57 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -SUBDIRS = \ - js - -webdir = @WEB_PREFIX@/skins/classic/views - -dist_web_DATA = \ - bandwidth.php \ - blank.php \ - console.php \ - controlcap.php \ - controlcaps.php \ - control.php \ - controlpreset.php \ - cycle.php \ - device.php \ - devices.php \ - donate.php \ - error.php \ - eventdetail.php \ - event.php \ - events.php \ - export.php \ - filter.php \ - filtersave.php \ - frame.php \ - frames.php \ - function.php \ - group.php \ - groups.php \ - log.php \ - login.php \ - logout.php \ - Makefile.am \ - monitor.php \ - monitorpreset.php \ - monitorprobe.php \ - montage.php \ - montagereview.php \ - none.php \ - onvifprobe.php \ - optionhelp.php \ - options.php \ - postlogin.php \ - server.php \ - settings.php \ - state.php \ - stats.php \ - status.php \ - timeline.php \ - user.php \ - version.php \ - video.php \ - watch.php \ - zone.php \ - zones.php diff --git a/web/skins/classic/views/js/Makefile.am b/web/skins/classic/views/js/Makefile.am deleted file mode 100644 index 73c74fafe..000000000 --- a/web/skins/classic/views/js/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/skins/classic/views/js - -dist_web_DATA = \ - console.js \ - console.js.php \ - control.js \ - controlpreset.js \ - controlpreset.js.php \ - cycle.js \ - cycle.js.php \ - devices.js \ - donate.js \ - donate.js.php \ - event.js \ - event.js.php \ - events.js \ - events.js.php \ - export.js \ - export.js.php \ - filter.js \ - filter.js.php \ - group.js \ - groups.js \ - log.js \ - login.js \ - Makefile.am \ - monitor.js \ - monitor.js.php \ - monitorpreset.js \ - monitorprobe.js \ - montage.js \ - montage.js.php \ - onvifprobe.js \ - options.js.php \ - postlogin.js.php \ - state.js \ - state.js.php \ - timeline.js \ - timeline.js.php \ - user.js \ - version.js \ - version.js.php \ - video.js \ - video.js.php \ - watch.js \ - watch.js.php \ - zone.js \ - zone.js.php diff --git a/web/skins/classic/views/js/watch.js b/web/skins/classic/views/js/watch.js index 9c39c897a..264a4b65f 100644 --- a/web/skins/classic/views/js/watch.js +++ b/web/skins/classic/views/js/watch.js @@ -37,9 +37,14 @@ function changeScale() /*Stream could be an applet so can't use moo tools*/ var streamImg = document.getElementById('liveStream'); - streamImg.style.width = newWidth + "px"; - streamImg.style.height = newHeight + "px"; + if ( streamImg ) { + streamImg.style.width = newWidth + "px"; + streamImg.style.height = newHeight + "px"; + streamImg.src = streamImg.src.replace(/scale=\d+/i,'scale='+scale); + } else { + console.error("No element found for liveStream."); + } } var alarmState = STATE_IDLE; @@ -205,8 +210,13 @@ function getStreamCmdResponse( respObj, respText ) $('enableDisableAlarms').removeClass( 'hidden' ); } } - else + else { checkStreamForErrors("getStreamCmdResponse",respObj);//log them + // Try to reload the image stream. + var streamImg = document.getElementById('liveStream'); + if ( streamImg ) + streamImg.src = streamImg.src.replace(/rand=\d+/i,'rand='+Math.floor((Math.random() * 1000000) )); + } var streamCmdTimeout = statusRefreshTimeout; if ( alarmState == STATE_ALARM || alarmState == STATE_ALERT ) diff --git a/web/skins/classic/views/options.php b/web/skins/classic/views/options.php index 9c3b4a418..1140b7bfd 100644 --- a/web/skins/classic/views/options.php +++ b/web/skins/classic/views/options.php @@ -42,8 +42,6 @@ $tabs['x10'] = translate('X10'); $tabs['highband'] = translate('HighBW'); $tabs['medband'] = translate('MediumBW'); $tabs['lowband'] = translate('LowBW'); -$tabs['phoneband'] = translate('PhoneBW'); -$tabs['eyeZm'] = "eyeZm"; $tabs['users'] = translate('Users'); if ( isset($_REQUEST['tab']) ) diff --git a/web/skins/mobile/Makefile.am b/web/skins/mobile/Makefile.am deleted file mode 100644 index 35051fade..000000000 --- a/web/skins/mobile/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/skins/mobile - -SUBDIRS = \ - ajax \ - css \ - graphics \ - includes \ - lang \ - views - -dist_web_DATA = \ - skin.php diff --git a/web/skins/mobile/ajax/Makefile.am b/web/skins/mobile/ajax/Makefile.am deleted file mode 100644 index 0558929c0..000000000 --- a/web/skins/mobile/ajax/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/skins/mobile/ajax - -dist_web_DATA = # No files here diff --git a/web/skins/mobile/css/Makefile.am b/web/skins/mobile/css/Makefile.am deleted file mode 100644 index 6353e163e..000000000 --- a/web/skins/mobile/css/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/skins/mobile/css - -dist_web_DATA = \ - skin.css diff --git a/web/skins/mobile/css/skin.css b/web/skins/mobile/css/skin.css deleted file mode 100644 index b996392a3..000000000 --- a/web/skins/mobile/css/skin.css +++ /dev/null @@ -1,311 +0,0 @@ -/* - * Primary look and feel styles - */ - -body { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 100%; - color: #333333; - font-weight: normal; - text-align: center; -} - -h1 { - font-family: inherit; - font-size: 120%; - color: #000066; - font-weight: bold; -} - -h2 { - font-family: inherit; - font-size: 110%; - color: #000066; - font-weight: bold; -} - -h3 { - font-family: inherit; - font-size: 100%; - color: #016A9D; - font-weight: bold; -} - -p { - font-family: inherit; - font-size: 100%; - color: #333333; - font-weight: normal; -} - -th { - font-weight: bold; - color: #016A9D; -} - -a:link { - color: #7F7FB2; - text-decoration: none; -} - -a:visited { - color: #7F7FB2; - text-decoration: none; -} - -a:hover { - color: #666699; - text-decoration: underline; -} - -label { - margin-right: 4px; -} - -input,textarea,select { - border: 1px #7F7FB2 solid; - font-family: inherit; - font-size: 100%; - color: #333333; -} - -input[type=text], input[type=password], textarea { - padding: 1px; -} - -input.noborder { - border: 0; -} - -input[disabled] { - color: #888888; -} - -img.normal { - border: white solid 1px; -} - -img.alarm { - border: red solid 1px; -} - -hr { - height: 1px; - width: 100%; - border: 0; - color: #7f7fb2; - background-color: #7f7fb2; -} - -/* - * Major league table for multiple inputs or presentation - */ - -#content table.major { - margin: 4px auto; - width: 100%; - border-collapse: collapse; -} - -#content table.major tr.highlight { - background-color: #eeeeee; -} - -#content table.major thead tr th { - padding-top: 6px; - padding-bottom: 6px; - vertical-align: middle; -} - -#content table.major tfoot td { - padding-top: 6px; - padding-bottom: 6px; - vertical-align: middle; -} - -#content table.major th, #content table.major td { - border: 1px solid #7f7fb2; - padding: 3px; - text-align: left; -} - -#content table.major th { - vertical-align: bottom; -} - -#content table.major td { - vertical-align: middle; -} - -#content table.major th[scope=row] { - padding: 4px 3px 3px; - vertical-align: top; - text-align: right; -} - -#content table.major .colMark, #content table.major .colSelect { - text-align: center; -} -/* - * Lesser table for very simple forms - */ - -#content table.minor { - width: 200px; - margin: 0 auto; -} - -#content table.minor td { - padding: 4px; -} - -#content table.minor .colLeft { - width: 50%; - text-align: right; -} - -#content table.minor .colRight { - width: 50%; - text-align: left; -} - -#content table.minor input[type=submit] -{ - margin-top: 4px; - padding: 0 2px; - font-size: 120%; -} - -/* - * Behavior classes - */ -.error { - /*font-family: Verdana, Arial, Helvetica, sans-serif;*/ - font-size: 100%; - color: #DC143C; - font-weight: bold; -} - -.warn { - /*font-family: Verdana, Arial, Helvetica, sans-serif;*/ - font-size: 100%; - color: #FF8C00; - font-weight: bold; -} - -.info { - /*font-family: Verdana, Arial, Helvetica, sans-serif;*/ - font-size: 100%; - color: #688E23; - font-weight: bold; -} - -.errorText { - color: #DC143C; -} - -.warnText { - color: #FF8C00; -} - -.infoText { - color: #688E23; -} - -.disabledText { - font-style: italic; -} - -/* - * Generic useful classes, especially with mootools - */ - -.hidden { - display: none; -} - -.invisible { - visibility: hidden; -} - -.nowrap { - white-space: nowrap; -} - -div.clear { - clear: both; -} - -/* - * Primary layout styles - */ - -#page { - width: 100%; -} - -#header { - width: 98%; - line-height: 24px; - margin: 4px auto 0; - clear: both; -} - -#header h2 { - left: 0; -} - -#headerControl { -} - -#headerButtons { - float: right; -} - -#headerButtons a { - margin-left: 8px; -} - -#content { - width: 98%; - margin: 4px auto; - line-height: 130%; - text-align: center; - clear: both; -} - -#contentTable { - width: 100%; -} - -#content p { - margin-top: 4px; -} - -#content p.textblock { - text-align: justify; - padding: 4px; -} - -#content > input[type=submit], #content > input[type=button] { - margin-top: 4px; -} - -#content table input[type=submit], #content table input[type=button] { - margin-top: 0; -} - -#contentButtons { - margin: 4px auto 0; -} - -#contentButtons input, #contentButtons a { - margin: 0 4px; -} - -#footer { - width: 98%; - margin: 4px auto 0; - clear: both; -} - diff --git a/web/skins/mobile/graphics/Makefile.am b/web/skins/mobile/graphics/Makefile.am deleted file mode 100644 index dfd43bef7..000000000 --- a/web/skins/mobile/graphics/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/skins/mobile/graphics - -dist_web_DATA = # No files here diff --git a/web/skins/mobile/includes/Makefile.am b/web/skins/mobile/includes/Makefile.am deleted file mode 100644 index c88ad435a..000000000 --- a/web/skins/mobile/includes/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/skins/mobile/includes - -dist_web_DATA = \ - init.php \ - config.php \ - functions.php \ - control_functions.php diff --git a/web/skins/mobile/includes/config.php b/web/skins/mobile/includes/config.php deleted file mode 100644 index fc1eba9bb..000000000 --- a/web/skins/mobile/includes/config.php +++ /dev/null @@ -1,63 +0,0 @@ - "50x", - "2000" => "20x", - "500" => "5x", - "200" => "2x", - "100" => translate('Real'), - "50" => "1/2x", -); - -$scales = array( - "400" => "4x", - "300" => "3x", - "200" => "2x", - "150" => "1.5x", - "100" => translate('Actual'), - "75" => "3/4x", - "50" => "1/2x", - "33" => "1/3x", - "25" => "1/4x", -); - -switch ( $_COOKIE['zmBandwidth'] ) -{ - case "phone" : // Very incomplete at present - { - define( "ZM_WEB_CAN_STREAM", ZM_WEB_P_CAN_STREAM ); // Override the automatic detection of browser streaming capability - define( "ZM_WEB_STREAM_METHOD", ZM_WEB_P_STREAM_METHOD ); // Which method should be used to send video streams to your brow - define( "ZM_WEB_DEFAULT_SCALE", ZM_WEB_P_DEFAULT_SCALE ); // What the default scaling factor applied to 'live' or 'event' views is (%) - define( "ZM_WEB_DEFAULT_RATE", ZM_WEB_P_DEFAULT_RATE ); // What the default replay rate factor applied to 'event' views is (%) - define( "ZM_WEB_VIDEO_BITRATE", ZM_WEB_P_VIDEO_BITRATE ); // What the bitrate of any streamed video should be - define( "ZM_WEB_VIDEO_MAXFPS", ZM_WEB_P_VIDEO_MAXFPS ); // What the maximum frame rate of any streamed video should be - define( "ZM_WEB_SCALE_THUMBS", ZM_WEB_P_SCALE_THUMBS ); // Image scaling for thumbnails, bandwidth versus cpu in rescaling - define( "ZM_WEB_AJAX_TIMEOUT", ZM_WEB_P_AJAX_TIMEOUT ); // Timeout to use for Ajax requests, no timeout used if unset - - break; - } -} - -?> diff --git a/web/skins/mobile/includes/control_functions.php b/web/skins/mobile/includes/control_functions.php deleted file mode 100644 index 3a12cf467..000000000 --- a/web/skins/mobile/includes/control_functions.php +++ /dev/null @@ -1,184 +0,0 @@ - -
-
-
- -
- - " name="preset" value=""/> - -
-
-
-
- diff --git a/web/skins/mobile/includes/functions.php b/web/skins/mobile/includes/functions.php deleted file mode 100644 index aadbe435f..000000000 --- a/web/skins/mobile/includes/functions.php +++ /dev/null @@ -1,66 +0,0 @@ -'."\n" ); -?> - - - - <?php echo ZM_WEB_TITLE_PREFIX ?> - <?php echo $title ?> - - - - - - - - - - - diff --git a/web/skins/mobile/includes/init.php b/web/skins/mobile/includes/init.php deleted file mode 100644 index ae92bcdee..000000000 --- a/web/skins/mobile/includes/init.php +++ /dev/null @@ -1,29 +0,0 @@ - diff --git a/web/skins/mobile/lang/Makefile.am b/web/skins/mobile/lang/Makefile.am deleted file mode 100644 index 5084203fb..000000000 --- a/web/skins/mobile/lang/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/skins/mobile/lang - -dist_web_DATA = # No files here diff --git a/web/skins/mobile/skin.php b/web/skins/mobile/skin.php deleted file mode 100644 index 51ea63e01..000000000 --- a/web/skins/mobile/skin.php +++ /dev/null @@ -1,97 +0,0 @@ -GetDeviceCapabilitiesFromAgent($_SERVER['HTTP_USER_AGENT']); - - //print_r( $wurfl->wurfl_agent ); - if ( $wurfl->wurfl_agent ) - { - if ( $wurfl->getDeviceCapability( 'html_wi_oma_xhtmlmp_1_0' ) ) - { - $device['width'] = $wurfl->getDeviceCapability( 'resolution_width' ); - $device['height'] = $wurfl->getDeviceCapability( 'resolution_height' ); - } - } -} -else -{ - // This is an example of using fixed device strings to just match your phone etc - $devices = array( - array( 'name'=>"Motorola V600", 'ua_match'=>"MOT-V600", 'skin'=>"mobile", 'cookies'=>false, 'width'=>176, 'height'=>220 ), - ); - - foreach ( $devices as $tempDevice ) - { - if ( preg_match( '/'.$tempDevice['ua_match'].'/', $_SERVER['HTTP_USER_AGENT'] ) ) - { - $skin = $tempDevice['skin']; - $cookies = $tempDevice['cookies']; - break; - } - } -} - -foreach ( getSkinIncludes( 'includes/config.php' ) as $includeFile ) - require_once $includeFile; - -foreach ( getSkinIncludes( 'includes/functions.php' ) as $includeFile ) - require_once $includeFile; - -if ( empty($view) ) - $view = isset($user)?'console':'login'; - -if ( !isset($user) && ZM_OPT_USE_AUTH && ZM_AUTH_TYPE == "remote" && !empty( $_SERVER['REMOTE_USER']) ) -{ - $view = "postlogin"; - $action = "login"; - $_REQUEST['username'] = $_SERVER['REMOTE_USER']; -} - -// If there are additional actions -foreach ( getSkinIncludes( 'includes/actions.php' ) as $includeFile ) - require_once $includeFile; - -?> diff --git a/web/skins/mobile/views/Makefile.am b/web/skins/mobile/views/Makefile.am deleted file mode 100644 index c7d175ca3..000000000 --- a/web/skins/mobile/views/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -SUBDIRS = \ - css - -webdir = @WEB_PREFIX@/skins/mobile/views - -dist_web_DATA = \ - console.php \ - devices.php \ - error.php \ - eventdetails.php \ - event.php \ - events.php \ - filter.php \ - frame.php \ - function.php \ - login.php \ - montage.php \ - state.php \ - video.php \ - watch.php diff --git a/web/skins/mobile/views/console.php b/web/skins/mobile/views/console.php deleted file mode 100644 index 50b5f4775..000000000 --- a/web/skins/mobile/views/console.php +++ /dev/null @@ -1,178 +0,0 @@ - array( - "terms" => array( - array( "attr" => "Archived", "op" => "=", "val" => "0" ), - array( "cnj" => "and", "attr" => "DateTime", "op" => ">=", "val" => "-1 hour" ), - ) - ), - ), - // Today - array( - "filter" => array( - "terms" => array( - array( "attr" => "Archived", "op" => "=", "val" => "0" ), - array( "cnj" => "and", "attr" => "DateTime", "op" => ">=", "val" => "today" ), - ) - ), - ), -); - -$running = daemonCheck(); -$status = $running?translate('Running'):translate('Stopped'); - -if ( $group = dbFetchOne( "select * from Groups where Name = 'Mobile'" ) ) - $groupIds = array_flip(explode( ',', $group['MonitorIds'] )); - -$maxWidth = 0; -$maxHeight = 0; -$cycleCount = 0; -$monitors = dbFetchAll( "select * from Monitors order by Sequence asc" ); -for ( $i = 0; $i < count($monitors); $i++ ) -{ - if ( !visibleMonitor( $monitors[$i]['Id'] ) ) - { - continue; - } - if ( $group && !empty($groupIds) && !array_key_exists( $monitors[$i]['Id'], $groupIds ) ) - { - continue; - } - $monitors[$i]['Show'] = true; - $monitors[$i]['zmc'] = zmcStatus( $monitors[$i] ); - $monitors[$i]['zma'] = zmaStatus( $monitors[$i] ); - $counts = array(); - for ( $j = 0; $j < count($eventCounts); $j++ ) - { - $filter = addFilterTerm( $eventCounts[$j]['filter'], count($eventCounts[$j]['filter']['terms']), array( "cnj" => "and", "attr" => "MonitorId", "op" => "=", "val" => $monitors[$i]['Id'] ) ); - parseFilter( $filter, false, '&' ); - $counts[] = "count(if(1".$filter['sql'].",1,NULL)) as EventCount$j"; - $monitors[$i]['eventCounts'][$j]['filter'] = $filter; - } - $sql = "select ".join($counts,", ")." from Events as E where MonitorId = '".$monitors[$i]['Id']."'"; - $counts = dbFetchOne( $sql ); - if ( $monitors[$i]['Function'] != 'None' ) - { - $cycleCount++; - if ( $maxWidth < $monitors[$i]['Width'] ) $maxWidth = $monitors[$i]['Width']; - if ( $maxHeight < $monitors[$i]['Height'] ) $maxHeight = $monitors[$i]['Height']; - } - $monitors[$i] = array_merge( $monitors[$i], $counts ); -} - -xhtmlHeaders( __FILE__, translate('Console') ); -?> - -
- -
- - - - - - - - - - - - - - - - - 1 ) { -?> - - - - - - - -
".substr( $monitor['Function'], 0, 4 )."", canEdit( 'Monitors' ) ) ?>
  
-
-
- - diff --git a/web/skins/mobile/views/css/Makefile.am b/web/skins/mobile/views/css/Makefile.am deleted file mode 100644 index 86e0ff0a3..000000000 --- a/web/skins/mobile/views/css/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/skins/mobile/views/css - -dist_web_DATA = \ - console.css diff --git a/web/skins/mobile/views/css/console.css b/web/skins/mobile/views/css/console.css deleted file mode 100644 index 49c711039..000000000 --- a/web/skins/mobile/views/css/console.css +++ /dev/null @@ -1,16 +0,0 @@ -#systemTime { - float: left; -} - -#systemState { - margin: 0 auto; - text-align: center; -} - -#systemStats { - float: right; -} - -td.colEvents { - text-align: right; -} diff --git a/web/skins/mobile/views/devices.php b/web/skins/mobile/views/devices.php deleted file mode 100644 index add0a6bc5..000000000 --- a/web/skins/mobile/views/devices.php +++ /dev/null @@ -1,73 +0,0 @@ - - -
- -
- - - - - - - - -
-

-
-
- - diff --git a/web/skins/mobile/views/error.php b/web/skins/mobile/views/error.php deleted file mode 100644 index 33e99f09a..000000000 --- a/web/skins/mobile/views/error.php +++ /dev/null @@ -1,34 +0,0 @@ - - -
- -
-

-

-
-
- - diff --git a/web/skins/mobile/views/event.php b/web/skins/mobile/views/event.php deleted file mode 100644 index ead6b6eae..000000000 --- a/web/skins/mobile/views/event.php +++ /dev/null @@ -1,147 +0,0 @@ -= ?".$_REQUEST['filter']['sql'].$midSql." order by $sortColumn asc"; -} -$result = dbQuery( $sql, array( $event[$_REQUEST['sort_field']] ) ); -while ( $row = dbFetchNext( $result ) ) -{ - if ( $row['Id'] == $_REQUEST['eid'] ) - { - $prevEvent = dbFetchNext( $result ); - break; - } -} - -$sql = "select E.* from Events as E inner join Monitors as M on E.MonitorId = M.Id where $sortColumn ".($sortOrder=='asc'?'>=':'<=').' ?'.$_REQUEST['filter']['sql'].$midSql." order by $sortColumn $sortOrder"; -$result = dbQuery( $sql, array($event[$_REQUEST['sort_field']]) ); -while ( $row = dbFetchNext( $result ) ) -{ - if ( $row['Id'] == $_REQUEST['eid'] ) - { - $nextEvent = dbFetchNext( $result ); - break; - } -} - -$framesPerPage = 15; -$framesPerLine = 3; -$maxShortcuts = 3; - -$paged = $event['Frames'] > $framesPerPage; - -if ( $paged && !empty($_REQUEST['page']) ) -{ - $loFrameId = (($_REQUEST['page']-1)*$framesPerPage)+1; - $hiFrameId = min( $_REQUEST['page']*$framesPerPage, $event['Frames'] ); -} -else -{ - $loFrameId = 1; - $hiFrameId = $event['Frames']; -} - -$sql = 'SELECT * FROM Frames WHERE EventID = ?'; -if ( $paged && !empty($_REQUEST['page']) ) - $sql .= " and FrameId between $loFrameId and $hiFrameId"; -$sql .= " order by FrameId"; -$frames = dbFetchAll( $sql, NULL, array( $_REQUEST['eid'] ) ); - -$scale = getDeviceScale( $event['Width'], $event['Height'], $framesPerLine+0.3 ); - -$pages = (int)ceil($event['Frames']/$framesPerPage); -if ( !empty($_REQUEST['fid']) ) - $_REQUEST['page'] = ($_REQUEST['fid']/$framesPerPage)+1; - -$pagination = getPagination( $pages, $_REQUEST['page'], $maxShortcuts, '&eid='.$_REQUEST['eid'].$filterQuery.$sortQuery, '&' ); - -xhtmlHeaders( __FILE__, translate('Event').' - '.$event['Name'] ); -?> - -
- -
- -

- -
- - <?php echo $frame['Type'] ?>/<?php echo $frame['Type']=='Alarm'?$frame['Score']:0 ?> - -
-
-
- - diff --git a/web/skins/mobile/views/eventdetails.php b/web/skins/mobile/views/eventdetails.php deleted file mode 100644 index deee5eef2..000000000 --- a/web/skins/mobile/views/eventdetails.php +++ /dev/null @@ -1,86 +0,0 @@ - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
s
()
//
-
- 1 - <?php echo $frame['FrameId'] ?> -
-
- - -
-
-
- - diff --git a/web/skins/mobile/views/events.php b/web/skins/mobile/views/events.php deleted file mode 100644 index 40dd6eff8..000000000 --- a/web/skins/mobile/views/events.php +++ /dev/null @@ -1,157 +0,0 @@ -$deviceLines)?$deviceLines:$limitLeft; - } - $eventsSql .= " limit $limitStart, $limitAmount"; -} -elseif ( !empty( $_REQUEST['limit'] ) ) -{ - $eventsSql .= " limit 0, ".$_REQUEST['limit']; -} - -$nEvents = dbFetchOne( $countSql, 'EventCount' ); -if ( !empty($limit) && $nEvents > $_REQUEST['limit'] ) -{ - $nEvents = $_REQUEST['limit']; -} -$pages = (int)ceil($nEvents/$deviceLines); - -$maxShortcuts = 3; -$pagination = getPagination( $pages, $_REQUEST['page'], $maxShortcuts, $filterQuery.$sortQuery.'&limit='.$_REQUEST['limit'], '&' ); - -xhtmlHeaders( __FILE__, translate('Events') ); -?> - -
- -
- -

- - - - - - - - - - - - - - - - - - - -
-

-
-
- - diff --git a/web/skins/mobile/views/filter.php b/web/skins/mobile/views/filter.php deleted file mode 100644 index 4613f3c3c..000000000 --- a/web/skins/mobile/views/filter.php +++ /dev/null @@ -1,71 +0,0 @@ - - -
- -
-
- - 0 ) -{ -?> -
- -
-
- -
- -

- -
-
-
- - diff --git a/web/skins/mobile/views/frame.php b/web/skins/mobile/views/frame.php deleted file mode 100644 index f9bb41633..000000000 --- a/web/skins/mobile/views/frame.php +++ /dev/null @@ -1,73 +0,0 @@ - - -
- -
- "> -
- 1 ) { ?> - << - 1 ) { ?> - < - - > - - >> - -
-
-
- - diff --git a/web/skins/mobile/views/function.php b/web/skins/mobile/views/function.php deleted file mode 100644 index 421d91063..000000000 --- a/web/skins/mobile/views/function.php +++ /dev/null @@ -1,66 +0,0 @@ - - -
- -
-
- -
- -
-
- checked="checked"/> -
-
- -
-
-
-
- - diff --git a/web/skins/mobile/views/login.php b/web/skins/mobile/views/login.php deleted file mode 100644 index 6eb0b7db9..000000000 --- a/web/skins/mobile/views/login.php +++ /dev/null @@ -1,54 +0,0 @@ - - -
- -
-
- - - - - - - - - - -
" size="12"/>
-
- -
-
-
-
- - diff --git a/web/skins/mobile/views/montage.php b/web/skins/mobile/views/montage.php deleted file mode 100644 index 8311fe6f4..000000000 --- a/web/skins/mobile/views/montage.php +++ /dev/null @@ -1,75 +0,0 @@ - - -
- -
-
- - <?php echo $monitor['Name'] ?> - -
-
-
-
- - diff --git a/web/skins/mobile/views/state.php b/web/skins/mobile/views/state.php deleted file mode 100644 index 51cf71624..000000000 --- a/web/skins/mobile/views/state.php +++ /dev/null @@ -1,77 +0,0 @@ - - -
- -
-
- - -
- -
-
-
-
- - diff --git a/web/skins/mobile/views/video.php b/web/skins/mobile/views/video.php deleted file mode 100644 index 8f7ac8654..000000000 --- a/web/skins/mobile/views/video.php +++ /dev/null @@ -1,226 +0,0 @@ -= 352 && $deviceHeight >= 288 ) - $videoSize = "352x288"; -elseif ( $deviceWidth >= 176 && $deviceHeight >= 144 ) - $videoSize = "176x144"; -else - $videoSize = "128x96"; - -$eventWidth = $event['Width']; -$eventHeight = $event['Height']; - -if ( !isset( $rate ) ) - $_REQUEST['rate'] = reScale( RATE_BASE, $event['DefaultRate'], ZM_WEB_DEFAULT_RATE ); - -$eventPath = ZM_DIR_EVENTS.'/'.getEventPath( $event ); - -$videoFormats = array(); -$ffmpegFormats = preg_split( '/\s+/', ZM_FFMPEG_FORMATS ); -foreach ( $ffmpegFormats as $ffmpegFormat ) -{ - preg_match( '/^([^*]+)(\**)$/', $ffmpegFormat, $matches ); - $videoFormats[$matches[1]] = $matches[1]; - if ( $matches[2] == '*' ) - $defaultVideoFormat = $matches[1]; - elseif ( $matches[2] == '**' ) - $defaultPhoneFormat = $matches[1]; -} -if ( !isset($_REQUEST['videoFormat']) ) -{ - if ( isset($defaultPhoneFormat) ) - $_REQUEST['videoFormat'] = $defaultPhoneFormat; - elseif ( isset($defaultVideoFormat) ) - $_REQUEST['videoFormat'] = $defaultVideoFormat; - else - $videoFormat = $ffmpegFormats[0]; -} - -if ( !empty($_REQUEST['generate']) ) -{ - $videoFile = createVideo( $event, $_REQUEST['videoFormat'], $_REQUEST['rate'], $videoSize, !empty($_REQUEST['overwrite']) ); -} - -$videoFiles = array(); -if ( $dir = opendir( $eventPath ) ) -{ - while ( ($file = readdir( $dir )) !== false ) - { - $file = $eventPath.'/'.$file; - if ( is_file( $file ) ) - { - if ( preg_match( '/-S([\da-z]+)\.(?:'.join( '|', $videoFormats ).')$/', $file, $matches ) ) - { - if ( $matches[1] == $videoSize ) - { - $videoFiles[] = $file; - } - } - } - } - closedir( $dir ); -} - -if ( isset($_REQUEST['download']) ) -{ - header( "Content-type: ".getMimeType($videoFiles[$_REQUEST['download']])); - header( "Content-length: ".filesize($videoFiles[$_REQUEST['download']])); - header( "Content-disposition: attachment; filename=".preg_replace( "/^.*\//", "", $videoFiles[$_REQUEST['download']] )."; size=".filesize($videoFiles[$_REQUEST['download']]) ); - readfile( $videoFiles[$_REQUEST['download']] ); - exit; -} - -xhtmlHeaders( __FILE__, translate('Video').' - '.$event['Name'] ); -?> - -
-
-
- - - - - - - - - - - - - - -
checked="checked"/>
-
-
- -

- -

- - -

- - - - - - - - - 0 ) - { - $index = 0; - foreach ( $videoFiles as $file ) - { - preg_match( '/^(.+)-((?:r[_\d]+)|(?:F[_\d]+))-((?:s[_\d]+)|(?:S[0-9a-z]+))\.([^.]+)$/', $file, $matches ); - if ( preg_match( '/^r(.+)$/', $matches[2], $temp_matches ) ) - { - $rate = (int)(100 * preg_replace( '/_/', '.', $temp_matches[1] ) ); - $rateText = isset($rates[$rate])?$rates[$rate]:($rate."x"); - } - elseif ( preg_match( '/^F(.+)$/', $matches[2], $temp_matches ) ) - { - $rateText = $temp_matches[1]."fps"; - } - if ( preg_match( '/^s(.+)$/', $matches[3], $temp_matches ) ) - { - $scale = (int)(100 * preg_replace( '/_/', '.', $temp_matches[1] ) ); - $scaleText = isset($scales[$scale])?$scales[$scale]:($scale."x"); - } - elseif ( preg_match( '/^S(.+)$/', $matches[3], $temp_matches ) ) - { - $scaleText = $temp_matches[1]; - } -?> - - - - - - - - -
 / 
- -

- -
-
- - diff --git a/web/skins/mobile/views/watch.php b/web/skins/mobile/views/watch.php deleted file mode 100644 index b61001db9..000000000 --- a/web/skins/mobile/views/watch.php +++ /dev/null @@ -1,154 +0,0 @@ - - -
-
-

 -  fps

-

- - - -

- -
- -
- -
- - - -
- -
-
- - diff --git a/web/skins/xml/Makefile.am b/web/skins/xml/Makefile.am deleted file mode 100644 index 2c30d19a3..000000000 --- a/web/skins/xml/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/skins/xml - -SUBDIRS = \ - includes \ - views - -dist_web_DATA = \ - skin.php diff --git a/web/skins/xml/includes/Makefile.am b/web/skins/xml/includes/Makefile.am deleted file mode 100644 index c6128f8a2..000000000 --- a/web/skins/xml/includes/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/skins/xml/includes - -dist_web_DATA = \ - init.php \ - config.php \ - functions.php diff --git a/web/skins/xml/includes/config.php b/web/skins/xml/includes/config.php deleted file mode 100644 index 66d3af5ee..000000000 --- a/web/skins/xml/includes/config.php +++ /dev/null @@ -1,155 +0,0 @@ - "100x", - "5000" => "50x", - "2500" => "25x", - "1000" => "10x", - "400" => "4x", - "200" => "2x", - "100" => translate('Real'), - "50" => "1/2x", - "25" => "1/4x", -); - -$scales = array( - "400" => "4x", - "300" => "3x", - "200" => "2x", - "150" => "1.5x", - "100" => translate('Actual'), - "75" => "3/4x", - "50" => "1/2x", - "33" => "1/3x", - "25" => "1/4x", -); - -$bwArray = array( - "high" => translate('High'), - "medium" => translate('Medium'), - "low" => translate('Low') -); - -/* Check if ZM_WEB_L_CAN_STREAM and ZM_WEB_L_STREAM_METHOD are defined */ -if (!defined("ZM_WEB_L_CAN_STREAM")) { - define ("ZM_WEB_L_CAN_STREAM", 1); - define ("ZM_WEB_M_CAN_STREAM", 1); - define ("ZM_WEB_H_CAN_STREAM", 1); -} -if (!defined("ZM_WEB_L_STREAM_METHOD")) { - define ("ZM_WEB_L_STREAM_METHOD", "jpeg"); - define ("ZM_WEB_M_STREAM_METHOD", "jpeg"); - define ("ZM_WEB_H_STREAM_METHOD", "jpeg"); -} - -switch ( $_COOKIE['zmBandwidth'] ) -{ - case "high" : - { - define( "ZM_WEB_REFRESH_MAIN", ZM_WEB_H_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes - define( "ZM_WEB_REFRESH_CYCLE", ZM_WEB_H_REFRESH_CYCLE ); // How often the cycle watch windows swaps to the next monitor - define( "ZM_WEB_REFRESH_IMAGE", ZM_WEB_H_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming) - define( "ZM_WEB_REFRESH_STATUS", ZM_WEB_H_REFRESH_STATUS ); // How often the little status frame refreshes itself in the watch window - define( "ZM_WEB_REFRESH_EVENTS", ZM_WEB_H_REFRESH_EVENTS ); // How often the event listing is refreshed in the watch window, only for recent events - define( "ZM_WEB_CAN_STREAM", ZM_WEB_H_CAN_STREAM ); // Override the automatic detection of browser streaming capability - define( "ZM_WEB_STREAM_METHOD", ZM_WEB_H_STREAM_METHOD ); // Which method should be used to send video streams to your browser - define( "ZM_WEB_DEFAULT_SCALE", ZM_WEB_H_DEFAULT_SCALE ); // What the default scaling factor applied to 'live' or 'event' views is (%) - define( "ZM_WEB_DEFAULT_RATE", ZM_WEB_H_DEFAULT_RATE ); // What the default replay rate factor applied to 'event' views is (%) - define( "ZM_WEB_VIDEO_BITRATE", ZM_WEB_H_VIDEO_BITRATE ); // What the bitrate of any streamed video should be - define( "ZM_WEB_VIDEO_MAXFPS", ZM_WEB_H_VIDEO_MAXFPS ); // What the maximum frame rate of any streamed video should be - define( "ZM_WEB_SCALE_THUMBS", ZM_WEB_H_SCALE_THUMBS ); // Image scaling for thumbnails, bandwidth versus cpu in rescaling - define( "ZM_WEB_EVENTS_VIEW", ZM_WEB_H_EVENTS_VIEW ); // What the default view of multiple events should be. - define( "ZM_WEB_SHOW_PROGRESS", ZM_WEB_H_SHOW_PROGRESS ); // Whether to show the progress of replay in event view. - define( "ZM_WEB_AJAX_TIMEOUT", ZM_WEB_H_AJAX_TIMEOUT ); // Timeout to use for Ajax requests, no timeout used if unset - break; - } - case "medium" : - { - define( "ZM_WEB_REFRESH_MAIN", ZM_WEB_M_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes - define( "ZM_WEB_REFRESH_CYCLE", ZM_WEB_M_REFRESH_CYCLE ); // How often the cycle watch windows swaps to the next monitor - define( "ZM_WEB_REFRESH_IMAGE", ZM_WEB_M_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming) - define( "ZM_WEB_REFRESH_STATUS", ZM_WEB_M_REFRESH_STATUS ); // How often the little status frame refreshes itself in the watch window - define( "ZM_WEB_REFRESH_EVENTS", ZM_WEB_M_REFRESH_EVENTS ); // How often the event listing is refreshed in the watch window, only for recent events - define( "ZM_WEB_CAN_STREAM", ZM_WEB_M_CAN_STREAM ); // Override the automatic detection of browser streaming capability - define( "ZM_WEB_STREAM_METHOD", ZM_WEB_M_STREAM_METHOD ); // Which method should be used to send video streams to your browser - define( "ZM_WEB_DEFAULT_SCALE", ZM_WEB_M_DEFAULT_SCALE ); // What the default scaling factor applied to 'live' or 'event' views is (%) - define( "ZM_WEB_DEFAULT_RATE", ZM_WEB_M_DEFAULT_RATE ); // What the default replay rate factor applied to 'event' views is (%) - define( "ZM_WEB_VIDEO_BITRATE", ZM_WEB_M_VIDEO_BITRATE ); // What the bitrate of any streamed video should be - define( "ZM_WEB_VIDEO_MAXFPS", ZM_WEB_M_VIDEO_MAXFPS ); // What the maximum frame rate of any streamed video should be - define( "ZM_WEB_SCALE_THUMBS", ZM_WEB_M_SCALE_THUMBS ); // Image scaling for thumbnails, bandwidth versus cpu in rescaling - define( "ZM_WEB_EVENTS_VIEW", ZM_WEB_M_EVENTS_VIEW ); // What the default view of multiple events should be. - define( "ZM_WEB_SHOW_PROGRESS", ZM_WEB_M_SHOW_PROGRESS ); // Whether to show the progress of replay in event view. - define( "ZM_WEB_AJAX_TIMEOUT", ZM_WEB_M_AJAX_TIMEOUT ); // Timeout to use for Ajax requests, no timeout used if unset - break; - } - case "low" : - { - define( "ZM_WEB_REFRESH_MAIN", ZM_WEB_L_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes - define( "ZM_WEB_REFRESH_CYCLE", ZM_WEB_L_REFRESH_CYCLE ); // How often the cycle watch windows swaps to the next monitor - define( "ZM_WEB_REFRESH_IMAGE", ZM_WEB_L_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming) - define( "ZM_WEB_REFRESH_STATUS", ZM_WEB_L_REFRESH_STATUS ); // How often the little status frame refreshes itself in the watch window - define( "ZM_WEB_REFRESH_EVENTS", ZM_WEB_L_REFRESH_EVENTS ); // How often the event listing is refreshed in the watch window, only for recent events - define( "ZM_WEB_CAN_STREAM", ZM_WEB_L_CAN_STREAM ); // Override the automatic detection of browser streaming capability - define( "ZM_WEB_STREAM_METHOD", ZM_WEB_L_STREAM_METHOD ); // Which method should be used to send video streams to your browser - define( "ZM_WEB_DEFAULT_SCALE", ZM_WEB_L_DEFAULT_SCALE ); // What the default scaling factor applied to 'live' or 'event' views is (%) - define( "ZM_WEB_DEFAULT_RATE", ZM_WEB_L_DEFAULT_RATE ); // What the default replay rate factor applied to 'event' views is (%) - define( "ZM_WEB_VIDEO_BITRATE", ZM_WEB_L_VIDEO_BITRATE ); // What the bitrate of any streamed video should be - define( "ZM_WEB_VIDEO_MAXFPS", ZM_WEB_L_VIDEO_MAXFPS ); // What the maximum frame rate of any streamed video should be - define( "ZM_WEB_SCALE_THUMBS", ZM_WEB_L_SCALE_THUMBS ); // Image scaling for thumbnails, bandwidth versus cpu in rescaling - define( "ZM_WEB_EVENTS_VIEW", ZM_WEB_L_EVENTS_VIEW ); // What the default view of multiple events should be. - define( "ZM_WEB_SHOW_PROGRESS", ZM_WEB_L_SHOW_PROGRESS ); // Whether to show the progress of replay in event view. - define( "ZM_WEB_AJAX_TIMEOUT", ZM_WEB_L_AJAX_TIMEOUT ); // Timeout to use for Ajax requests, no timeout used if unset - break; - } -} - -?> diff --git a/web/skins/xml/includes/functions.php b/web/skins/xml/includes/functions.php deleted file mode 100644 index b84e65464..000000000 --- a/web/skins/xml/includes/functions.php +++ /dev/null @@ -1,447 +0,0 @@ - $maj) return 1; - if ((getClientVerMaj() == $maj) && (getClientVerMin() >= $min)) return 1; - return 0; -} -function logXmlErr($str) -{ - logXml($str, 1); -} -function logXml($str, $err = 0) -{ - if (!defined("ZM_EYEZM_DEBUG")) { - /* Check session variable */ - if (isset($_SESSION['xml_debug'])) define("ZM_EYEZM_DEBUG", $_SESSION['xml_debug']); - else define ("ZM_EYEZM_DEBUG", "0"); - } - if (!defined("ZM_EYEZM_LOG_TO_FILE")) { - /* Check session variable */ - if (isset($_SESSION['xml_log_to_file'])) define("ZM_EYEZM_LOG_TO_FILE", $_SESSION['xml_log_to_file']); - else define ("ZM_EYEZM_LOG_TO_FILE", "1"); - } - if (!defined("ZM_EYEZM_LOG_FILE")) { - /* Check session variable */ - if (isset($_SESSION['xml_log_file'])) define("ZM_EYEZM_LOG_FILE", $_SESSION['xml_log_file']); - else define ("ZM_EYEZM_LOG_FILE", "/tmp/zm_xml.log"); - } - /* Only log if debug is enabled */ - if (ZM_EYEZM_DEBUG == 0) return; - /* Logging is enabled, set log string */ - $logstr = "XML_LOG (".($err?"ERROR":"NOTICE")."): ".$str.(ZM_EYEZM_LOG_TO_FILE?"\n":""); - if (ZM_EYEZM_LOG_TO_FILE) { - error_log("[".date("r")."] ".$logstr, 3, ZM_EYEZM_LOG_FILE); - } else { - error_log($logstr); - } -} -/* Returns defval if varname is not set, otherwise return varname */ -function getset($varname, $defval) -{ - if (isset($_GET[$varname])) return $_GET[$varname]; - return $defval; -} -function xml_header() -{ - header ("content-type: text/xml"); - echo ""; -} -function xml_tag_val($tag, $val) -{ - echo "<".$tag.">".$val.""; -} -function xml_tag_sec($tag, $open) -{ - if ($open) $tok = "<"; - else $tok = ""; -} -function xhtmlHeaders( $file, $title ) -{ -?> - - - - - - - /dev/null")) > 0) { - /* More than one match */ - return TRUE; - } else { - /* Check -formats tag also if we fail -codecs */ - if (preg_match("/\b".$codec."\b/", shell_exec(getFfmpegPath()." -formats 2> /dev/null")) > 0) return TRUE; - return FALSE; - } -} -function exeExists($exepath) -{ - $path = trim($exepath); - return (file_exists($path) && is_readable($path) && ($path != "")); -} -/* Returns whether ffmpeg exists or not */ -function ffmpegExists() -{ - return exeExists(getFfmpegPath()); -} -/* Returns with PHP-GD exists */ -function gdExists() -{ - if (extension_loaded('gd') && function_exists('gd_info')) { - return TRUE; - } - return FALSE; -} - -function getFfmpeg264FoutParms($br, $fout) -{ - $ffparms = "-analyzeduration 0 -acodec copy"; - $ffparms .= " -vcodec libx264 -b ".$br; - $ffparms .= " -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8"; - $ffparms .= " -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -keyint_min 25"; - $ffparms .= " -sc_threshold 40 -i_qfactor 0.71 -bt 16k"; - $ffparms .= " -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6"; - $ffparms .= " -qmin 10 -qmax 51 -qdiff 4 -level 30"; - $ffparms .= " -g 30 -analyzeduration 0 -async 2 ".$fout." 2> /dev/null"; - return $ffparms; -} -/** Return FFMPEG parameters for H264 streaming */ -function getFfmpeg264Str($width, $height, $br, $fin, $fout) -{ - $ffparms = getFfmpeg264FoutParms($br, $fout); - $ffstr = getFfmpegPath()." -t ".ZM_EYEZM_H264_MAX_DURATION." -analyzeduration 0 -i "; - $ffstr .= $fin." -f mpegts ".$ffparms; - return $ffstr; -} -/** Returns true when monitor exists */ -function isMonitor($monitor) -{ - $query = "select Id from Monitors where Id = ?"; - $res = dbFetchOne($query, NULL, array($monitor)); - if ($res) return TRUE; - logXml("Monitor ID ".$monitor." does not exist"); - return FALSE; -} -/** Returns the width and height of a monitor */ -function getMonitorDims($monitor) -{ - $query = "select Width,Height from Monitors where Id = ?"; - $res = dbFetchOne($query, NULL, array( $monitor ) ); - return $res; -} -/** Returns the temp directory for H264 encoding */ -function getTempDir() -{ - /* Assume that the directory structure is /skins/xml/views */ - return dirname(__FILE__)."/../../../temp"; -} -/** Returns the name of the m3u8 playlist based on monitor */ -function m3u8fname($monitor) { - return "stream_".$monitor.".m3u8"; -} - -/** Erases the M3u8 and TS file names for a given monitor */ -function eraseH264Files($monitor) { - /** NOTE: This command executes an 'rm' command, so $monitor parameter - * should be properly validated before executing */ - /* Remove wdir/.m3u8 and wdir/sample_*.ts */ - shell_exec("rm -f ".getTempDir()."/".m3u8fname($monitor)." ".getTempDir()."/sample_".$monitor."*.ts"); -} -function kill264proc($monitor) { - /** NOTE: This command executes an 'kill' command, so $monitor parameter - * should be properly validated before executing */ - $pid = trim(shell_exec("pgrep -f -x \"zmstreamer -m ".$monitor."\"")); - if ($pid == "") { - logXml("No PID found for ZMStreamer to kill"); - } else { - shell_exec("kill -9 ".$pid); - logXml("Killed process ".$pid." for Monitor ".$monitor); - } -} -/** Return the command-line shell function to setup H264 stream */ -function stream264fn ($mid, $width, $height, $br) { - $cdir = "./temp"; - $zmstrm = "zmstreamer -m ".$mid." 2> /dev/null"; - $ffstr = getFfmpeg264Str($width, $height, $br, "-", "-"); - $seg = "segmenter - ".ZM_EYEZM_SEG_DURATION." ".$cdir."/sample_".$mid." ".$cdir."/".m3u8fname($mid)." ../ 2> /dev/null"; - $url = $zmstrm . " | ".$ffstr." | " . $seg; - return "nohup ".$url." & echo $!"; -} - -/** Generate the web-page presented to the viewer when using H264 */ -function h264vidHtml($width, $height, $monitor, $br, $thumbsrc) { - function printTermLink() { - $str = "H264 Streaming Launching...
Tap to re-load if stream fails"; - $str2 = "document.getElementById(\"loaddiv\").innerHTML = \"".$str."\";"; - echo $str2; - - } - $ajaxUrl = "?view=actions&action=spawn264&&monitor=".$monitor."&br=".$br; - /* Call these two directly to bypass server blocking issues */ - $ajax2Url = "./skins/xml/views/actions.php?action=chk264&monitor=".$monitor; - $ajax2Url .= "&timeout=".ZM_EYEZM_H264_TIMEOUT; - $ajax3Url = "./skins/xml/views/actions.php?action=kill264&monitor=".$monitor; -?> - - - - - - - -
-
-Initializing H264 Stream ()...
-This may take a few seconds -
-
- -
- -
- - - diff --git a/web/skins/xml/includes/init.php b/web/skins/xml/includes/init.php deleted file mode 100644 index acb6c3546..000000000 --- a/web/skins/xml/includes/init.php +++ /dev/null @@ -1,2 +0,0 @@ - diff --git a/web/skins/xml/skin.php b/web/skins/xml/skin.php deleted file mode 100644 index c88718c4e..000000000 --- a/web/skins/xml/skin.php +++ /dev/null @@ -1,47 +0,0 @@ - diff --git a/web/skins/xml/views/Makefile.am b/web/skins/xml/views/Makefile.am deleted file mode 100644 index ab9147ae4..000000000 --- a/web/skins/xml/views/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -SUBDIRS = - -webdir = @WEB_PREFIX@/skins/xml/views - -dist_web_DATA = \ - console.php \ - actions.php \ - none.php \ - notfound.png diff --git a/web/skins/xml/views/actions.php b/web/skins/xml/views/actions.php deleted file mode 100644 index 73e206af6..000000000 --- a/web/skins/xml/views/actions.php +++ /dev/null @@ -1,392 +0,0 @@ - */ - if (!canEdit('Events')) { - logXmlErr("User ".$user['Username']. " doesn't have edit Events perms"); - exit; - } - if (!isset($_REQUEST['eid'])) { - logXmlErr("EID not set for action delete-event"); - exit; - } - $eid = validInteger($_REQUEST['eid']); - $url = "./index.php?view=request&request=event&id=".$eid."&action=delete"; - header("Location: ".$url); - exit; - - } else if (!strcmp($action, "spawn264")) { - /* ACTION: Spawn 264 streaming process. - * Parms: [br|width|height] */ - if (!canView('Stream')) { - logXmlErr("User ".$user['Username']. " doesn't have view Stream perms"); - exit; - } - if (!isset($_GET['monitor'])) { - logXmlErr("Not all parameters specified for spawn264"); - exit; - } - $monitor = validInteger($_REQUEST['monitor']); - if (!isMonitor($monitor)) exit; - $dims = getMonitorDims($monitor); - $width = validInteger(getset('width', $dims['Width'])); - $height = validInteger(getset('height', $dims['Height'])); - $br = validString(getset('br', ZM_EYEZM_H264_DEFAULT_BR)); - /* Check that we can stream first */ - if (!canStream264()) { - /* canStream264 will print out error */ - exit; - } - $streamUrl = stream264fn($monitor, $width, $height, $br); - logXml("Using H264 Pipe Function: ".$streamUrl); - $pid = shell_exec($streamUrl); - logXml("Streaming Process for monitor ".$monitor." ended, cleaning up files"); - eraseH264Files($monitor); - exit; - - } else if (!strcmp($action, "kill264")) { - /* ACTION: Kill existing H264 stream process and cleanup files. - * Parms: . - * NOTE: This will be called directly by path, so include files - * may not be available */ - session_start(); - require_once(dirname(__FILE__)."/../includes/functions.php"); - if (!isset($_GET['monitor'])) { - logXmlErr("Not all parameters specified for kill264"); - exit; - } - $monitor = validInteger($_GET['monitor']); - kill264proc($monitor); - logXml("Killed Segmenter process for monitor ".$monitor); - exit; - - } else if (!strcmp($action, "chk264")) { - /* ACTION: Simply stalls while checking for 264 file. - * Parms: - * NOTE: This will be called directly by path, so include files - * may not be available */ - session_start(); - require_once(dirname(__FILE__)."/../includes/functions.php"); - if (!isset($_GET['monitor']) || !isset($_GET['timeout'])) { - logXmlErr("Monitor not specified for chk264"); - exit; - } - $monitor = validInteger($_GET['monitor']); - $path = getTempDir()."/".m3u8fname($monitor); - /* Wait for the second sample to become available */ - $tsfile = getTempDir()."/sample_".$monitor."-2.ts"; - /* Setup timeout */ - $startTime = time(); - $timeout = validInteger($_GET['timeout']); - while (!file_exists($path) || !file_exists($tsfile)) { - if (time() > $startTime + $timeout) { - logXmlErr("Timed out waiting for stream to start, exiting..."); - kill264proc($monitor); - exit; - } - usleep(10000); - } - logXml("File exists, stream created after ".(time()-$startTime)." sec"); - exit; - - } else if (!strcmp($action, "feed")) { - /* ACTION: View a feed. Parms: [height|width|fps|scale|vcodec|br] */ - if (!canView('Stream')) { - logXmlErr("User ".$user['Username']. " doesn't have view Stream perms"); - exit; - } - /* Check that required variables are set */ - if (!isset($_REQUEST['monitor'])) { - logXmlErr("Not all parameters set for action view-feed"); - exit; - } - $monitor = validInteger($_REQUEST['monitor']); - if (!isMonitor($monitor)) exit; - $dims = getMonitorDims($monitor); - $width = validInteger(getset('width', $dims['Width'])); - $height = validInteger(getset('height', $dims['Height'])); - $fps = validInteger(getset('fps', ZM_WEB_VIDEO_MAXFPS)); - $scale = validInteger(getset('scale', 100)); - $vcodec = validString(getset('vcodec', ZM_EYEZM_FEED_VCODEC)); - /* Select which codec we want */ - if (!strcmp($vcodec, "h264")) { - /* Validate that we can in fact stream H264 */ - if (!canStream264()) { - /* canStream264 will print out error if - * there is one */ - echo "Server cannot stream H264. Check eyeZm log for details"; - exit; - } - if (!requireVer("1", "2")) { - echo "H264 Streaming requires eyeZm v1.2 or above"; - logXmlErr("H264 Streaming requires eyeZm v1.2 or above"); - exit; - } - $br = validString(getset('br', ZM_EYEZM_H264_DEFAULT_BR)); - /* H264 processing */ - noCacheHeaders(); - /* Kill any existing processes and files */ - kill264proc($monitor); - eraseH264Files($monitor); - logXml("Streaming H264 on Monitor ".$monitor.", ".$width."x".$height." @".$br); - /* Get thumbnail source */ - $thumbsrc = - getStreamSrc( array( - "mode=single", - "monitor=".$monitor, - "scale=".$scale, - "maxfps=".$fps, - "buffer=1000" - ) ); - logXml("Using thumbnail image from ".$thumbsrc); - /* Generate H264 Web-page */ - echo "\n"; - h264vidHtml($width, $height, $monitor, $br, $thumbsrc); - } else if (!strcmp($vcodec, "mjpeg")) { - /* MJPEG streaming */ - /* If $fps=0, get a single-shot */ - if (!$fps) { - /* single-shot */ - $streamSrc = - getStreamSrc( array( - "mode=single", - "monitor=".$monitor, - "scale=".$scale, - "maxfps=0", - "buffer=1000" - ) ); - } else { - $streamSrc = - getStreamSrc( array( - "mode=jpeg", - "monitor=".$monitor, - "scale=".$scale, - "maxfps=".$fps, - "buffer=1000" - ) ); - } - noCacheHeaders(); - xhtmlHeaders( __FILE__, "Stream" ); - logXml("Streaming MJPEG on Monitor ".$monitor.", ".$width."x".$height." @".$fps."fps"); - echo "\n"; - echo "\n"; - echo "
\n"; - logXml("Using stream source: ".$streamSrc); - outputImageStream("liveStream", $streamSrc, $width, $height, "stream"); - echo "
"; - } else { - logXmlErr("Unsupported codec ".$vcodec." selected for streaming"); - echo("Unsupported codec ".$vcodec." selected for streaming"); - } - exit; - - } else if (!strcmp($action, "vevent")) { - /* ACTION: View an event. Parms: [fps|vcodec|br] */ - if (!canView('Events')) { - logXmlErr("User ".$user['Username']. " doesn't have view Events perms"); - exit; - } - if (!isset($_GET['eid'])) { - logXmlErr("Not all parameters set for Action View-event"); - exit; - } - /* Grab event from the database */ - $eid = validInteger($_GET['eid']); - $eventsSql = "select E.Id, E.MonitorId, E.Name, E.StartTime, E.Length, E.Frames from Events as E where E.Id = ?"; - $event = dbFetchOne($eventsSql, NULL, array( $eid ) ); - /* Check if exists */ - if (!$event) { - logxmlErr("Requested event ID ".$eid." does not exist"); - exit; - } - /* Calculate FPS */ - $fps = validInteger(getset('fps',ceil($event['Frames'] / $event['Length']))); - $vcodec = validString(getset('vcodec', ZM_EYEZM_EVENT_VCODEC)); - $baseURL = ZM_PATH_WEB."/".getEventPathSafe($event); - /* Here we validate the codec. - * Check that FFMPEG exists and supports codecs */ - if (!strcmp($vcodec, "mpeg4")) { - if (!ffmpegSupportsCodec("mpeg4")) { - logXmlErr("FFMPEG not installed, accessible in path/ZM_PATH_FFMPEG, or doesn't support mpeg4"); - exit; - } - /* Can generate, we are good to go */ - $fname = "capture.mov"; - $ffparms = "-vcodec mpeg4 -r ".ZM_EYEZM_EVENT_FPS." ".$baseURL."/".$fname." 2> /dev/null"; - - } else if (!strcmp($vcodec, "h264")) { - if (!ffmpegSupportsCodec("libx264")) { - logXmlErr("FFMPEG not installed, accessible in path/ZM_PATH_FFMPEG, or doesn't support H264"); - exit; - } - if (!requireVer("1","2")) { - logXmlErr("H264 Event viewing requires eyeZm v1.2 or greater"); - exit; - } - /* Good to go */ - $fname = "capture.mp4"; - $ffparms = getFfmpeg264FoutParms( - validString(getset('br',ZM_EYEZM_H264_DEFAULT_EVBR)), - $baseURL."/".$fname); - - } else { - logXmlErr("Unknown codec ".$vcodec." selected for event viewing"); - exit; - } - logXml("Selected ".$vcodec." for viewing event ".$event['Id']); - $fnameOut = $baseURL."/".$fname; - $shellCmd = getFfmpegPath()." -y -r ".$fps." -i ".$baseURL."/%0".ZM_EVENT_IMAGE_DIGITS."d-capture.jpg"; - $shellCmd .= " ".$ffparms; - logXml("Encoding event with command: ".$shellCmd); - $shellOutput = shell_exec($shellCmd); - /* Check that file exists */ - if (!file_exists(trim($fnameOut))) { - logXmlErr("Generate Event ".$event['Id']." file ".$fnameOut." does not exist"); - exit; - } - $url = "./".getEventPathSafe($event)."/".$fname; - logXml("Loading Event URL ".$url); - header("Location: ".$url); - exit; - - } else if (!strcmp($action, "vframe")) { - /* ACTION: View a frame given by an event and frame-id. Parms: [alarm | analyze | qty | scale] - * If 'alarm' is set, the returned frame will be the -th alarm frame. If 'analyze' is set, - * the returned frame will be the %03d-analyse frame instead of %03d-capture, if ZM_CREATE_ANALYSIS_IMAGES - * is set. Otherwise it just returns the captured frame. - * If qty is set, it will apply a quality factor from 0-100, and if width is set, it will scale the jpeg accordingly - */ - if (!isset($_GET['eid']) || !isset($_GET['frame'])) { - logXmlErr("Not all parameters set for action view-frame"); - exit; - } - $eid = validInteger($_GET['eid']); - $frame = validInteger($_GET['frame']); - $eventsSql = "select E.Id, E.MonitorId, E.Name, E.StartTime, E.Length, E.Frames from Events as E where E.Id = ?"; - $event = dbFetchOne($eventsSql, NULL, array( $eid ) ); - $qty = validInteger(getset('qty', 100)); - if ($qty > 100) $qty = 100; - $scale = validInteger(getset('scale', 100)); - if (!$event) { - logxmlErr("Requested event ID ".$eid." does not exist"); - exit; - } - /* Figure out the frame number. If 'alarm' is not set, this is just equal to the parameter. - * If 'alarm' is set, need to query DB and grab the -th item */ - if (isset($_GET['alarm'])) { - $frameSql = "select * from Frames as F where F.EventId=? and (F.Type = 'Alarm') order by F.FrameId"; - $i=0; - foreach (dbFetchAll($frameSql, NULL, array($eid) ) as $dbframe) { - if ($i == $frame) { - $frame = $dbframe['FrameId']; - break; - } - $i++; - } - } - if (isset($_GET['analyze']) && ZM_CREATE_ANALYSIS_IMAGES) { - $suffix = "analyse"; - } else { - $suffix = "capture"; - } - /* A frame index of 0 is invalid, so if we see this, just use frame 1 */ - if (!$frame) $frame = 1; - /* Suffix based on 'analyze' */ - $fname = sprintf("%0".ZM_EVENT_IMAGE_DIGITS."d-%s.jpg", $frame, $suffix); - $url = "./".getEventPathSafe($event)."/".$fname; - if (!file_exists($url)) { - logXmlErr("Invalid frame image requested: ".$url); - $url = "./skins/xml/views/notfound.png"; - } - /* Check if the image needs any processing - check for GD if requested */ - if (($scale != 100) || ($qty < 100)) { - if (!gdExists()) { - logXmlErr("Lib GD is not loaded, but required for image scaling functions"); - $url = "./skins/xml/views/notfound.png"; - } else if (!$img = imagecreatefromjpeg($url)) { - logXmlErr("Could not load JPEG from ".$url); - $url = "./skins/xml/views/notfound.png"; - } else { - /* GD exists and we read the file ok */ - header('Content-type: image/jpeg'); - /* Check if resizing is needed */ - if ($scale != 100) { - list($width_orig, $height_orig) = getimagesize($url); - $width_new = $width_orig * ($scale/100); - $height_new = $height_orig * ($scale/100); - $img_new = imagecreatetruecolor($width_new, $height_new); - imagecopyresampled($img_new, $img, 0, 0, 0, 0, $width_new, $height_new, $width_orig, $height_orig); - imagejpeg($img_new, NULL, $qty); - } else { - imagejpeg($img, NULL, $qty); - } - exit; - } - } - header("Location: ".$url); - exit; - - } else if (!strcmp($action, "state")) { - /* ACTION: Change the state of the system. Parms: */ - if (!canEdit('System')) { - logXmlErr("User ".$user['Username']. " doesn't have edit System perms"); - exit; - } - if (!isset($_GET['state'])) { - logXmlErr("Server state not specified for action"); - exit; - } - $url = "./index.php?view=none&action=state&runState=".validString($_GET['state']); - header("Location: ".$url); - exit; - - } else if (!strcmp($action, "func")) { - /* ACTION: Change state of the monitor. Parms: */ - if (!canEdit('Monitors')) { - logXmlErr("User ".$user['Username']. " doesn't have monitors Edit perms"); - exit; - } - if (!isset($_GET['mid']) || !isset($_GET['func']) || !isset($_GET['en'])) { - logXmlErr("Not all parameters specified for action Monitor state"); - exit; - } - $mid = validInteger($_GET['mid']); - if (!isMonitor($mid)) exit; - $url = "./index.php?view=none&action=function&mid=".$mid."&newFunction=".validString($_GET['func'])."&newEnabled=".validString($_GET['en']); - header("Location: ".$url); - exit; - - } else if (!strcmp($action, "vlog")) { - /* ACTION: View log file. Must have debug and log to file enabled, and sufficient perms - * Parms: [lines] */ - if (!canEdit('System')) { - logXmlErr("Insufficient permissions to view log file"); - echo "Insufficient permissions to view log file"; - exit; - } - if (!ZM_EYEZM_DEBUG || !ZM_EYEZM_LOG_TO_FILE) { - echo "eyeZm Debug (EYEZM_DEBUG) or log-to-file (EYEZM_LOG_TO_FILE) not enabled. Please enable first"; - exit; - } - if (!file_exists(ZM_EYEZM_LOG_FILE)) { - echo "Log file ".ZM_EYEZM_LOG_FILE." doesn't exist"; - exit; - } - $lines = validInteger(getset('lines',ZM_EYEZM_LOG_LINES)); - logXml("Returning last ".$lines." lines of eyeZm Log from ".ZM_EYEZM_LOG_FILE); - echo shell_exec("tail -n ".$lines." ".ZM_EYEZM_LOG_FILE); - echo "\n\n--- Showing last ".$lines." lines ---\n"; - echo "--- End of Log ---\n\n"; - } -} -?> diff --git a/web/skins/xml/views/console.php b/web/skins/xml/views/console.php deleted file mode 100644 index b512bc13a..000000000 --- a/web/skins/xml/views/console.php +++ /dev/null @@ -1,259 +0,0 @@ - translate('Events'), - "filter" => array( - "terms" => array( - ) - ), - ), - array( - "title" => translate('Hour'), - "filter" => array( - "terms" => array( - array( "attr" => "Archived", "op" => "=", "val" => "0" ), - array( "cnj" => "and", "attr" => "DateTime", "op" => ">=", "val" => "-1 hour" ), - ) - ), - ), - array( - "title" => translate('Day'), - "filter" => array( - "terms" => array( - array( "attr" => "Archived", "op" => "=", "val" => "0" ), - array( "cnj" => "and", "attr" => "DateTime", "op" => ">=", "val" => "-1 day" ), - ) - ), - ), - array( - "title" => translate('Week'), - "filter" => array( - "terms" => array( - array( "attr" => "Archived", "op" => "=", "val" => "0" ), - array( "cnj" => "and", "attr" => "DateTime", "op" => ">=", "val" => "-7 day" ), - ) - ), - ), - array( - "title" => translate('Month'), - "filter" => array( - "terms" => array( - array( "attr" => "Archived", "op" => "=", "val" => "0" ), - array( "cnj" => "and", "attr" => "DateTime", "op" => ">=", "val" => "-1 month" ), - ) - ), - ), - array( - "title" => translate('Archived'), - "filter" => array( - "terms" => array( - array( "attr" => "Archived", "op" => "=", "val" => "1" ), - ) - ), - ), -); - -$running = daemonCheck(); -$status = $running?translate('Running'):translate('Stopped'); - -if ( $group = dbFetchOne( 'SELECT * FROM Groups WHERE Id = ?', NULL, array(empty($_COOKIE['zmGroup'])?0:$_COOKIE['zmGroup']) ) ) - $groupIds = array_flip(split( ',', $group['MonitorIds'] )); - -$maxWidth = 0; -$maxHeight = 0; -$cycleCount = 0; -$minSequence = 0; -$maxSequence = 1; -$seqIdList = array(); -$monitors = dbFetchAll( "select * from Monitors order by Sequence asc" ); -$displayMonitors = array(); -for ( $i = 0; $i < count($monitors); $i++ ) -{ - if ( !visibleMonitor( $monitors[$i]['Id'] ) ) - { - continue; - } - if ( $group && !empty($groupIds) && !array_key_exists( $monitors[$i]['Id'], $groupIds ) ) - { - continue; - } - $monitors[$i]['Show'] = true; - if ( empty($minSequence) || ($monitors[$i]['Sequence'] < $minSequence) ) - { - $minSequence = $monitors[$i]['Sequence']; - } - if ( $monitors[$i]['Sequence'] > $maxSequence ) - { - $maxSequence = $monitors[$i]['Sequence']; - } - if (isset($_GET['nostatus'])) { - $monitors[$i]['zmc'] = 1; - $monitors[$i]['zma'] = 1; - } else { - $monitors[$i]['zmc'] = zmcStatus( $monitors[$i] ); - $monitors[$i]['zma'] = zmaStatus( $monitors[$i] ); - } - $monitors[$i]['ZoneCount'] = dbFetchOne( 'select count(Id) as ZoneCount from Zones where MonitorId = ?', 'ZoneCount', array($monitors[$i]['Id']) ); - $counts = array(); - for ( $j = 0; $j < count($eventCounts); $j++ ) - { - $filter = addFilterTerm( $eventCounts[$j]['filter'], count($eventCounts[$j]['filter']['terms']), array( "cnj" => "and", "attr" => "MonitorId", "op" => "=", "val" => $monitors[$i]['Id'] ) ); - parseFilter( $filter ); - $counts[] = "count(if(1".$filter['sql'].",1,NULL)) as EventCount$j"; - $monitors[$i]['eventCounts'][$j]['filter'] = $filter; - } - $sql = 'SELECT '.join($counts,", ").' from Events as E where MonitorId = ?'; - $counts = dbFetchOne( $sql, NULL, array( $monitors[$i]['Id'] ) ); - if ( $monitors[$i]['Function'] != 'None' ) - { - $cycleCount++; - $scaleWidth = reScale( $monitors[$i]['Width'], $monitors[$i]['DefaultScale'], ZM_WEB_DEFAULT_SCALE ); - $scaleHeight = reScale( $monitors[$i]['Height'], $monitors[$i]['DefaultScale'], ZM_WEB_DEFAULT_SCALE ); - if ( $maxWidth < $scaleWidth ) $maxWidth = $scaleWidth; - if ( $maxHeight < $scaleHeight ) $maxHeight = $scaleHeight; - } - $monitors[$i] = array_merge( $monitors[$i], $counts ); - $seqIdList[] = $monitors[$i]['Id']; - $displayMonitors[] = $monitors[$i]; -} -$states = dbFetchAll("select * from States"); -/* XML Dump Starts here */ -xml_header(); -/* Print out the general section */ -xml_tag_sec("ZM_XML", 1); -xml_tag_sec("GENERAL", 1); -xml_tag_val("RUNNING", $running); -xml_tag_val("PROTOVER", ZM_EYEZM_PROTOCOL_VERSION); -xml_tag_val("FEATURESET", ZM_EYEZM_FEATURE_SET); -xml_tag_val("VERSION", ZM_VERSION); -xml_tag_val("CANSTR264", canStream264(1)); -xml_tag_val("GD", gdExists()); -xml_tag_val("FVCODEC", ZM_EYEZM_FEED_VCODEC); -xml_tag_val("FVTMT", ZM_EYEZM_H264_TIMEOUT); -xml_tag_val("USER", $user['Username']); -xml_tag_val("UID", $user['Id']); -/* Permissions block */ -xml_tag_sec("PERMS", 1); -xml_tag_val("STREAM", $user['Stream']); -xml_tag_val("EVENTS", $user['Events']); -xml_tag_val("CONTROL", $user['Control']); -xml_tag_val("MONITORS", $user['Monitors']); -xml_tag_val("DEVICES", $user['Devices']); -xml_tag_val("SYSTEM", $user['System']); -xml_tag_sec("PERMS", 0); -/* End permissions block */ -if (canEdit('System')) { - if ($running) { - xml_tag_val("STATE", "stop"); - xml_tag_val("STATE", "restart"); - } else { - xml_tag_val("STATE", "start"); - } - foreach ($states as $state) { - xml_tag_val("STATE", $state['Name']); - } -} -/* End general section */ -xml_tag_sec("GENERAL", 0); -/* Print out the monitors section */ -xml_tag_sec("MONITOR_LIST", 1); -foreach( $displayMonitors as $monitor ) -{ - if (!canView('Monitors')) continue; - xml_tag_sec("MONITOR", 1); - xml_tag_val("ID", $monitor['Id']); - xml_tag_val("NAME", $monitor['Name']); - xml_tag_val("FUNCTION", $monitor['Function']); - xml_tag_val("NUMEVENTS", $monitor['EventCount0']); - xml_tag_val("ENABLED", $monitor['Enabled']); - xml_tag_val("ZMC", $monitor['zmc']); - xml_tag_val("ZMA", $monitor['zma']); - xml_tag_val("STATE", ($monitor['zmc']!=1)?"ERROR":( - ($monitor['zma']==1)?"OK":"WARN")); - xml_tag_val("WIDTH", $monitor['Width']); - xml_tag_val("HEIGHT", $monitor['Height']); - - /* Form the data-base query for this monitor */ - $pageOffset = 0; - $offset = 0; - if (isset($_GET['numEvents'])) { - $numEvents = validInteger($_GET['numEvents']); - $eventsSql = "select E.Id,E.MonitorId,M.Name As MonitorName,E.Cause,E.Name,E.StartTime,E.Length,E.Frames,E.AlarmFrames,E.TotScore,E.AvgScore,E.MaxScore,E.Archived from Monitors as M inner join Events as E on (M.Id = E.MonitorId) and ( E.MonitorId = ? ) order by E.StartTime desc"; - $eventsSql .= " limit ".$numEvents; - /* If there is an pageOff tag for this monitor, then retrieve the offset. Otherwise, don't specify offset */ - if (isset($_GET['pageOff'.$monitor['Id']])) { - /* If pageOffset is greater than we actually have, - * we need to adjust it */ - $pageOffset = validInteger($_GET['pageOff'.$monitor['Id']]); - if ($pageOffset >= ceil($monitor['EventCount0']/$numEvents)) { - $pageOffset = 0; - } - $offset = $pageOffset * $numEvents; - } - $eventsSql .= " offset ".$offset; - } else { - unset($eventsSql); - } - xml_tag_val("PAGEOFF", $pageOffset); - xml_tag_sec("EVENTS",1); - if (canView('Events') && isset($eventsSql)) { - foreach ( dbFetchAll( $eventsSql, NULL, array($monitor['Id']) ) as $event ) - { - xml_tag_sec("EVENT",1); - xml_tag_val("ID",$event['Id']); - xml_tag_val("NAME",$event['Name']); - xml_tag_val("TIME", strftime( STRF_FMT_DATETIME_SHORTER, strtotime($event['StartTime']))); - xml_tag_val("DURATION", $event['Length']); - xml_tag_val("FRAMES", $event['Frames']); - xml_tag_val("FPS", ($event['Length'] > 0)?ceil($event['Frames']/$event['Length']):0); - xml_tag_val("TOTSCORE", $event['TotScore']); - xml_tag_val("AVGSCORE", $event['AvgScore']); - xml_tag_val("MAXSCORE", $event['MaxScore']); - /* Grab the max frame-id from Frames table. If AlarmFrames = 0, don't try - * to grab any frames, and just signal the max frame index as index 0 */ - $fridx = 1; - $alarmFrames = 1; - if ($event['AlarmFrames']) { - $framesSql = "SELECT FrameId FROM Frames WHERE (Type = 'Alarm') and (EventId = ?) ORDER BY Score DESC LIMIT 1"; - $fr = dbFetchOne($framesSql, NULL, array( $event['Id'] ) ); - $fridx = $fr['FrameId']; - $alarmFrames = $event['AlarmFrames']; - } - xml_tag_val("ALARMFRAMES", $alarmFrames); - xml_tag_val("MAXFRAMEID", $fridx); - xml_tag_sec("EVENT",0); - } - } - xml_tag_sec("EVENTS",0); - xml_tag_sec("MONITOR", 0); -} -xml_tag_sec("MONITOR_LIST", 0); -xml_tag_sec("ZM_XML", 0); -?> diff --git a/web/skins/xml/views/none.php b/web/skins/xml/views/none.php deleted file mode 100644 index e69de29bb..000000000 diff --git a/web/skins/xml/views/notfound.png b/web/skins/xml/views/notfound.png deleted file mode 100644 index 219706897..000000000 Binary files a/web/skins/xml/views/notfound.png and /dev/null differ diff --git a/web/tools/Makefile.am b/web/tools/Makefile.am deleted file mode 100644 index 29c91bc02..000000000 --- a/web/tools/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -SUBDIRS = \ - mootools diff --git a/web/tools/mootools/Makefile.am b/web/tools/mootools/Makefile.am deleted file mode 100644 index 89b17ab8d..000000000 --- a/web/tools/mootools/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/tools/mootools - -dist_web_DATA = \ - mootools-core-1.4.5-compat.js \ - mootools-more-1.5.1.js - -# Yes, you are correct. This is a HACK! -install-data-hook: - ( cd $(DESTDIR)$(webdir); rm -f mootools-core.js mootools-more.js ) - ( cd $(DESTDIR)$(webdir); ln -sf mootools-core-1.4.5-compat.js mootools-core.js ) - ( cd $(DESTDIR)$(webdir); ln -sf mootools-more-1.5.1.js mootools-more.js ) - -uninstall-hook: - @-( cd $(DESTDIR)$(webdir); rm -f mootools-* ) diff --git a/web/views/Makefile.am b/web/views/Makefile.am deleted file mode 100644 index 6ecec9d8b..000000000 --- a/web/views/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -AUTOMAKE_OPTIONS = gnu - -webdir = @WEB_PREFIX@/views - -dist_web_DATA = file.php \ - image.php