6.0.0-beta1
7/7/25

[#11637] ActiveSync AutoDiscover : Extend Driver.php to store the request and response schema in the properties
Summary ActiveSync AutoDiscover : Extend Driver.php to store the request and response schema in the properties
Queue Horde Framework Packages
Queue Version Git develop
Type Enhancement
State Resolved
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester torben (at) dannhauer (dot) info
Created 11/04/2012 (4628 days ago)
Due
Updated 11/05/2012 (4627 days ago)
Assigned
Resolved 11/05/2012 (4627 days ago)
Milestone
Patch Yes

History
11/05/2012 03:28:36 PM torben (at) dannhauer (dot) info Comment #4 Reply to this comment
I've added the values to the array passed to the 
_buildResponseString() method, but did not do it in the 
Horde_Core_ActiveSync_Driver class.  We should not be doing any 
input stream parsing/manipulation outside of the ActiveSync request 
handlers. Plus, we already have the data parsed, no need to parse it 
again.
I agree, it looms more clean and double parsnig is awful. Sorry, PHP 
is not my primary profession and the horde internals are overwhelming.

Thanks for fixing it!
11/05/2012 03:22:33 PM Michael Rubinsky Comment #3
Assigned to Michael Rubinsky
State ⇒ Resolved
Reply to this comment
I've added the values to the array passed to the 
_buildResponseString() method, but did not do it in the 
Horde_Core_ActiveSync_Driver class.  We should not be doing any input 
stream parsing/manipulation outside of the ActiveSync request 
handlers. Plus, we already have the data parsed, no need to parse it 
again.

11/05/2012 03:20:54 PM Git Commit Comment #2 Reply to this comment
Changes have been made in Git (master):

commit 283c402499ed9c6d24df70c6913ab56fccb70b7d
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Mon Nov 5 10:20:00 2012 -0500

     Pass the request_schema and response_schema to the autodiscover response.

     Request: 11637

  .../lib/Horde/ActiveSync/Request/Autodiscover.php  |    6 +++++-
  1 files changed, 5 insertions(+), 1 deletions(-)

http://git.horde.org/horde-git/-/commit/283c402499ed9c6d24df70c6913ab56fccb70b7d
11/05/2012 11:30:03 AM Jan Schneider State ⇒ Accepted
 
11/04/2012 05:52:12 PM Michael Rubinsky Version ⇒ Git develop
Priority ⇒ 1. Low
 
11/04/2012 04:24:49 PM torben (at) dannhauer (dot) info Comment #1
Priority ⇒ 2. Medium
Type ⇒ Enhancement
Summary ⇒ ActiveSync AutoDiscover : Extend Driver.php to store the request and response schema in the properties
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ Yes
State ⇒ New
Reply to this comment
To allow better reaction to different clients performing the 
autodiscover, it is neccessary to store the request-schema and 
response schema in the properties array.

It will be used in a second ActiveSycnc 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;
     }


Saved Queries