From 1d9d84cc4990bcccafc8f58c84f23b0b3cf36317 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 30 Apr 2014 10:10:34 -0400 Subject: [PATCH 1/3] max executable --- utils/zm-alarm.pl | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 utils/zm-alarm.pl diff --git a/utils/zm-alarm.pl b/utils/zm-alarm.pl old mode 100644 new mode 100755 From b48d06b2795868fb43acba34ed9ebd0c68a46962 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 13 Jun 2014 16:09:01 -0400 Subject: [PATCH 2/3] change commands to handle if db already has the User and Pass fields --- db/zm_update-1.27.0.sql | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/db/zm_update-1.27.0.sql b/db/zm_update-1.27.0.sql index b5cc865b5..d70aff0c7 100644 --- a/db/zm_update-1.27.0.sql +++ b/db/zm_update-1.27.0.sql @@ -13,11 +13,39 @@ ALTER TABLE Monitors modify column Type enum('Local','Remote','File','Ffmpeg','L -- -- Add required fields for cURL authenication -- -ALTER TABLE `Monitors` ADD `User` VARCHAR(32) NOT NULL AFTER `SubPath`; -ALTER TABLE `Monitors` ADD `Pass` VARCHAR(32) NOT NULL AFTER `User`; + +SET @s = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.COLUMNS + WHERE table_name = 'Monitors' + AND table_schema = DATABASE() + AND column_name = 'User' + ) > 0, +"SELECT 'Column User exists in Monitors'", +"ALTER TABLE `Monitors` ADD `User` VARCHAR(32) NOT NULL AFTER `SubPath`" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt; + +SET @s = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.COLUMNS + WHERE table_name = 'Monitors' + AND table_schema = DATABASE() + AND column_name = 'Pass' + ) > 0, +"SELECT 'Column Pass exists in Monitors'", +"ALTER TABLE `Monitors` ADD `Pass` VARCHAR(32) NOT NULL AFTER `User`" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt; -- -- Add default zone preset -- + INSERT INTO ZonePresets VALUES (NULL,'Default','Active','Percent','Blobs',25,NULL,3,75,3,3,3,75,2,NULL,1,NULL,0); + From 8ac6ce17bcdec49b3ae7176763a145804715ded6 Mon Sep 17 00:00:00 2001 From: tim Date: Sun, 15 Jun 2014 13:01:29 -0700 Subject: [PATCH 3/3] Fixed issue DateTime handling in filter queries that broke timeline view. --- web/skins/classic/includes/timeline_functions.php | 2 +- web/skins/flat/includes/timeline_functions.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/skins/classic/includes/timeline_functions.php b/web/skins/classic/includes/timeline_functions.php index c74ea0ecb..cf92f8689 100644 --- a/web/skins/classic/includes/timeline_functions.php +++ b/web/skins/classic/includes/timeline_functions.php @@ -232,7 +232,7 @@ function parseFilterToTree( $filter ) $value = "'$value'"; break; case 'DateTime': - $value = strftime( STRF_FMT_DATETIME_DB, strtotime( $value ) ); + $value = "'".strftime( STRF_FMT_DATETIME_DB, strtotime( $value ) )."'"; break; case 'Date': $value = "to_days( '".strftime( STRF_FMT_DATETIME_DB, strtotime( $value ) )."' )"; diff --git a/web/skins/flat/includes/timeline_functions.php b/web/skins/flat/includes/timeline_functions.php index c74ea0ecb..cf92f8689 100644 --- a/web/skins/flat/includes/timeline_functions.php +++ b/web/skins/flat/includes/timeline_functions.php @@ -232,7 +232,7 @@ function parseFilterToTree( $filter ) $value = "'$value'"; break; case 'DateTime': - $value = strftime( STRF_FMT_DATETIME_DB, strtotime( $value ) ); + $value = "'".strftime( STRF_FMT_DATETIME_DB, strtotime( $value ) )."'"; break; case 'Date': $value = "to_days( '".strftime( STRF_FMT_DATETIME_DB, strtotime( $value ) )."' )";