From 29545ebdc0c57392cb840ac7084c0d5772bf91e9 Mon Sep 17 00:00:00 2001 From: polytan02 Date: Tue, 19 Jan 2016 19:57:52 +0000 Subject: [PATCH 1/3] Update ta latest sources --- sources/backend/caldav/config.php | 4 +++- sources/backend/carddav/carddav.php | 2 +- sources/backend/carddav/config.php | 2 +- sources/backend/imap/imap.php | 4 ++-- sources/backend/ldap/config.php | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/sources/backend/caldav/config.php b/sources/backend/caldav/config.php index 1257443..7c5c9fa 100644 --- a/sources/backend/caldav/config.php +++ b/sources/backend/caldav/config.php @@ -6,7 +6,9 @@ * * Created : 27.11.2012 * -* Copyright 2007 - 2013 Zarafa Deutschland GmbH +* Copyright 2012 - 2014 Jean-Louis Dupond +* +* Jean-Louis Dupond released this code as AGPLv3 here: https://github.com/dupondje/PHP-Push-2/issues/93 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License, version 3, diff --git a/sources/backend/carddav/carddav.php b/sources/backend/carddav/carddav.php index 53144e7..21ad6ba 100644 --- a/sources/backend/carddav/carddav.php +++ b/sources/backend/carddav/carddav.php @@ -6,7 +6,7 @@ * * Created : 16.03.2013 * -* Copyright 2007 - 2013 Zarafa Deutschland GmbH +* Copyright 2013 - 2016 Francisco Miguel Biete * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License, version 3, diff --git a/sources/backend/carddav/config.php b/sources/backend/carddav/config.php index 2d24cc3..b82b5c9 100644 --- a/sources/backend/carddav/config.php +++ b/sources/backend/carddav/config.php @@ -6,7 +6,7 @@ * * Created : 16.03.2013 * -* Copyright 2007 - 2013 Zarafa Deutschland GmbH +* Copyright 2013 - 2016 Francisco Miguel Biete * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License, version 3, diff --git a/sources/backend/imap/imap.php b/sources/backend/imap/imap.php index a3afb12..3c1b7ad 100644 --- a/sources/backend/imap/imap.php +++ b/sources/backend/imap/imap.php @@ -1981,8 +1981,8 @@ class BackendIMAP extends BackendDiff implements ISearchProvider { */ private function getSearchRestriction($cpo) { $searchText = $cpo->GetSearchFreeText(); - $searchGreater = $cpo->GetSearchValueGreater(); - $searchLess = $cpo->GetSearchValueLess(); + $searchGreater = strftime("%Y-%m-%d", strtotime($cpo->GetSearchValueGreater())); + $searchLess = strftime("%Y-%m-%d", strtotime($cpo->GetSearchValueLess())); $filter = ''; if ($searchGreater != '') { diff --git a/sources/backend/ldap/config.php b/sources/backend/ldap/config.php index 02db4a5..60bbda6 100644 --- a/sources/backend/ldap/config.php +++ b/sources/backend/ldap/config.php @@ -6,7 +6,7 @@ * * Created : 27.11.2012 * -* Copyright 2007 - 2012 Zarafa Deutschland GmbH +* Copyright 2007 - 2015 Zarafa Deutschland GmbH * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License, version 3, From 5834e58c44cbff7cd6a71868faefa2a8432ec2cf Mon Sep 17 00:00:00 2001 From: polytan02 Date: Mon, 22 Feb 2016 07:24:03 +0000 Subject: [PATCH 2/3] Update to latest sources --- sources/lib/utils/timezoneutil.php | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/sources/lib/utils/timezoneutil.php b/sources/lib/utils/timezoneutil.php index 1aec962..7d814e2 100644 --- a/sources/lib/utils/timezoneutil.php +++ b/sources/lib/utils/timezoneutil.php @@ -1229,8 +1229,30 @@ class TimezoneUtil { */ static public function getMSTZnameFromTZName($name) { foreach (self::$mstzones as $mskey => $msdefs) { - if ($name == $msdefs[0]) + if ($name == $msdefs[0]) { return $msdefs[1]; + } + } + + // Not found? Then retrieve the correct TZName first and try again. + // That's ugly and needs a proper fix. But for now this method can convert + // - Europe/Berlin + // - W Europe Standard Time + // to "(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna" + // which is more correct than the hardcoded default of (GMT+00:00...) + $tzName = ''; + foreach (self::$phptimezones as $tzn => $phptzs) { + if (in_array($name, $phptzs)) { + $tzName = $tzn; + break; + } + } + if ($tzName != '') { + foreach (self::$mstzones as $mskey => $msdefs) { + if ($tzName == $msdefs[0]) { + return $msdefs[1]; + } + } } ZLog::Write(LOGLEVEL_WARN, sprintf("TimezoneUtil::getMSTZnameFromTZName() no MS name found for '%s'. Returning '(GMT) Greenwich Mean Time: Dublin, Edinburgh, Lisbon, London'", $name)); From c15e98083b6e21b0f42a918fbfb567b95627f085 Mon Sep 17 00:00:00 2001 From: polytan02 Date: Sun, 17 Apr 2016 09:01:30 +0100 Subject: [PATCH 3/3] Update to latest sources --- sources/backend/imap/imap.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/backend/imap/imap.php b/sources/backend/imap/imap.php index 3c1b7ad..3889f05 100644 --- a/sources/backend/imap/imap.php +++ b/sources/backend/imap/imap.php @@ -2550,14 +2550,14 @@ class BackendIMAP extends BackendDiff implements ISearchProvider { private function setFromHeaderValue(&$headers) { $from = getDefaultFromValue($this->username, $this->domain); - if (isset($headers["from"])) { + if (isset($headers["from"]) && strlen($headers["from"]) > 0) { ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->getFromHeaderValue(): from defined: %s", $headers["from"])); if (strlen(IMAP_DEFAULTFROM) > 0) { ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->getFromHeaderValue(): Overwriting From: %s", $from)); $headers["from"] = $from; } } - elseif (isset($headers["From"])) { + elseif (isset($headers["From"]) && strlen($headers["From"]) > 0) { ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->getFromHeaderValue(): From defined: %s", $headers["From"])); if (strlen(IMAP_DEFAULTFROM) > 0) { ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->getFromHeaderValue(): Overwriting From: %s", $from));