Commit fe3ebd3e authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-1370 PR_IPM_SUBTREE_ENTRYID doesn't work on the public folder.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 7b361e37
...@@ -69,9 +69,14 @@ class ExportChangesICS implements IExportChanges{ ...@@ -69,9 +69,14 @@ class ExportChangesICS implements IExportChanges{
$entryid = mapi_msgstore_entryidfromsourcekey($store, $folderid); $entryid = mapi_msgstore_entryidfromsourcekey($store, $folderid);
} }
else { else {
$storeprops = mapi_getprops($this->store, array(PR_IPM_SUBTREE_ENTRYID)); $storeprops = mapi_getprops($this->store, array(PR_IPM_SUBTREE_ENTRYID, PR_IPM_PUBLIC_FOLDERS_ENTRYID));
if (ZPush::GetBackend()->GetImpersonatedUser() == 'system') {
$entryid = $storeprops[PR_IPM_PUBLIC_FOLDERS_ENTRYID];
}
else {
$entryid = $storeprops[PR_IPM_SUBTREE_ENTRYID]; $entryid = $storeprops[PR_IPM_SUBTREE_ENTRYID];
} }
}
$folder = false; $folder = false;
if ($entryid) { if ($entryid) {
......
...@@ -87,9 +87,14 @@ class ImportChangesICS implements IImportChanges { ...@@ -87,9 +87,14 @@ class ImportChangesICS implements IImportChanges {
} }
} }
else { else {
$storeprops = mapi_getprops($store, array(PR_IPM_SUBTREE_ENTRYID)); $storeprops = mapi_getprops($store, array(PR_IPM_SUBTREE_ENTRYID, PR_IPM_PUBLIC_FOLDERS_ENTRYID));
if (ZPush::GetBackend()->GetImpersonatedUser() == 'system') {
$entryid = $storeprops[PR_IPM_PUBLIC_FOLDERS_ENTRYID];
}
else {
$entryid = $storeprops[PR_IPM_SUBTREE_ENTRYID]; $entryid = $storeprops[PR_IPM_SUBTREE_ENTRYID];
} }
}
$folder = false; $folder = false;
if ($entryid) if ($entryid)
...@@ -664,10 +669,14 @@ class ImportChangesICS implements IImportChanges { ...@@ -664,10 +669,14 @@ class ImportChangesICS implements IImportChanges {
if (!$id) { if (!$id) {
// the root folder is "0" - get IPM_SUBTREE // the root folder is "0" - get IPM_SUBTREE
if ($parent == "0") { if ($parent == "0") {
$parentprops = mapi_getprops($this->store, array(PR_IPM_SUBTREE_ENTRYID)); $parentprops = mapi_getprops($this->store, array(PR_IPM_SUBTREE_ENTRYID, PR_IPM_PUBLIC_FOLDERS_ENTRYID));
if (isset($parentprops[PR_IPM_SUBTREE_ENTRYID])) if (ZPush::GetBackend()->GetImpersonatedUser() == 'system' && isset($parentprops[PR_IPM_PUBLIC_FOLDERS_ENTRYID])) {
$parentfentryid = $parentprops[PR_IPM_PUBLIC_FOLDERS_ENTRYID];
}
elseif (isset($parentprops[PR_IPM_SUBTREE_ENTRYID])) {
$parentfentryid = $parentprops[PR_IPM_SUBTREE_ENTRYID]; $parentfentryid = $parentprops[PR_IPM_SUBTREE_ENTRYID];
} }
}
else else
$parentfentryid = mapi_msgstore_entryidfromsourcekey($this->store, hex2bin($parent)); $parentfentryid = mapi_msgstore_entryidfromsourcekey($this->store, hex2bin($parent));
...@@ -719,8 +728,13 @@ class ImportChangesICS implements IImportChanges { ...@@ -719,8 +728,13 @@ class ImportChangesICS implements IImportChanges {
// get the real parent source key from mapi // get the real parent source key from mapi
if ($parent == "0") { if ($parent == "0") {
$parentprops = mapi_getprops($this->store, array(PR_IPM_SUBTREE_ENTRYID)); $parentprops = mapi_getprops($this->store, array(PR_IPM_SUBTREE_ENTRYID, PR_IPM_PUBLIC_FOLDERS_ENTRYID));
if (ZPush::GetBackend()->GetImpersonatedUser() == 'system') {
$parentfentryid = $parentprops[PR_IPM_PUBLIC_FOLDERS_ENTRYID];
}
else {
$parentfentryid = $parentprops[PR_IPM_SUBTREE_ENTRYID]; $parentfentryid = $parentprops[PR_IPM_SUBTREE_ENTRYID];
}
$mapifolder = mapi_msgstore_openentry($this->store, $parentfentryid); $mapifolder = mapi_msgstore_openentry($this->store, $parentfentryid);
$rootfolderprops = mapi_getprops($mapifolder, array(PR_SOURCE_KEY)); $rootfolderprops = mapi_getprops($mapifolder, array(PR_SOURCE_KEY));
......
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