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 provides the credentials for the user currently accessing
  4:  * the export system.
  5:  *
  6:  * PHP version 5
  7:  *
  8:  * @category Kolab
  9:  * @package  Kolab_FreeBusy
 10:  * @author   Gunnar Wrobel <wrobel@pardus.de>
 11:  * @license  http://www.horde.org/licenses/lgpl21 LGPL 2.1
 12:  * @link     http://pear.horde.org/index.php?package=Kolab_FreeBusy
 13:  */
 14: 
 15: /**
 16:  * This class provides the credentials for the user currently accessing
 17:  * the export system.
 18:  *
 19:  * Copyright 2007-2012 Horde LLC (http://www.horde.org/)
 20:  *
 21:  * See the enclosed file COPYING for license information (LGPL). If you did not
 22:  * receive this file, see
 23:  * http://www.horde.org/licenses/lgpl21.
 24:  *
 25:  * @category Kolab
 26:  * @package  Kolab_FreeBusy
 27:  * @author   Gunnar Wrobel <wrobel@pardus.de>
 28:  * @license  http://www.horde.org/licenses/lgpl21 LGPL 2.1
 29:  * @link     http://pear.horde.org/index.php?package=Kolab_FreeBusy
 30:  */
 31: class Horde_Kolab_FreeBusy_Params_User
 32: {
 33:     /**
 34:      * The request.
 35:      *
 36:      * @var Horde_Controller_Request
 37:      */
 38:     private $_request;
 39: 
 40:     /**
 41:      * The user id.
 42:      *
 43:      * @var string
 44:      */
 45:     private $_user;
 46: 
 47:     /**
 48:      * The user password.
 49:      *
 50:      * @var string
 51:      */
 52:     private $_pass;
 53: 
 54:     /**
 55:      * Constructor.
 56:      *
 57:      * @param Horde_Controller_Request $request The request.
 58:      */
 59:     public function __construct(Horde_Controller_Request $request)
 60:     {
 61:         $this->_request = $request;
 62:         $this->_extractUserAndPassword();
 63:     }
 64: 
 65:     /**
 66:      * Return the user credentials extracted from the request.
 67:      *
 68:      * @return array The user credentials.
 69:      */
 70:     public function getCredentials()
 71:     {
 72:         return array($this->_user, $this->_pass);
 73:     }
 74: 
 75:     /**
 76:      * Return the user id.
 77:      *
 78:      * @return array The user id.
 79:      */
 80:     public function getUser()
 81:     {
 82:         return $this->_user;
 83:     }
 84: 
 85:     /**
 86:      * Extract user name and password from the request.
 87:      *
 88:      * @return NULL
 89:      */
 90:     private function _extractUserAndPassword()
 91:     {
 92:         $vars = $this->_request->getServerVars();
 93:         $this->_user = isset($vars['PHP_AUTH_USER']) ? $vars['PHP_AUTH_USER'] : null;
 94:         $this->_pass = isset($vars['PHP_AUTH_PW']) ? $vars['PHP_AUTH_PW'] : null;
 95: 
 96:         // This part allows you to use the PHP scripts with CGI rather than as
 97:         // an apache module. This will of course slow down things but on the
 98:         // other hand it allows you to reduce the memory footprint of the 
 99:         // apache server. The default is to use PHP as a module and the CGI 
100:         // version requires specific Apache configuration.
101:         //
102:         // http://www.besthostratings.com/articles/http-auth-php-cgi.html
103:         //
104:         // The line you need to add to your configuration of the /freebusy 
105:         // location of your server looks like this:
106:         //
107:         //    RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
108:         //
109:         // The complete section will probably look like this then:
110:         //
111:         //  <IfModule mod_rewrite.c>
112:         //    RewriteEngine On
113:         //    # FreeBusy list handling
114:         //    RewriteBase /freebusy
115:         //    RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
116:         //    RewriteRule ^([^/]+)\.ifb       freebusy.php?uid=$1           [L]
117:         //    RewriteRule ^([^/]+)\.vfb       freebusy.php?uid=$1           [L]
118:         //    RewriteRule ^([^/]+)\.xfb       freebusy.php?uid=$1&extended=1        [L]
119:         //    RewriteRule ^trigger/(.+)\.pfb  pfb.php?folder=$1&cache=0             [L]
120:         //    RewriteRule ^(.+)\.pfb          pfb.php?folder=$1&cache=1             [L]
121:         //    RewriteRule ^(.+)\.pxfb         pfb.php?folder=$1&cache=1&extended=1  [L]
122:         //  </IfModule>
123:         if (empty($this->_user)) {
124:             $remote_user = isset($vars['REDIRECT_REDIRECT_REMOTE_USER']) ? $vars['REDIRECT_REDIRECT_REMOTE_USER'] : null;
125:             if (!empty($remote_user)) {
126:                 $a = base64_decode(substr($remote_user, 6));
127:                 if (strlen($a) > 0 && strpos($a, ':') !== false) {
128:                     list($this->_user, $this->_pass) = explode(':', $a, 2);
129:                 }
130:             } else {
131:                 $this->_user = '';
132:             }
133:         }
134:     }
135: }
API documentation generated by ApiGen