Skip to content

Commit

Permalink
Add support for parsing incoming RightsManagementInformation nodes.
Browse files Browse the repository at this point in the history
Fixes some SETTINGS requests that we couldn't handle due to this
being missing.
  • Loading branch information
mrubinsk committed Dec 20, 2014
1 parent c8fb1d3 commit 4256804
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions framework/ActiveSync/lib/Horde/ActiveSync/Request/Settings.php
Expand Up @@ -77,6 +77,7 @@ class Horde_ActiveSync_Request_Settings extends Horde_ActiveSync_Request_Base
const SETTINGS_ACCOUNT = 'Settings:Account';
const SETTINGS_ACCOUNTID = 'Settings:AccountId';
const SETTINGS_USERDISPLAYNAME = 'Settings:UserDisplayName';
const SETTINGS_RIGHTSMANAGEMENTINFO = 'Settings:RightsManagementInformation';


/** Status codes **/
Expand Down Expand Up @@ -105,7 +106,8 @@ protected function _handle()
($this->_decoder->getElementStartTag(self::SETTINGS_DEVICEINFORMATION) ? self::SETTINGS_DEVICEINFORMATION :
($this->_decoder->getElementStartTag(self::SETTINGS_USERINFORMATION) ? self::SETTINGS_USERINFORMATION :
($this->_decoder->getElementStartTag(self::SETTINGS_DEVICEPASSWORD) ? self::SETTINGS_DEVICEPASSWORD :
-1))))) != -1) {
($this->_decoder->getElementStartTag(self::SETTINGS_RIGHTSMANAGEMENTINFO) ? self::SETTINGS_RIGHTSMANAGEMENTINFO :
-1)))))) != -1) {

while (($querytype = ($this->_decoder->getElementStartTag(self::SETTINGS_GET) ? self::SETTINGS_GET :
($this->_decoder->getElementStartTag(self::SETTINGS_SET) ? self::SETTINGS_SET :
Expand All @@ -118,14 +120,21 @@ protected function _handle()
$oof = Horde_ActiveSync::messageFactory('Oof');
$oof->decodeStream($this->_decoder);
$request['get']['oof']['bodytype'] = $oof->bodytype;
$this->_decoder->getElementEndTag(); // SETTINGS_GET
break;
case self::SETTINGS_USERINFORMATION:
// @TODO Do we need to fetch the <GET /> element?
// These are empty <GET /> tags.
$request['get']['userinformation'] = array();
$this->_decoder->getElementContent();
break;
case self::SETTINGS_RIGHTSMANAGEMENTINFO:
// These are empty <GET /> tags.
$request['get']['rightsmanagementinfo'] = true;
$this->_decoder->getElementContent();
break;
}
break;
$this->_decoder->getElementEndTag(); // SETTINGS_GET
// $this->_decoder->getElementEndTag(); // SETTINGS_GET
case self::SETTINGS_SET:
switch ($reqtype) {
case self::SETTINGS_OOF:
Expand Down Expand Up @@ -339,6 +348,13 @@ protected function _handle()
}

}
if (isset($request['get']['rightsmanagementinfo'])) {
$this->_encoder->startTag(self::SETTINGS_RIGHTSMANAGEMENTINFO);
$this->_encoder->startTag(self::SETTINGS_STATUS);
$this->_encoder->content(self::STATUS_SUCCESS);
$this->_encoder->endTag();
$this->_encoder->endTag();
}

$this->_encoder->endTag(); // end self::SETTINGS_SETTINGS

Expand Down

0 comments on commit 4256804

Please sign in to comment.