Commit 7ba0beb9 authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-915 Fixes for single GAB environments.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 84e997f4
...@@ -245,9 +245,11 @@ class Kopano extends SyncWorker { ...@@ -245,9 +245,11 @@ class Kopano extends SyncWorker {
protected function GetGABs() { protected function GetGABs() {
$names = array(); $names = array();
$companies = mapi_zarafa_getcompanylist($this->store); $companies = mapi_zarafa_getcompanylist($this->store);
if (is_array($companies)) {
foreach($companies as $c) { foreach($companies as $c) {
$names[$c['companyname']] = bin2hex($c['companyid']); $names[$c['companyname']] = bin2hex($c['companyid']);
} }
}
return $names; return $names;
} }
...@@ -417,7 +419,7 @@ class Kopano extends SyncWorker { ...@@ -417,7 +419,7 @@ class Kopano extends SyncWorker {
$store = $this->getStore($gabId, $gabName); $store = $this->getStore($gabId, $gabName);
$chunkdata = $this->findChunk($store, $folderid, $chunkName); $chunkdata = $this->findChunk($store, $folderid, $chunkName);
if ($chunkdata[PR_ENTRYID]) { if (isset($chunkdata[PR_ENTRYID])) {
$message = mapi_msgstore_openentry($store, $chunkdata[PR_ENTRYID]); $message = mapi_msgstore_openentry($store, $chunkdata[PR_ENTRYID]);
return $this->readPropStream($message, PR_BODY); return $this->readPropStream($message, PR_BODY);
} }
......
...@@ -89,7 +89,7 @@ abstract class SyncWorker { ...@@ -89,7 +89,7 @@ abstract class SyncWorker {
$gabs = $this->GetGABs(); $gabs = $this->GetGABs();
if (empty($gabs)) { if (empty($gabs)) {
if(!$targetGab) { if($targetGab) {
$this->Terminate("Multiple GABs not found, target should not be set. Aborting."); $this->Terminate("Multiple GABs not found, target should not be set. Aborting.");
} }
// no multi-GABs, just go default // no multi-GABs, just go default
...@@ -203,7 +203,7 @@ abstract class SyncWorker { ...@@ -203,7 +203,7 @@ abstract class SyncWorker {
$gabs = $this->GetGABs(); $gabs = $this->GetGABs();
if (empty($gabs)) { if (empty($gabs)) {
if(!$targetGab) { if($targetGab) {
$this->Terminate("Multiple GABs not found, target should not be set. Aborting."); $this->Terminate("Multiple GABs not found, target should not be set. Aborting.");
} }
// default case, no multi-GABs, just go default // default case, no multi-GABs, just go default
...@@ -289,7 +289,7 @@ abstract class SyncWorker { ...@@ -289,7 +289,7 @@ abstract class SyncWorker {
$gabs = $this->GetGABs(); $gabs = $this->GetGABs();
if (empty($gabs)) { if (empty($gabs)) {
if(!$targetGab) { if($targetGab) {
$this->Terminate("Multiple GABs not found, target should not be set. Aborting."); $this->Terminate("Multiple GABs not found, target should not be set. Aborting.");
} }
// no multi-GABs, just go default // no multi-GABs, just go default
...@@ -342,7 +342,7 @@ abstract class SyncWorker { ...@@ -342,7 +342,7 @@ abstract class SyncWorker {
$gabs = $this->GetGABs(); $gabs = $this->GetGABs();
if (empty($gabs)) { if (empty($gabs)) {
if(!$targetGab) { if($targetGab) {
$this->Terminate("Multiple GABs not found, target should not be set. Aborting."); $this->Terminate("Multiple GABs not found, target should not be set. Aborting.");
} }
// no multi-GABs, just go default // no multi-GABs, just go default
......
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