mirror of
https://github.com/YunoHost-Apps/z-push_ynh.git
synced 2024-09-03 18:05:58 +02:00
commit
1a80788ae7
6 changed files with 33 additions and 9 deletions
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 != '') {
|
||||
|
@ -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));
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -1229,9 +1229,31 @@ 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));
|
||||
return self::$mstzones["085"][1];
|
||||
|
|
Loading…
Add table
Reference in a new issue