Commit 11fbbb47 authored by Manfred Kutas's avatar Manfred Kutas

ZP-967 KOE: gab-sync does not work logging in as SYSTEM. Do not add user

SYSTEM to the GAB. Better logging on error when saving a message.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 318b03b2
...@@ -340,6 +340,10 @@ class Kopano extends SyncWorker { ...@@ -340,6 +340,10 @@ class Kopano extends SyncWorker {
PR_DISPLAY_TYPE_EX PR_DISPLAY_TYPE_EX
)); ));
foreach ($gabentries as $entry) { foreach ($gabentries as $entry) {
// do not add SYSTEM user to the GAB
if (strtoupper($entry[PR_DISPLAY_NAME]) == "SYSTEM") {
continue;
}
$a = new GABEntry(); $a = new GABEntry();
$a->type = GABEntry::CONTACT; $a->type = GABEntry::CONTACT;
$a->memberOf = array(); $a->memberOf = array();
...@@ -496,9 +500,14 @@ class Kopano extends SyncWorker { ...@@ -496,9 +500,14 @@ class Kopano extends SyncWorker {
PR_BODY => $chunkData, PR_BODY => $chunkData,
$this->mapiprops['updatetime'] => time(), $this->mapiprops['updatetime'] => time(),
)); ));
mapi_savechanges($message); @mapi_savechanges($message);
if (mapi_last_hresult()) {
$log .= sprintf("error saving: 0x%08X", mapi_last_hresult());
}
else {
$log .= "saved"; $log .= "saved";
} }
}
// output log // output log
$this->log($log); $this->log($log);
...@@ -629,7 +638,7 @@ class Kopano extends SyncWorker { ...@@ -629,7 +638,7 @@ class Kopano extends SyncWorker {
$parentfentryid = false; $parentfentryid = false;
// the default store root // the default store root
if ($this->mainUser == HIDDEN_FOLDERSTORE) { if ($this->mainUser == HIDDEN_FOLDERSTORE && strtoupper($this->mainUser) != "SYSTEM") {
$parentprops = mapi_getprops($store, array(PR_IPM_SUBTREE_ENTRYID)); $parentprops = mapi_getprops($store, array(PR_IPM_SUBTREE_ENTRYID));
if (isset($parentprops[PR_IPM_SUBTREE_ENTRYID])) if (isset($parentprops[PR_IPM_SUBTREE_ENTRYID]))
$parentfentryid = $parentprops[PR_IPM_SUBTREE_ENTRYID]; $parentfentryid = $parentprops[PR_IPM_SUBTREE_ENTRYID];
......
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