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