Commit 5e006ca4 authored by Manfred Kutas's avatar Manfred Kutas

ZP-887 Fixed warning when looking up free/busy for a new user. Fixed the

available freebusy range in store and requested freebusy do not
intersect. Improved logging.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 7e80038d
......@@ -2124,12 +2124,17 @@ class BackendZarafa implements IBackend, ISearchProvider {
if ($timeslots > self::MAXFREEBUSYSLOTS) {
throw new StatusException("ZarafaBackend->getAvailability(): the requested free busy range is too large.", SYNC_RESOLVERECIPSSTATUS_PROTOCOLERROR);
}
$mergedFreeBusy = str_pad(fbNoData, $timeslots, fbNoData);
if(is_array($fbDataArray) && !empty($fbDataArray)) {
foreach($fbDataArray as $fbDataUser) {
if ($fbDataUser == null) {
ZLog::Write(LOGLEVEL_INFO, sprintf("ZarafaBackend->getAvailability(): freebusy user is null for '%s'. Unable to retrieve his availability.", $resolveRecipient->displayname));
continue;
}
$rangeuser = mapi_freebusydata_getpublishrange($fbDataUser);
if($rangeuser == null) {
ZLog::Write(LOGLEVEL_INFO, sprintf("Unable to retrieve mapi_freebusydata_getpublishrange (0x%X) for '%s'", mapi_last_hresult(), $resolveRecipient->displayname));
ZLog::Write(LOGLEVEL_INFO, sprintf("ZarafaBackend->getAvailability(): Unable to retrieve mapi_freebusydata_getpublishrange (0x%X) for '%s'", mapi_last_hresult(), $resolveRecipient->displayname));
$availability->status = SYNC_RESOLVERECIPSSTATUS_AVAILABILITY_FAILED;
return $availability;
}
......@@ -2139,6 +2144,10 @@ class BackendZarafa implements IBackend, ISearchProvider {
if ($rangeuser['start'] <= $start && $rangeuser['end'] >= $end) {
$mergedFreeBusy = str_pad(fbFree, $timeslots, fbFree);
}
// available free busy information is outside of the requested data
elseif ($rangeuser['end'] <= $start || $rangeuser['start'] >= $end) {
$mergedFreeBusy = str_pad(fbNoData, $timeslots, fbNoData);
}
// free busy information is not available at the begin of the requested period
elseif ($rangeuser['start'] > $start && $rangeuser['end'] >= $end) {
$missingSlots = intval(ceil(($rangeuser['start'] - $start) / self::HALFHOURSECONDS));
......
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