-Description: correct path to CGI app according to default web server configuration.
-
---- a/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in
-+++ b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in
-@@ -428,7 +428,7 @@ our @options =
- },
- {
- name => "ZM_PATH_ZMS",
-- default => "/cgi-bin/nph-zms",
-+ default => "/zm/cgi-bin/nph-zms",
- description => "Web path to zms streaming server",
- help => qqq("
- The ZoneMinder streaming server is required to send streamed
diff --git a/distros/ubuntu1604/rules b/distros/ubuntu1604/rules
index b78361212..6bc3dffb5 100755
--- a/distros/ubuntu1604/rules
+++ b/distros/ubuntu1604/rules
@@ -25,7 +25,6 @@ override_dh_auto_configure:
-DZM_SOCKDIR="/var/run/zm" \
-DZM_TMPDIR="/tmp/zm" \
-DZM_CGIDIR="/usr/lib/zoneminder/cgi-bin" \
- -DZM_CONTENTDIR="/var/cache/zoneminder" \
-DZM_DIR_EVENTS="/var/cache/zoneminder/events" \
-DZM_DIR_IMAGES="/var/cache/zoneminder/images" \
-DZM_PATH_ZMS="/zm/cgi-bin/nph-zms"
diff --git a/distros/ubuntu1604/zoneminder.links b/distros/ubuntu1604/zoneminder.links
index 14a8aee91..b7258c3c4 100644
--- a/distros/ubuntu1604/zoneminder.links
+++ b/distros/ubuntu1604/zoneminder.links
@@ -1,4 +1 @@
-/var/cache/zoneminder/events /usr/share/zoneminder/www/events
-/var/cache/zoneminder/images /usr/share/zoneminder/www/images
-/var/cache/zoneminder/temp /usr/share/zoneminder/www/temp
/var/tmp /usr/share/zoneminder/www/api/app/tmp
diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/MaginonIPC.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/MaginonIPC.pm
index 35159fc4e..38ae81aa3 100644
--- a/scripts/ZoneMinder/lib/ZoneMinder/Control/MaginonIPC.pm
+++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/MaginonIPC.pm
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# ==========================================================================
#
diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Monitor.pm b/scripts/ZoneMinder/lib/ZoneMinder/Monitor.pm
index d5b7d7f53..ebdb073b2 100644
--- a/scripts/ZoneMinder/lib/ZoneMinder/Monitor.pm
+++ b/scripts/ZoneMinder/lib/ZoneMinder/Monitor.pm
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# ==========================================================================
#
diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Object.pm b/scripts/ZoneMinder/lib/ZoneMinder/Object.pm
index b87e111a6..63193bccf 100644
--- a/scripts/ZoneMinder/lib/ZoneMinder/Object.pm
+++ b/scripts/ZoneMinder/lib/ZoneMinder/Object.pm
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# ==========================================================================
#
diff --git a/web/api/app/Config/bootstrap.php.in b/web/api/app/Config/bootstrap.php.in
index ac3bcb62c..cf63e40c1 100644
--- a/web/api/app/Config/bootstrap.php.in
+++ b/web/api/app/Config/bootstrap.php.in
@@ -101,49 +101,66 @@ CakeLog::config('debug', array(
'engine' => 'File',
'types' => array('notice', 'info', 'debug'),
'file' => 'cake_debug',
+ 'path' => '@ZM_LOGDIR@/'
));
CakeLog::config('error', array(
'engine' => 'File',
'types' => array('warning', 'error', 'critical', 'alert', 'emergency'),
'file' => 'cake_error',
+ 'path' => '@ZM_LOGDIR@/'
));
CakeLog::config('custom_path', array(
'engine' => 'File',
- 'path' => '@ZM_LOGDIR@'
+ 'path' => '@ZM_LOGDIR@/'
));
Configure::write('ZM_CONFIG', '@ZM_CONFIG@');
+Configure::write('ZM_CONFIG_SUBDIR', '@ZM_CONFIG_SUBDIR@');
Configure::write('ZM_VERSION', '@VERSION@');
Configure::write('ZM_API_VERSION', '@API_VERSION@');
-loadConfigFile();
+# Process name, value pairs from the main config file first
+$configvals = process_configfile(Configure::read('ZM_CONFIG'));
-function loadConfigFile() {
- $configFile = Configure::read('ZM_CONFIG');
- $localConfigFile = basename($configFile);
- if ( file_exists( $localConfigFile ) && filesize( $localConfigFile ) > 0 )
- {
- if ( php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR']) )
- print( "Warning, overriding installed $localConfigFile file with local copy\n" );
- else
- error_log( "Warning, overriding installed $localConfigFile file with local copy" );
- $configFile = $localConfigFile;
- }
-
- $cfg = fopen( $configFile, "r") or die("Could not open config file.");
- while ( !feof($cfg) )
- {
- $str = fgets( $cfg, 256 );
- if ( preg_match( '/^\s*$/', $str ))
- continue;
- elseif ( preg_match( '/^\s*#/', $str ))
- continue;
- elseif ( preg_match( '/^\s*([^=\s]+)\s*=\s*(.*?)\s*$/', $str, $matches )) {
- Configure::write( $matches[1], $matches[2] );
- define( $matches[1], $matches[2] );
- }
- }
- fclose( $cfg );
+# Search for user created config files. If one or more are found then
+# update our config value array with those values
+$configSubFolder = Configure::read('ZM_CONFIG_SUBDIR');
+if ( is_dir($configSubFolder) ) {
+ if ( is_readable($configSubFolder) ) {
+ foreach ( glob("$configSubFolder/*.conf") as $filename ) {
+ $configvals = array_replace($configvals, process_configfile($filename) );
+ }
+ } else {
+ error_log( "WARNING: ZoneMinder configuration subfolder found but is not readable. Check folder permissions on $configSubFolder." );
+ }
}
+# Now that our array our finalized, define each key => value
+# pair in the array as a constant
+foreach( $configvals as $key => $value) {
+ define( $key, $value );
+ Configure::write( $key, $value );
+}
+
+function process_configfile($configFile) {
+ if ( is_readable( $configFile ) ) {
+ $configvals = array();
+
+ $cfg = fopen( $configFile, "r") or die("Could not open config file.");
+ while ( !feof($cfg) ) {
+ $str = fgets( $cfg, 256 );
+ if ( preg_match( '/^\s*$/', $str ))
+ continue;
+ elseif ( preg_match( '/^\s*#/', $str ))
+ continue;
+ elseif ( preg_match( '/^\s*([^=\s]+)\s*=\s*(.*?)\s*$/', $str, $matches ))
+ $configvals[$matches[1]] = $matches[2];
+ }
+ fclose( $cfg );
+ return( $configvals );
+ } else {
+ error_log( "WARNING: ZoneMinder configuration file found but is not readable. Check file permissions on $configFile." );
+ return( false );
+ }
+}
diff --git a/web/skins/classic/views/console.php b/web/skins/classic/views/console.php
index ad2382ff4..ad6891161 100644
--- a/web/skins/classic/views/console.php
+++ b/web/skins/classic/views/console.php
@@ -252,27 +252,26 @@ foreach( $displayMonitors as $monitor ) {
$Server = new Server( $monitor['ServerId'] );
echo $Server->Name();
?>
-
-
- '.$monitor['Device'].' ('.$monitor['Channel'].')', canEdit( 'Monitors' ) ) ?> |
-
- '.preg_replace( '/^.*@/', '', $monitor['Host'] ).'', canEdit( 'Monitors' ) ) ?> |
-
- '.preg_replace( '/^.*\//', '', $monitor['Path'] ).'', canEdit( 'Monitors' ) ) ?> |
-
- '.$shortpath.'', canEdit( 'Monitors' ) ) ?> |
-
- '.preg_replace( '/^.*\//', '', $monitor['Path'] ).'', canEdit( 'Monitors' ) ) ?> |
-
- |
-
'. makePopupLink( '?view=monitor&mid='.$monitor['Id'], 'zmMonitor'.$monitor['Id'], 'monitor', ''.$source.'', canEdit( 'Monitors' ) ).'';
+
for ( $i = 0; $i < count($eventCounts); $i++ ) {
?>
|
diff --git a/web/skins/classic/views/image-ffmpeg.php b/web/skins/classic/views/image-ffmpeg.php
index 082c75099..37e2cd691 100644
--- a/web/skins/classic/views/image-ffmpeg.php
+++ b/web/skins/classic/views/image-ffmpeg.php
@@ -15,7 +15,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
if ( !canView( 'Events' ) )
diff --git a/web/views/view_video.php b/web/views/view_video.php
index 8cf590e9d..a4bfa3892 100644
--- a/web/views/view_video.php
+++ b/web/views/view_video.php
@@ -15,7 +15,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
// Calling sequence: ... /zm/index.php?view=video&event_id=123
diff --git a/zm.conf.in b/zm.conf.in
index c417aacd2..bde068104 100644
--- a/zm.conf.in
+++ b/zm.conf.in
@@ -1,16 +1,15 @@
# ==========================================================================
#
-# ZoneMinder Base Configuration File
+# ZoneMinder Base Configuration
#
# ==========================================================================
#
# *** DO NOT EDIT THIS FILE ***
-# Changes made directly to this configuration file are no longer supported.
-# They will be overwritten during an upgrade.
#
-# Instead, create a custom configuration file, with an extention of ".conf"
-# under the @ZM_CONFIG_SUBDIR@ subfolder containing your desired modifications.
-#
+# To make custom changes to the variables below, create a new configuration
+# file, with an extention of .conf, under the @ZM_CONFIG_SUBDIR@
+# folder, containing your desired modifications.
+#
# Path to installed data directory, used mostly for finding DB upgrade scripts
ZM_PATH_DATA=@PKGDATADIR@
@@ -50,43 +49,10 @@ ZM_DB_USER=@ZM_DB_USER@
# ZoneMinder database password
ZM_DB_PASS=@ZM_DB_PASS@
-# Full path to the folder events are recorded to.
-# The web account user must have full read/write permission to this folder.
-ZM_DIR_EVENTS=@ZM_DIR_EVENTS@
-
-# Full path to the folder images, not directly associated with events,
-# are recorded to.
-# The web account user must have full read/write permission to this folder.
-ZM_DIR_IMAGES=@ZM_DIR_IMAGES@
-
-# Foldername under the webroot where ZoneMinder looks for optional sound files
-# to play when an alarm is detected.
-ZM_DIR_SOUNDS=@ZM_DIR_SOUNDS@
-
-# Full path to the folder where exported archives are stored
-# The web account user must have full read/write permission to this folder.
-ZM_DIR_EXPORTS=@ZM_TMPDIR@
-
-# ZoneMinder url path to the zms streaming server
-ZM_PATH_ZMS=@ZM_PATH_ZMS@
-
-# Full Path to ZoneMinder's mapped memory files
-# The web account user must have full read/write permission to this folder.
-ZM_PATH_MAP=@ZM_PATH_MAP@
-
-# Full Path to ZoneMinder's socket folder
-# The web account user must have full read/write permission to this folder.
-ZM_PATH_SOCKS=@ZM_SOCKDIR@
-
-# Full path to ZoneMinder's log folder
-# The web account user must have full read/write permission to this folder.
-ZM_PATH_LOGS=@ZM_LOGDIR@
-
-# Full path to ZoneMinder's swap folder
-# The web account user must have full read/write permission to this folder.
-ZM_PATH_SWAP=@ZM_TMPDIR@
-
-# Full path to optional arp binary
-# ZoneMinder will find the arp binary automatically on most systems
-ZM_PATH_ARP=@ZM_PATH_ARP@
+# Do NOT set ZM_SERVER_HOST if you are not using Multi-Server
+# You have been warned
+#
+# The name specified here must have a corresponding entry
+# in the Servers tab under Options
+ZM_SERVER_HOST=