Commit 075aefa3 authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-1003 Always open store of the login user so we have a defaultstore

available. Don't log when opening the store.
Added missing property PR_BUSINESS_ADDRESS_STATE_OR_PROVINCE to be
fetched from the GAB. 

Released under the Affero GNU General Public License (AGPL) version 3.
parent a93e5be5
...@@ -55,6 +55,7 @@ class Kopano extends SyncWorker { ...@@ -55,6 +55,7 @@ class Kopano extends SyncWorker {
const NAME = "Z-Push Kopano GAB Sync"; const NAME = "Z-Push Kopano GAB Sync";
const VERSION = "1.1"; const VERSION = "1.1";
private $session; private $session;
private $defaultstore;
private $store; private $store;
private $mainUser; private $mainUser;
private $targetStore; private $targetStore;
...@@ -80,6 +81,7 @@ class Kopano extends SyncWorker { ...@@ -80,6 +81,7 @@ class Kopano extends SyncWorker {
} }
$this->mainUser = USERNAME; $this->mainUser = USERNAME;
$this->targetStore = HIDDEN_FOLDERSTORE; $this->targetStore = HIDDEN_FOLDERSTORE;
$this->defaultstore = $this->openMessageStore($this->mainUser);
$this->store = $this->openMessageStore(HIDDEN_FOLDERSTORE); $this->store = $this->openMessageStore(HIDDEN_FOLDERSTORE);
$this->folderCache = array(); $this->folderCache = array();
$this->storeCache = array(); $this->storeCache = array();
...@@ -334,6 +336,7 @@ class Kopano extends SyncWorker { ...@@ -334,6 +336,7 @@ class Kopano extends SyncWorker {
PR_BUSINESS_ADDRESS_CITY, PR_BUSINESS_ADDRESS_CITY,
PR_BUSINESS_ADDRESS_POSTAL_CODE, PR_BUSINESS_ADDRESS_POSTAL_CODE,
PR_BUSINESS_ADDRESS_POST_OFFICE_BOX, PR_BUSINESS_ADDRESS_POST_OFFICE_BOX,
PR_BUSINESS_ADDRESS_STATE_OR_PROVINCE,
PR_INITIALS, PR_INITIALS,
PR_LANGUAGE, PR_LANGUAGE,
PR_EMS_AB_THUMBNAIL_PHOTO, PR_EMS_AB_THUMBNAIL_PHOTO,
...@@ -583,8 +586,9 @@ class Kopano extends SyncWorker { ...@@ -583,8 +586,9 @@ class Kopano extends SyncWorker {
} }
} }
} }
else else {
$entryid = @mapi_msgstore_createentryid($this->defaultstore, $user); $entryid = @mapi_msgstore_createentryid($this->defaultstore, $user);
}
if(!$entryid) { if(!$entryid) {
$this->Terminate(sprintf("Kopano->openMessageStore(): No store found for user '%s': 0x%08X - Aborting.", $user, mapi_last_hresult())); $this->Terminate(sprintf("Kopano->openMessageStore(): No store found for user '%s': 0x%08X - Aborting.", $user, mapi_last_hresult()));
...@@ -595,7 +599,6 @@ class Kopano extends SyncWorker { ...@@ -595,7 +599,6 @@ class Kopano extends SyncWorker {
$this->Terminate(sprintf("Kopano->openMessageStore(): Could not open store for '%s': 0x%08X - Aborting.", $user, mapi_last_hresult())); $this->Terminate(sprintf("Kopano->openMessageStore(): Could not open store for '%s': 0x%08X - Aborting.", $user, mapi_last_hresult()));
} }
$this->Log(sprintf("Kopano->openMessageStore(): Found '%s' store of user '%s': '%s'", (($return_public)?'PUBLIC':'DEFAULT'), $user, $store));
return $store; return $store;
} }
......
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