Overview

Packages

  • Kolab
    • FreeBusy

Classes

  • Horde_Kolab_FreeBusy
  • Horde_Kolab_FreeBusy_Cache
  • Horde_Kolab_FreeBusy_Cache_Base
  • Horde_Kolab_FreeBusy_Cache_DB
  • Horde_Kolab_FreeBusy_Cache_DB_acl
  • Horde_Kolab_FreeBusy_Cache_DB_xacl
  • Horde_Kolab_FreeBusy_Cache_File
  • Horde_Kolab_FreeBusy_Cache_File_acl
  • Horde_Kolab_FreeBusy_Cache_File_pvcal
  • Horde_Kolab_FreeBusy_Cache_File_vcal
  • Horde_Kolab_FreeBusy_Cache_File_xacl
  • Horde_Kolab_FreeBusy_Controller_Base
  • Horde_Kolab_FreeBusy_Controller_MatchDict
  • Horde_Kolab_FreeBusy_Controller_NotFound
  • Horde_Kolab_FreeBusy_Controller_RequestConfiguration
  • Horde_Kolab_FreeBusy_Driver_Base
  • Horde_Kolab_FreeBusy_Driver_Freebusy_Base
  • Horde_Kolab_FreeBusy_Driver_Freebusy_Kolab
  • Horde_Kolab_FreeBusy_Exception
  • Horde_Kolab_FreeBusy_Exception_NotFound
  • Horde_Kolab_FreeBusy_Exception_Unauthorized
  • Horde_Kolab_FreeBusy_Export_Freebusy_Backend_Kolab
  • Horde_Kolab_FreeBusy_Export_Freebusy_Base
  • Horde_Kolab_FreeBusy_Export_Freebusy_Decorator_Log
  • Horde_Kolab_FreeBusy_Factory_Base
  • Horde_Kolab_FreeBusy_Freebusy_Controller_Freebusy
  • Horde_Kolab_FreeBusy_Freebusy_Factory_Base
  • Horde_Kolab_FreeBusy_Freebusy_Factory_Kolab
  • Horde_Kolab_FreeBusy_Freebusy_Helper_Owa
  • Horde_Kolab_FreeBusy_Freebusy_Helper_StatusMap_Config
  • Horde_Kolab_FreeBusy_Freebusy_Helper_StatusMap_Default
  • Horde_Kolab_FreeBusy_Freebusy_Owner_Kolab
  • Horde_Kolab_FreeBusy_Freebusy_Params_Folder
  • Horde_Kolab_FreeBusy_Freebusy_UserDb_Kolab
  • Horde_Kolab_FreeBusy_Object_Event
  • Horde_Kolab_FreeBusy_Owner_Kolab
  • Horde_Kolab_FreeBusy_Params_Freebusy_Resource_Kolab
  • Horde_Kolab_FreeBusy_Params_User
  • Horde_Kolab_FreeBusy_Provider_Local
  • Horde_Kolab_FreeBusy_Provider_Remote
  • Horde_Kolab_FreeBusy_Provider_Remote_PassThrough
  • Horde_Kolab_FreeBusy_Provider_Remote_Redirect
  • Horde_Kolab_FreeBusy_Report
  • Horde_Kolab_FreeBusy_Resource_Decorator_Log
  • Horde_Kolab_FreeBusy_Resource_Decorator_Mcache
  • Horde_Kolab_FreeBusy_Resource_Event_Decorator_Log
  • Horde_Kolab_FreeBusy_Resource_Event_Decorator_Mcache
  • Horde_Kolab_FreeBusy_Resource_Event_Kolab
  • Horde_Kolab_FreeBusy_Resource_Event_Owa
  • Horde_Kolab_FreeBusy_Resource_Kolab
  • Horde_Kolab_FreeBusy_Translation
  • Horde_Kolab_FreeBusy_User_Anonymous
  • Horde_Kolab_FreeBusy_User_Decorator_Log
  • Horde_Kolab_FreeBusy_User_Kolab
  • Horde_Kolab_FreeBusy_UserDb_Kolab
  • Horde_Kolab_FreeBusy_UserDb_User_Kolab
  • Horde_Kolab_FreeBusy_View
  • Horde_Kolab_FreeBusy_View_error
  • Horde_Kolab_FreeBusy_View_vfb

