Class Horde_Share

Description

Horde_Share:: provides an interface to all shares a user might have. Its methods take care of any site-specific restrictions configured in in the application's prefs.php and conf.php files.

$Horde: framework/Share/Share.php,v 1.111.2.33 2009/04/20 21:09:02 jan Exp $

Copyright 2002-2009 The Horde Project (http://www.horde.org/) Copyright 2002-2007 Infoteck Internet <webmaster@infoteck.qc.ca>

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

Located in /Share/Share.php (line 23)


	
			
Direct descendents
Class Description
 class Horde_Share_datatree Horde_Share_datatree:: provides the datatree backend for the horde share driver.
 class Horde_Share_kolab Horde_Share_kolab:: provides the kolab backend for the horde share driver.
 class Horde_Share_sql
Variable Summary
 string $_app
 array $_cache
 array $_listcache
 mixed $_root
 array $_shareMap
 array $_sortList
Method Summary
 static Horde_Share &singleton (string $app, [string $driver = null])
 Horde_Share Horde_Share (string $app)
 void addShare ( &$share, Horde_Share_Object $share)
 integer countShares (string $userid, [integer $perm = PERMS_SHOW], [mixed $attributes = null])
 boolean exists (string $share)
 Identity &getIdentityByShare ( &$share, mixed $share)
 mixed getPermissions (mixed $share, [string $user = null])
 Horde_Share_Object &getShare (string $name)
 array &getShares (array $cids)
 array listAllShares ()
 array &listShares (string $userid, [integer $perm = PERMS_SHOW], [mixed $attributes = null], [ $from = 0], [ $count = 0], [ $sort_by = null], [ $direction = 0])
 Horde_Share_Object &newShare (string $name)
 void removeShare ( &$share, Horde_Share_Object $share)
 void shutdown ()
 void _sortShares ( &$a,  &$b)
 array __sleep ()
 void __wakeup ()
Variables
string $_app (line 30)

The application we're managing shares for.

array $_cache = array() (line 45)

A cache of all shares that have been retrieved, so we don't hit the backend again and again for them.

array $_listcache = array() (line 59)

Cache used for listShares().

mixed $_root = null (line 37)

The root of the Share tree.

array $_shareMap = array() (line 52)

Id-name-map of already cached share objects.

array $_sortList (line 67)

A list of objects that we're currently sorting, for reference during the sorting algorithm.

Methods
static singleton (line 87)

Attempts to return a reference to a concrete Horde_Share instance.

It will only create a new instance if no Horde_Share instance currently exists.

This method must be invoked as:

  1. $var &Horde_Share::singleton($app$driver);

  • return: The concrete Share reference, or false on an error.
static Horde_Share &singleton (string $app, [string $driver = null])
  • string $app: The application that the shares relates to.
  • string $driver: Type of concrete Share subclass to return, based on storage driver ($driver). The code is dynamically included.
Constructor Horde_Share (line 136)

Constructor.

Horde_Share Horde_Share (string $app)
  • string $app: The application that the shares belong to.
addShare (line 375)

Adds a share to the shares system.

The share must first be created with Horde_Share::newShare(), and have any initial details added to it, before this function is called.

void addShare ( &$share, Horde_Share_Object $share)
countShares (line 343)

Returns the number of shares that $userid has access to.

  • return: The number of shares
  • since: Horde 3.2
integer countShares (string $userid, [integer $perm = PERMS_SHOW], [mixed $attributes = null])
  • string $userid: The userid of the user to check access for.
  • integer $perm: The level of permissions required.
  • mixed $attributes: Restrict the shares counted to those matching $attributes. An array of attribute/values pairs or a share owner username.

Redefined in descendants as:
exists (line 439)

Checks if a share exists in the system.

  • return: True if the share exists.
boolean exists (string $share)
  • string $share: The share to check.
getIdentityByShare (line 491)

Returns the Identity for a particular share owner.

  • return: An Identity instance.
  • deprecated:
Identity &getIdentityByShare ( &$share, mixed $share)
  • mixed $share: The share to fetch the Identity for - either the string name, or the Horde_Share_Object object.
  • &$share
getPermissions (line 462)

Finds out what rights the given user has to this object.

  • return: A bitmask of permissions, a permission value, or an array of permission values the user has, depending on the permission type and whether the permission value is ambiguous. False if there is no such permsission.
  • see: Perms::getPermissions
mixed getPermissions (mixed $share, [string $user = null])
  • mixed $share: The share that should be checked for the users permissions.
  • string $user: The user to check for.
getShare (line 182)

Returns a Horde_Share_Object object corresponding to the given share name, with the details retrieved appropriately.

  • return: The requested share.
Horde_Share_Object &getShare (string $name)
  • string $name: The name of the share to retrieve.

Redefined in descendants as:
getShareById (line 207)

Returns a Horde_Share_Object object corresponding to the given unique ID, with the details retrieved appropriately.

  • return: The requested share.
Horde_Share_Object &getShareById (string $cid)
  • string $cid: The id of the share to retrieve.

Redefined in descendants as:
getShares (line 231)

Returns an array of Horde_Share_Object objects corresponding to the given set of unique IDs, with the details retrieved appropriately.

  • return: The requested shares.
array &getShares (array $cids)
  • array $cids: The array of ids to retrieve.

Redefined in descendants as:
listAllShares (line 269)

Lists *all* shares for the current app/share, regardless of permissions.

This is for admin functionality and scripting tools, and shouldn't be called from user-level code!

  • return: All shares for the current app/share.
array listAllShares ()

Redefined in descendants as:
listShares (line 295)

Returns an array of all shares that $userid has access to.

  • return: The shares the user has access to.
array &listShares (string $userid, [integer $perm = PERMS_SHOW], [mixed $attributes = null], [ $from = 0], [ $count = 0], [ $sort_by = null], [ $direction = 0])
  • string $userid: The userid of the user to check access for.
  • integer $perm: The level of permissions required.
  • mixed $attributes: Restrict the shares counted to those matching $attributes. An array of attribute/values pairs or a share owner username.
  • $from
  • $count
  • $sort_by
  • $direction

Redefined in descendants as:
newShare (line 355)

Returns a new share object.

  • return: A new share object.
Horde_Share_Object &newShare (string $name)
  • string $name: The share's name.

Redefined in descendants as:
removeShare (line 409)

Removes a share from the shares system permanently.

void removeShare ( &$share, Horde_Share_Object $share)

Redefined in descendants as:
shutdown (line 166)

Stores the object in the session cache.

void shutdown ()
_sortShares (line 516)

Utility function to be used with uasort() for sorting arrays of Horde_Share objects.

Example:

  1.  uasort($listarray('Horde_Share''_sortShares'));

  • access: protected
void _sortShares ( &$a,  &$b)
  • &$a
  • &$b
__sleep (line 155)

Returns the properties that need to be serialized.

  • return: List of serializable properties.
array __sleep ()

Redefined in descendants as:
__wakeup (line 145)

Initializes the object.

void __wakeup ()

Redefined in descendants as:

Documentation generated on Sun, 30 Jan 2011 05:21:19 +0000 by phpDocumentor 1.4.3