Commit 208e6bbb authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #132 in ZP/z-push from release/2.2 to master

* commit '9eb68bf8':
  ZP-809 Bumped version to 2.2.8.
  ZP-809 bumped version to 2.2.8beta1.
  ZP-809 Bumped to 2.2.8alpha2.
  ZP-809 Bumped version file, removed white space.
  Merge pull request #119 in ZP/z-push from bugfix/ZP-784-sync-with-remove-fails-if-source-message to develop
  Merge pull request #114 in ZP/z-push from bugfix/ZP-799-disallow-new-new-time-proposal-is to develop
  Merge pull request #113 in ZP/z-push from bugfix/ZP-798-loopdetection-gets-stuck to develop
  Merge pull request #103 in ZP/z-push from bugfix/ZP-786-instanceof-is-lowercase to develop
  Merge pull request #100 in ZP/z-push from feature/ZP-782-log-file-and-line-in-zpushexception to develop
  Merge pull request #101 in ZP/z-push from bugfix/ZP-783-statusexception-from-phpwrapper-not to develop
  Merge pull request #99 in ZP/z-push from bugfix/ZP-780-incompatible-zcp-7.0.x-ics-importfolderchange to develop
  Merge pull request #94 in ZP/z-push from bugfix/ZP-773-autodiscover-needs-timezone-set-for to develop
  Merge pull request #98 in ZP/z-push from bugfix/ZP-776-remove-obsolete-check-and-link to develop
  Merge pull request #97 in ZP/z-push from bugfix/ZP-775-z-push-admin-a-resync-t-does-not-work to develop
  ZP-785 Fix mixed EOL.
