Commit 1a60ecd3 authored by Manfred Kutas's avatar Manfred Kutas

ZP-714 Implement Free/Busy lookup for Zarafa backend.

Released under the Affero GNU General Public License (AGPL) version 3.
parent f825d7d6
...@@ -1723,8 +1723,17 @@ class BackendZarafa implements IBackend, ISearchProvider { ...@@ -1723,8 +1723,17 @@ class BackendZarafa implements IBackend, ISearchProvider {
$querycnt = mapi_table_getrowcount($table); $querycnt = mapi_table_getrowcount($table);
if ($querycnt > 0) { if ($querycnt > 0) {
$recipientGal = array(); $recipientGal = array();
$rowsToQuery = $maxAmbiguousRecipients;
// some devices request 0 ambiguous recipients
if ($querycnt == 1 && $maxAmbiguousRecipients == 0) {
$rowsToQuery = 1;
}
elseif ($querycnt > 1 && $maxAmbiguousRecipients == 0) {
ZLog::Write(LOGLEVEL_INFO, sprintf("GAL search found %d recipients but the device hasn't requested ambiguous recipients", $querycnt));
return $recipientGal;
}
// get the certificate every time because caching the certificate is less expensive than opening addressbook entry again // get the certificate every time because caching the certificate is less expensive than opening addressbook entry again
$abentries = mapi_table_queryrows($table, array(PR_ENTRYID, PR_DISPLAY_NAME, PR_EMS_AB_TAGGED_X509_CERT, PR_OBJECT_TYPE), 0, $maxAmbiguousRecipients); $abentries = mapi_table_queryrows($table, array(PR_ENTRYID, PR_DISPLAY_NAME, PR_EMS_AB_TAGGED_X509_CERT, PR_OBJECT_TYPE), 0, $rowsToQuery);
for ($i = 0, $nrEntries = count($abentries); $i < $nrEntries; $i++) { for ($i = 0, $nrEntries = count($abentries); $i < $nrEntries; $i++) {
if ($abentries[$i][PR_OBJECT_TYPE] == MAPI_DISTLIST) { if ($abentries[$i][PR_OBJECT_TYPE] == MAPI_DISTLIST) {
// dist lists must be expanded into their members // dist lists must be expanded into their members
......
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