Commit 025fa6f7 authored by Sebastian Kummer's avatar Sebastian Kummer

Merging in latest from upstream (ZP/z-push:refs/heads/develop)

* commit '7e80038d':
  ZP-881 Updated copyright year.
  ZP-881 Define ZCP server location for listfolders depending on ZCP version.
  ZP-855 Searched and found message can not be deleted (iOS).
parents ed2d0cd5 7e80038d
......@@ -10,7 +10,7 @@
*
* Created : 06.05.2011
*
* Copyright 2007 - 2013, 2015 Zarafa Deutschland GmbH
* Copyright 2007 - 2013, 2015-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,
......@@ -46,7 +46,12 @@
************************************************/
define("PHP_MAPI_PATH", "/usr/share/php/mapi/");
define('MAPI_SERVER', 'file:///var/run/zarafa');
if (CheckMapiExtVersion('7.2.0')) {
define('MAPI_SERVER', 'file:///var/run/zarafad/server.sock');
}
else {
define('MAPI_SERVER', 'file:///var/run/zarafa');
}
define('SSLCERT_FILE', null);
define('SSLCERT_PASS', null);
......@@ -216,3 +221,21 @@ function listfolders_getlist ($adminStore, $session, $user) {
}
}
}
function CheckMapiExtVersion($version = "") {
// compare build number if requested
if (preg_match('/^\d+$/', $version) && strlen($version) > 3) {
$vs = preg_split('/-/', phpversion("mapi"));
return ($version <= $vs[1]);
}
if (extension_loaded("mapi")){
if (version_compare(phpversion("mapi"), $version) == -1){
return false;
}
}
else
return false;
return true;
}
\ No newline at end of file
......@@ -1215,7 +1215,7 @@ class BackendZarafa implements IBackend, ISearchProvider {
$items["range"] = $cpo->GetSearchRange();
for ($i = 0; $i < $cnt; $i++) {
$items[$i]['class'] = 'Email';
$items[$i]['longid'] = bin2hex($rows[$i][PR_PARENT_SOURCE_KEY]) . ":" . bin2hex($rows[$i][PR_SOURCE_KEY]);
$items[$i]['longid'] = ZPush::GetDeviceManager()->GetFolderIdForBackendId(bin2hex($rows[$i][PR_PARENT_SOURCE_KEY])) . ":" . bin2hex($rows[$i][PR_SOURCE_KEY]);
$items[$i]['folderid'] = bin2hex($rows[$i][PR_PARENT_SOURCE_KEY]);
}
return $items;
......
......@@ -293,7 +293,7 @@ class ItemOperations extends RequestProcessor {
else if (isset($operation['longid'])) {
self::$topCollector->AnnounceInformation("Fetching data from backend with long id");
$tmp = explode(":", $operation['longid']);
$data = self::$backend->Fetch($tmp[0], $tmp[1], $operation["cpo"]);
$data = self::$backend->Fetch(self::$deviceManager->GetBackendIdForFolderId($tmp[0]), $tmp[1], $operation["cpo"]);
}
}
catch (StatusException $stex) {
......
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