From 92917809b8ac4f38322f82f3615e74b84d72628b Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 1 Nov 2017 12:49:38 -0700 Subject: [PATCH] add creating /usr/share/zoneminder/www/cache --- distros/ubuntu1604/zoneminder.dirs | 1 + distros/ubuntu1604/zoneminder.postinst | 2 +- web/includes/functions.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/distros/ubuntu1604/zoneminder.dirs b/distros/ubuntu1604/zoneminder.dirs index 56dd56e6b..08840aef4 100644 --- a/distros/ubuntu1604/zoneminder.dirs +++ b/distros/ubuntu1604/zoneminder.dirs @@ -4,5 +4,6 @@ var/cache/zoneminder/events var/cache/zoneminder/images var/cache/zoneminder/temp usr/share/zoneminder/db +usr/share/zoneminder/www/cache etc/zm/ etc/zm/conf.d diff --git a/distros/ubuntu1604/zoneminder.postinst b/distros/ubuntu1604/zoneminder.postinst index e06cdd3b5..c11d0d866 100644 --- a/distros/ubuntu1604/zoneminder.postinst +++ b/distros/ubuntu1604/zoneminder.postinst @@ -10,7 +10,7 @@ if [ "$1" = "configure" ]; then chown www-data:root /var/log/zm chown www-data:www-data /var/lib/zm if [ -z "$2" ]; then - chown www-data:www-data /var/cache/zoneminder /var/cache/zoneminder/* + chown www-data:www-data /var/cache/zoneminder /var/cache/zoneminder/* /usr/share/zoneminder/www/cache fi if [ ! -e "/etc/apache2/mods-enabled/cgi.load" ]; then echo "The cgi module is not enabled in apache2. I am enabling it using a2enmod cgi." diff --git a/web/includes/functions.php b/web/includes/functions.php index 6a94bb8ef..693754c10 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -2065,7 +2065,7 @@ function cache_bust( $file ) { # To defeat caching. Should probably use md5 hash $parts = pathinfo($file); $cacheFile = '/cache/'.$parts['filename'].'-'.filemtime($file).'.'.$parts['extension']; - if ( file_exists( ZM_PATH_WEB.$cacheFile ) or symlink( ZM_PATH_WEB.'/'.$file, ZM_PATH_WEB.$cacheFile ) ) { + if ( file_exists(ZM_PATH_WEB.'/cache') and ( file_exists( ZM_PATH_WEB.$cacheFile ) or symlink( ZM_PATH_WEB.'/'.$file, ZM_PATH_WEB.$cacheFile ) ) ) { return $cacheFile; } else { Warning("Failed linking $file to $cacheFile");