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 class represents a Kolab resource owner.
  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 class represents a Kolab resource owner.
 16:  *
 17:  * Copyright 2010-2012 Horde LLC (http://www.horde.org/)
 18:  *
 19:  * See the enclosed file COPYING for license information (LGPL). If you did not
 20:  * 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_Owner_Kolab
 30: extends Horde_Kolab_FreeBusy_UserDb_User_Kolab
 31: implements Horde_Kolab_FreeBusy_Owner
 32: {
 33:     /**
 34:      * The owner information.
 35:      *
 36:      * @var string
 37:      */
 38:     private $_owner;
 39: 
 40:     /**
 41:      * Additional parameters.
 42:      *
 43:      * @var params
 44:      */
 45:     private $_params;
 46: 
 47:     /**
 48:      * The owner data retrieved from the user database.
 49:      *
 50:      * @var array
 51:      */
 52:     private $_owner_data;
 53: 
 54:     /**
 55:      * Is the user locally known?
 56:      *
 57:      * @var boolean
 58:      */
 59:     private $_known;
 60: 
 61:     /**
 62:      * Constructor.
 63:      *
 64:      * @param string                       $owner  The owner name.
 65:      * @param Horde_Kolab_Server_Composite $db     The connection to the user
 66:      *                                             database.
 67:      * @param array                        $params Additional parameters.
 68:      * <pre>
 69:      *  - user (optional):   A Horde_Kolab_FreeBusy_User object, representing
 70:      *                       the user currently accessing the system. Will
 71:      *                       be used to determine the domain of domain-less
 72:      *                       owners.
 73:      *  - domain (optional): A domain that should be appended to domain-less
 74:      *                       owners.
 75:      * </pre>
 76:      */
 77:     public function __construct(
 78:         $owner, Horde_Kolab_Server_Composite $db, $params = array()
 79:     ) {
 80:         $this->_owner  = $owner;
 81:         $this->_params = $params;
 82:         parent::__construct($db);
 83:     }
 84: 
 85:     /**
 86:      * Return the original owner parameter.
 87:      *
 88:      * @return string The original owner parameter.
 89:      */
 90:     public function getOwner()
 91:     {
 92:         return $this->_owner;
 93:     }
 94: 
 95:     /**
 96:      * Is the user known in the user database?
 97:      *
 98:      * @return boolean True if the user data is present.
 99:      */
100:     public function isKnown()
101:     {
102:         if ($this->_known === null) {
103:             try {
104:                 $this->getUserDbUser();
105:                 $this->_known = true;
106:             } catch (Horde_Kolab_FreeBusy_Exception $e) {
107:                 $this->_known = false;
108:             }
109:         }
110:         return $this->_known;
111:     }
112: 
113:     /**
114:      * Fetch the user data from the user db.
115:      *
116:      * @return NULL
117:      */
118:     protected function fetchUserDbUser()
119:     {
120:         try {
121:             return $this->fetchOwner($this->_owner);
122:         } catch (Horde_Kolab_FreeBusy_Exception $e) {
123:             if (isset($this->_params['user'])) {
124:                 $domain = $this->_params['user']->getDomain();
125:             } else if (isset($this->_params['domain'])) {
126:                 $domain = $this->_params['domain'];
127:             } else {
128:                 $domain = false;
129:             }
130:             if (!empty($domain)) {
131:                 try {
132:                     return $this->fetchUserByPrimaryId(
133:                         $this->_owner . '@' . $domain
134:                     );
135:                 } catch (Horde_Kolab_FreeBusy_Exception $f) {
136:                 }
137:             }
138:             throw $e;
139:         }
140:     }
141: }
API documentation generated by ApiGen