Interfaces

  • Horde_Kolab_FreeBusy_Driver_Freebusy_Interface
  • Horde_Kolab_FreeBusy_Driver_Interface
  • Horde_Kolab_FreeBusy_Export_Freebusy
  • Horde_Kolab_FreeBusy_Export_Freebusy_Backend
  • Horde_Kolab_FreeBusy_Factory
  • Horde_Kolab_FreeBusy_Freebusy_Helper_StatusMap
  • Horde_Kolab_FreeBusy_Freebusy_Owner
  • Horde_Kolab_FreeBusy_Owner
  • Horde_Kolab_FreeBusy_Params_Owner
  • Horde_Kolab_FreeBusy_Params_Resource
  • Horde_Kolab_FreeBusy_Provider
  • Horde_Kolab_FreeBusy_Resource
  • Horde_Kolab_FreeBusy_Resource_Event
  • Horde_Kolab_FreeBusy_User
  • Horde_Kolab_FreeBusy_UserDb
  • Horde_Kolab_FreeBusy_UserDb_User
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * This provider fetches the data from a remote server by passing it through.
  4:  *
  5:  * PHP version 5
  6:  *
  7:  * @category Kolab
  8:  * @package  Kolab_FreeBusy
  9:  * @author   Gunnar Wrobel <wrobel@pardus.de>
 10:  * @license  http://www.horde.org/licenses/lgpl21 LGPL 2.1
 11:  * @link     http://pear.horde.org/index.php?package=Kolab_FreeBusy
 12:  */
 13: 
 14: /**
 15:  * This provider fetches the data from a remote server by passing it through.
 16:  *
 17:  * Copyright 2011-2012 Horde LLC (http://www.horde.org/)
 18:  *
 19:  * See the enclosed file COPYING for license information (LGPL). If
 20:  * you did not receive this file, see
 21:  * http://www.horde.org/licenses/lgpl21.
 22:  *
 23:  * @category Kolab
 24:  * @package  Kolab_FreeBusy
 25:  * @author   Gunnar Wrobel <wrobel@pardus.de>
 26:  * @license  http://www.horde.org/licenses/lgpl21 LGPL 2.1
 27:  * @link     http://pear.horde.org/index.php?package=Kolab_FreeBusy
 28:  */
 29: class Horde_Kolab_FreeBusy_Provider_Remote_PassThrough
 30: extends Horde_Kolab_FreeBusy_Provider_Remote
 31: {
 32:     /**
 33:      * HTTP client
 34:      *
 35:      * @var Horde_Http_Client
 36:      */
 37:     private $_client;
 38: 
 39:     /**
 40:      * The owner of the data.
 41:      *
 42:      * @var Horde_Kolab_FreeBusy_Owner
 43:      */
 44:     private $_owner;
 45: 
 46:     /**
 47:      * The user accessing the data.
 48:      *
 49:      * @var Horde_Kolab_FreeBusy_User
 50:      */
 51:     private $_user;
 52: 
 53:     /**
 54:      * Constructor
 55:      *
 56:      * @param Horde_Kolab_FreeBusy_Owner $owner   The owner of the data.
 57:      * @param Horde_Controller_Request   $request The current request.
 58:      * @param Horde_Kolab_FreeBusy_User  $user    The user accessing the data.
 59:      * @param Horde_Http_Client          $client  An HTTP client.
 60:      */
 61:     public function __construct(
 62:         Horde_Kolab_FreeBusy_Owner $owner,
 63:         Horde_Controller_Request $request,
 64:         Horde_Kolab_FreeBusy_User $user,
 65:         Horde_Http_Client $client
 66:     )
 67:     {
 68:         $this->_user   = $user;
 69:         $this->_client = $client;
 70:         parent::__construct($owner, $request);
 71:     }
 72: 
 73:     /**
 74:      * Trigger a resource.
 75:      *
 76:      * @param Horde_Controller_Response  $response The response handler.
 77:      * @param array                      $params   Additional parameters.
 78:      *
 79:      * @return NULL
 80:      */
 81:     public function trigger(
 82:         Horde_Controller_Response $response, $params = array()
 83:     )
 84:     {
 85:         $this->_passThrough($response);
 86:     }
 87: 
 88:     /**
 89:      * Fetch data for an owner.
 90:      *
 91:      * @param Horde_Controller_Response  $response The response handler.
 92:      * @param array                      $params   Additional parameters.
 93:      *
 94:      * @return NULL
 95:      */
 96:     public function fetch(
 97:         Horde_Controller_Response $response,
 98:         $params = array()
 99:     )
100:     {
101:         $this->_passThrough($response);
102:     }
103: 
104:     /**
105:      * Fetch remote data.
106:      *
107:      * @param Horde_Controller_Response  $response The response handler.
108:      *
109:      * @return NULL
110:      */
111:     public function _passThrough(Horde_Controller_Response $response)
112:     {
113:         $url = $this->getUrlWithCredentials(
114:             $this->_user->getPrimaryId(),
115:             $this->_user->getPassword()
116:         );
117:         $origin = $this->_client->get($url);
118:         if ($origin->code !== 200) {
119:             $url = $this->getUrlWithCredentials(
120:                 $this->_user, 'XXX'
121:             );
122:             throw new Horde_Kolab_FreeBusy_Exception_Unauthorized(
123:                 sprintf('Unable to read free/busy information from %s', $url)
124:             );
125:         }
126:         $response->setHeader('X-Redirect-To', $url);
127:         $response->setBody($origin->getStream());
128:     }
129: 
130:     /**
131:      * Delete data of an owner.
132:      *
133:      * @param Horde_Controller_Response  $response The response handler.
134:      * @param array                      $params   Additional parameters.
135:      *
136:      * @return NULL
137:      */
138:     public function delete(
139:         Horde_Controller_Response $response,
140:         $params = array()
141:     )
142:     {
143:         throw new Horde_Kolab_FreeBusy_Exception(
144:             'Action "regenerate" not supported for remote servers!'
145:         );
146:     }
147: 
148:     /**
149:      * Regenerate all data accessible to the current user.
150:      *
151:      * @param Horde_Controller_Response  $response The response handler.
152:      * @param array                      $params   Additional parameters.
153:      *
154:      * @return NULL
155:      */
156:     public function regenerate(
157:         Horde_Controller_Response $response,
158:         $params = array()
159:     )
160:     {
161:         throw new Horde_Kolab_FreeBusy_Exception(
162:             'Action "regenerate" not supported for remote servers!'
163:         );
164:     }
165: }
166: 
API documentation generated by ApiGen