parents 62aac989 9eb68bf8
......@@ -265,5 +265,15 @@ class ZPushAutodiscover {
}
}
// set time zone
// code contributed by Robert Scheck (rsc)
if(defined('TIMEZONE') ? constant('TIMEZONE') : false) {
if (! @date_default_timezone_set(TIMEZONE))
throw new FatalMisconfigurationException(sprintf("The configured TIMEZONE '%s' is not valid. Please check supported timezones at http://www.php.net/manual/en/timezones.php", constant('TIMEZONE')));
}
else if(!ini_get('date.timezone')) {
date_default_timezone_set('Europe/Amsterdam');
}
ZPushAutodiscover::DoZPushAutodiscover();
?>
\ No newline at end of file
......@@ -44,6 +44,9 @@
/**********************************************************************************
* Default settings
*/
// Defines the default time zone, change e.g. to "Europe/London" if necessary
define('TIMEZONE', '');
// Defines the base path on the server
define('BASE_PATH', dirname($_SERVER['SCRIPT_FILENAME']). '/');
......
......@@ -12,7 +12,7 @@
*
* Created : 14.02.2011
*
* Copyright 2007 - 2013 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,
......@@ -311,6 +311,7 @@ class ImportChangesICS implements IImportChanges {
$potConflicts = $exporter->GetChangeCount();
$started = time();
$exported = 0;
try {
while(is_array($exporter->Synchronize())) {
$exported++;
......@@ -322,6 +323,11 @@ class ImportChangesICS implements IImportChanges {
return;
}
}
}
// something really bad happened while exporting changes
catch (StatusException $stex) {
ZLog::Write(LOGLEVEL_WARN, sprintf("ImportChangesICS->lazyLoadConflicts(): got StatusException code %d while exporting changes. Ignore and mark conflicts as loaded.",$stex->getCode()));
}
$this->conflictsLoaded = true;
}
}
......
......@@ -6,7 +6,7 @@
*
* Created : 14.02.2011
*
* Copyright 2007 - 2013 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,
......@@ -847,6 +847,14 @@ class MAPIProvider {
$storeprops = $this->getStoreProps();
// For ZCP 7.0.x we need to retrieve more properties explicitly, see ZP-780
if (isset($folderprops[PR_SOURCE_KEY]) && !isset($folderprops[PR_ENTRYID]) && !isset($folderprops[PR_CONTAINER_CLASS])) {
$entryid = mapi_msgstore_entryidfromsourcekey($this->store, $folderprops[PR_SOURCE_KEY]);
$mapifolder = mapi_msgstore_openentry($this->store, $entryid);
$folderprops = mapi_getprops($mapifolder, array(PR_DISPLAY_NAME, PR_PARENT_ENTRYID, PR_ENTRYID, PR_SOURCE_KEY, PR_PARENT_SOURCE_KEY, PR_CONTAINER_CLASS, PR_ATTR_HIDDEN));
ZLog::Write(LOGLEVEL_DEBUG, "MAPIProvider->GetFolder(): received insuffient of data from ICS. Fetching required data.");
}
if(!isset($folderprops[PR_DISPLAY_NAME]) ||
!isset($folderprops[PR_PARENT_ENTRYID]) ||
!isset($folderprops[PR_SOURCE_KEY]) ||
......
......@@ -11,7 +11,7 @@
*
* Created : 20.10.2011
*
* Copyright 2007 - 2013 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,
......@@ -736,7 +736,7 @@ class LoopDetection extends InterProcessData {
ZLog::Write(LOGLEVEL_DEBUG, "LoopDetection->Detect(): case 3.1 detected - loop detected, init loop mode");
$current['loopcount'] = 1;
// the MaxCount is the max number of messages exported before
$current['maxCount'] = $counter + (($maxItems < $queuedMessages)? $maxItems: $queuedMessages);
$current['maxCount'] = $counter + (($maxItems < $queuedMessages) ? $maxItems : $queuedMessages);
$loop = true; // loop mode!!
}
else if ($queuedMessages == 0) {
......@@ -758,7 +758,7 @@ class LoopDetection extends InterProcessData {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("LoopDetection->Detect(): case 3.3.1 detected - broken item should be next, attempt to ignore it - id '%s'", $current['potential']));
$this->ignore_messageid = $current['potential'];
}
$current['maxCount'] = $counter + $queuedMessages;
$current['maxCount'] = $counter + (($maxItems < $queuedMessages) ? $maxItems : $queuedMessages);
$loop = true; // loop mode!!
}
}
......
......@@ -240,8 +240,7 @@ class ZPush {
Utils::FixFileOwner(LOGERRORFILE);
// set time zone
// code contributed by Robert Scheck (rsc) - more information: https://developer.berlios.de/mantis/view.php?id=479
if(function_exists("date_default_timezone_set")) {
// code contributed by Robert Scheck (rsc)
if(defined('TIMEZONE') ? constant('TIMEZONE') : false) {
if (! @date_default_timezone_set(TIMEZONE))
throw new FatalMisconfigurationException(sprintf("The configured TIMEZONE '%s' is not valid. Please check supported timezones at http://www.php.net/manual/en/timezones.php", constant('TIMEZONE')));
......@@ -249,7 +248,6 @@ class ZPush {
else if(!ini_get('date.timezone')) {
date_default_timezone_set('Europe/Amsterdam');
}
}
return true;
}
......
......@@ -55,8 +55,8 @@ class ZPushException extends Exception {
if (!$logLevel)
$logLevel = $this->defaultLogLevel;
ZLog::Write($logLevel, get_class($this) .': '. $message . ' - code: '.$code, false);
parent::__construct($message, (int) $code);
ZLog::Write($logLevel, get_class($this) .': '. $message . ' - code: '.$code. ' - file: '. $this->getFile().':'.$this->getLine(), false);
}
public function getHTTPCodeString() {
......
......@@ -1258,8 +1258,8 @@ class Sync extends RequestProcessor {
$folderid = self::$backend->GetWasteBasket();
if($folderid) {
$this->importer->ImportMessageMove($serverid, $folderid);
$actiondata["statusids"][$serverid] = SYNC_STATUS_SUCCESS;
$this->importer->ImportMessageMove($serverid, $folderid);
break;
}
else
......@@ -1271,7 +1271,9 @@ class Sync extends RequestProcessor {
}
}
catch (StatusException $stex) {
$actiondata["statusids"][$serverid] = $stex->getCode();
if($stex->getCode() != SYNC_MOVEITEMSSTATUS_SUCCESS) {
$actiondata["statusids"][$serverid] = SYNC_STATUS_OBJECTNOTFOUND;
}
}
break;
}
......
......@@ -129,11 +129,13 @@ class SyncMeetingRequest extends SyncObject {
SYNC_POOMMAIL_GLOBALOBJID => array ( self::STREAMER_VAR => "globalobjid"),
SYNC_POOMMAIL_DISALLOWNEWTIMEPROPOSAL => array ( self::STREAMER_VAR => "disallownewtimeproposal",
self::STREAMER_CHECKS => array( self::STREAMER_CHECK_REQUIRED => self::STREAMER_CHECK_SETZERO,
self::STREAMER_CHECK_ONEVALUEOF => array(0,1) )),
);
if (Request::GetProtocolVersion() >= 14.0) {
$mapping[SYNC_POOMMAIL_DISALLOWNEWTIMEPROPOSAL] = array ( self::STREAMER_VAR => "disallownewtimeproposal",
self::STREAMER_CHECKS => array( self::STREAMER_CHECK_REQUIRED => self::STREAMER_CHECK_SETZERO,
self::STREAMER_CHECK_ONEVALUEOF => array(0,1) ));
}
parent::SyncObject($mapping);
}
}
......
......@@ -82,7 +82,7 @@ abstract class SyncObject extends Streamer {
public function emptySupported($supportedFields) {
// Some devices do not send supported tag. In such a case remove all not set properties.
if (($supportedFields === false || !is_array($supportedFields) || (empty($supportedFields)))) {
if (defined('UNSET_UNDEFINED_PROPERTIES') && UNSET_UNDEFINED_PROPERTIES && ($this instanceOf SyncContact || $this instanceOf SyncAppointment)) {
if (defined('UNSET_UNDEFINED_PROPERTIES') && UNSET_UNDEFINED_PROPERTIES && ($this instanceof SyncContact || $this instanceof SyncAppointment)) {
ZLog::Write(LOGLEVEL_INFO, sprintf("%s->emptySupported(): no supported list available, emptying all not set parameters", get_class($this)));
$supportedFields = array_keys($this->mapping);
}
......
......@@ -6,7 +6,7 @@
*
* Created : 18.04.2008
*
* Copyright 2007 - 2015 Zarafa Deutschland GmbH
* Copyright 2007 - 2016 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,
......@@ -41,6 +41,6 @@
* Consult LICENSE file for details
************************************************/
define("ZPUSH_VERSION", "2.2.7");
define("ZPUSH_VERSION", "2.2.8");
?>
\ No newline at end of file
......@@ -239,7 +239,7 @@ class ZPushAdminCLI {
elseif (isset($options['type']) && !empty($options['type']))
self::$type = strtolower(trim($options['type']));
// if type is set, it must be one of known types or a 44 byte long folder id
// if type is set, it must be one of known types or a 44 or 48 byte long folder id
if (self::$type !== false) {
if (self::$type !== self::TYPE_OPTION_EMAIL &&
self::$type !== self::TYPE_OPTION_CALENDAR &&
......@@ -247,10 +247,11 @@ class ZPushAdminCLI {
self::$type !== self::TYPE_OPTION_TASK &&
self::$type !== self::TYPE_OPTION_NOTE &&
self::$type !== self::TYPE_OPTION_HIERARCHY &&
strlen(self::$type) !== 44) {
strlen(self::$type) !== 44 &&
strlen(self::$type) !== 48) {
self::$errormessage = "Wrong 'type'. Possible values are: ".
"'".self::TYPE_OPTION_EMAIL."', '".self::TYPE_OPTION_CALENDAR."', '".self::TYPE_OPTION_CONTACT."', '".self::TYPE_OPTION_TASK."', '".self::TYPE_OPTION_NOTE."', ".self::TYPE_OPTION_HIERARCHY."' ".
"or a 44 byte long folder id (as hex).";
"or a 44 or 48 byte long folder id (as hex).";
return;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment