[sync] Enhance ActiveSync :: Extend Driver.php to store the request and response schema in the properties

Torben Dannhauer torben at dannhauer.info
Sun Nov 4 16:30:35 UTC 2012


Hi,

 

I have submitted a feature proposal to ActiveSync AutoDiscover in this
ticket: http://bugs.horde.org/ticket/11637 

 

Here are the details if someone wants to extend the
AutoDiscover-Capabilities of a horde installation 

 

-------------- Ticket 11637  ---------

 

To allow better reaction to different clients performing the  
autodiscover, it is necessary to store the request-schema and  
response schema in the properties array.

It will be used in a second ActiveSync Enhancement I will post as  
tickets in some minutes.

Therefore please extend "/Horde/Core/ActiveSync/Driver.php ::
autoDiscover()"
with the following lines:
         xml_parse_into_struct(xml_parser_create(),  Horde_Rpc::getInput(),
$values);
         $results['request_schema'] = $values[0]['attributes']['XMLNS'];
         $results['response_schema'] = $values[3]['value'];

The full function should look like this:
     /**
      * Attempt to autodiscover. Autodiscovery happens before the user is
      * authenticated, and ALWAYS uses the user's email address. We have to
      * do our best to translate email address to username. If this fails,
the
      * device simply falls back to requiring full user configuration.
      *
      * @return array
      */
     public function autoDiscover()
     {
         $results = array();

         // Attempt to get a username from the email address.
         $ident = $GLOBALS['injector']
             ->getInstance('Horde_Core_Factory_Identity')
             ->create($GLOBALS['registry']->getAuth());
         $results['display_name'] = $ident->getValue('fullname');
         $results['email'] = $ident->getValue('from_addr');
         $url = parse_url((string)Horde::url(null, true));
         $results['url'] = $url['scheme'] . '://' . $url['host'] .
'/Microsoft-Server-ActiveSync';
         xml_parse_into_struct(xml_parser_create(),  Horde_Rpc::getInput(),
$values);
         $results['request_schema'] = $values[0]['attributes']['XMLNS'];
         $results['response_schema'] = $values[3]['value'];

         // As of Exchange 2007, this always returns en:en
         $results['culture'] = 'en:en';
         return $results;
     }



More information about the sync mailing list