Commit b1a3c7ff authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #361 in ZP/z-push from...

Merge pull request #361 in ZP/z-push from bugfix/ZP-1013-ios-does-not-send-meeting-response to develop

* commit 'ca2145a5':
  ZP-1013 modified regexp for getting iOS user agent.
  ZP-1013 Uppercase hex globalobjid for iOS devices and Outlook.
  ZP-1013 iOS does not send meeting response.
parents 8fc5e696 ca2145a5
...@@ -588,8 +588,15 @@ class MAPIProvider { ...@@ -588,8 +588,15 @@ class MAPIProvider {
$props = $this->getProps($mapimessage, $meetingrequestproperties); $props = $this->getProps($mapimessage, $meetingrequestproperties);
// Get the GOID // Get the GOID
if(isset($props[$meetingrequestproperties["goidtag"]])) if(isset($props[$meetingrequestproperties["goidtag"]])) {
$message->meetingrequest->globalobjid = base64_encode($props[$meetingrequestproperties["goidtag"]]); // GlobalObjId support was removed in AS 16.0
if (Request::IsGlobalObjIdHexClient()) {
$message->meetingrequest->globalobjid = strtoupper(bin2hex($props[$meetingrequestproperties["goidtag"]]));
}
else {
$message->meetingrequest->globalobjid = base64_encode($props[$meetingrequestproperties["goidtag"]]);
}
}
// Set Timezone // Set Timezone
if(isset($props[$meetingrequestproperties["timezonetag"]])) if(isset($props[$meetingrequestproperties["timezonetag"]]))
......
...@@ -654,6 +654,32 @@ class Request { ...@@ -654,6 +654,32 @@ class Request {
return (time() - $_SERVER["REQUEST_TIME"]) >= self::GetExpectedConnectionTimeout(); return (time() - $_SERVER["REQUEST_TIME"]) >= self::GetExpectedConnectionTimeout();
} }
/**
* Checks the device type if it expects the globalobjid in meeting requests encoded as hex.
* If it's not the case, globalobjid will be base64 encoded.
*
* WindowsOutlook and iOS device since 9.3 (?) version expect globalobjid to be hex encoded.
* @see https://jira.z-hub.io/projects/ZP/issues/ZP-1013
*
* @access public
* @return boolean
*/
static public function IsGlobalObjIdHexClient() {
switch (self::GetDeviceType()) {
case "WindowsOutlook":
ZLog::Write(LOGLEVEL_DEBUG, "Request->IsGlobalObjIdHexClient(): WindowsOutlook");
return true;
case "iPod":
case "iPad":
case "iPhone":
$matches = array();
if (preg_match("/^Apple-.*?\/(\d{4})\./", self::GetUserAgent(), $matches) && isset($matches[1]) && $matches[1] >= 1305) {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("Request->IsGlobalObjIdHexClient(): %s->%s", self::GetDeviceType(), self::GetUserAgent()));
return true;
}
}
return false;
}
/**---------------------------------------------------------------------------------------------------------- /**----------------------------------------------------------------------------------------------------------
* Private stuff * Private stuff
*/ */
......
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