Commit 2ebd7424 authored by Sebastian Kummer's avatar Sebastian Kummer

Merge branch 'develop' into feature/ZP-818-send-no-answer-collection-for-unchanged

parents 2e3a3a58 989e8537
......@@ -45,7 +45,8 @@ require_once '../vendor/autoload.php';
require_once '../config.php';
class ZPushAutodiscover {
const ACCEPTABLERESPONSESCHEMA = 'http://schemas.microsoft.com/exchange/autodiscover/mobilesync/responseschema/2006';
const ACCEPTABLERESPONSESCHEMAMOBILESYNC = 'http://schemas.microsoft.com/exchange/autodiscover/mobilesync/responseschema/2006';
const ACCEPTABLERESPONSESCHEMAOUTLOOK = 'http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a';
const MAXINPUTSIZE = 8192; // Bytes, the autodiscover request shouldn't exceed that value
private static $instance;
......@@ -98,8 +99,11 @@ class ZPushAutodiscover {
$email = ($this->getAttribFromUserDetails($userDetails, 'emailaddress')) ? $this->getAttribFromUserDetails($userDetails, 'emailaddress') : $incomingXml->Request->EMailAddress;
$userFullname = ($this->getAttribFromUserDetails($userDetails, 'fullname')) ? $this->getAttribFromUserDetails($userDetails, 'fullname') : $email;
ZLog::Write(LOGLEVEL_WBXML, sprintf("Resolved user's '%s' fullname to '%s'", $username, $userFullname));
$response = $this->createResponse($email, $userFullname);
setcookie("membername", $username);
// At the moment Z-Push only supports mobile response schema for autodiscover. Send empty response if the client request outlook response schema.
if ($incomingXml->Request->AcceptableResponseSchema == ZPushAutodiscover::ACCEPTABLERESPONSESCHEMAMOBILESYNC) {
$response = $this->createResponse($email, $userFullname);
setcookie("membername", $username);
}
}
catch (AuthenticationRequiredException $ex) {
......@@ -162,7 +166,7 @@ class ZPushAutodiscover {
throw new FatalException('Invalid input XML: no AcceptableResponseSchema.');
}
if ($xml->Request->AcceptableResponseSchema != ZPushAutodiscover::ACCEPTABLERESPONSESCHEMA) {
if ($xml->Request->AcceptableResponseSchema != ZPushAutodiscover::ACCEPTABLERESPONSESCHEMAMOBILESYNC && $xml->Request->AcceptableResponseSchema != ZPushAutodiscover::ACCEPTABLERESPONSESCHEMAOUTLOOK) {
throw new FatalException('Invalid input XML: not a mobilesync responseschema.');
}
......
......@@ -401,6 +401,7 @@ class MAPIMapping {
"status" => "PT_LONG:PSETID_Task:0x8101",
"icon" => PR_ICON_INDEX,
"owner" => "PT_STRING8:PSETID_Task:0x811F",
"private" => "PT_BOOLEAN:PSETID_Common:0x8506",
);
}
......
......@@ -1589,6 +1589,8 @@ class MAPIProvider {
$recurrence->setRecurrence($recur);
}
$props[$taskprops["private"]] = (isset($task->sensitivity) && $task->sensitivity == SENSITIVITY_PRIVATE) ? true : false;
//open addresss book for user resolve to set the owner
$addrbook = $this->getAddressbook();
......
......@@ -103,9 +103,8 @@ class Ping extends RequestProcessor {
}
if(($el = self::$decoder->getElementStartTag(SYNC_PING_FOLDERS)) && $el[EN_FLAGS] & EN_FLAGS_CONTENT) {
// remove PingableFlag from all collections
foreach ($sc as $folderid => $spa)
$spa->DelPingableFlag();
// cache requested (pingable) folderids
$pingable = array();
while(self::$decoder->getElementStartTag(SYNC_PING_FOLDER)) {
WBXMLDecoder::ResetInWhile("pingFolder");
......@@ -143,13 +142,24 @@ class Ping extends RequestProcessor {
$foundchanges = true;
}
else if ($class == $spa->GetContentClass()) {
$spa->SetPingableFlag(true);
$pingable[] = $folderid;
ZLog::Write(LOGLEVEL_DEBUG, sprintf("HandlePing(): using saved sync state for '%s' id '%s'", $spa->GetContentClass(), $folderid));
}
}
if(!self::$decoder->getElementEndTag())
return false;
// update pingable flags
foreach ($sc as $folderid => $spa) {
// if the folderid is in $pingable, we should ping it, else remove the flag
if (in_array($folderid, $pingable)) {
$spa->SetPingableFlag(true);
}
else {
$spa->DelPingableFlag();
}
}
}
if(!self::$decoder->getElementEndTag())
return false;
......
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