VERSION
VERSION
Horde_Share_Kolab:: provides the Kolab backend for the horde share driver.
Copyright 2004-2017 Horde LLC (http://www.horde.org/)
See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
$_callbacks : array
Configured callbacks. We currently support: <pre> add - Called immediately before a new share is added. Receives the share object as a parameter.
modify - Called immediately before a share object's changes are saved to storage. Receives the share object as a parameter. remove - Called immediately before a share is removed from storage. Receives the share object as a parameter. list - Called immediately after a list of shares is received from storage. Passed the userid, share list, and any parameters passed to the listShare call. Should return the (possibly modified) share list. @see listShares() for more info.
__construct(string $app, string $user, \Horde_Perms_Base $perms, \Horde_Group_Base $groups)
Constructor.
string | $app | The application that the shares belong to |
string | $user | The current user |
\Horde_Perms_Base | $perms | The permissions object |
\Horde_Group_Base | $groups | The Horde_Group driver. |
initShareObject(\Horde_Share_Object $object)
(Re)connects the share object to this share driver.
\Horde_Share_Object | $object |
getShare(string $name) : \Horde_Share_Object
Returns a Horde_Share_Object object corresponding to the given share name, with the details retrieved appropriately.
string | $name | The name of the share to retrieve. |
The requested share.
getShareById(string $cid) : \Horde_Share_Object
Returns a Horde_Share_Object object corresponding to the given unique ID, with the details retrieved appropriately.
string | $cid | The id of the share to retrieve. |
The requested share.
listShares(string $userid, array $params = array()) : array
Returns an array of all shares that $userid has access to.
string | $userid | The userid of the user to check access for. An empty value for the userid will only return shares with guest access. |
array | $params | Additional parameters for the search. 'perm' Require this level of permissions. Horde_Perms constant. 'attributes' Restrict shares to these attributes. A hash or username. 'from' Offset. Start at this share 'count' Limit. Only return this many. 'sort_by' Sort by attribute. 'direction' Sort by direction. |
The shares the user has access to.
countShares(string $userid, integer $perm = \Horde_Perms::SHOW, mixed $attributes = null, mixed $parent = null, boolean $allLevels = true) : integer
Returns the count of all shares that $userid has access to.
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. |
mixed | $parent | The share to start searching from (Horde_Share_Object, share_id, or null) |
boolean | $allLevels | Return all levels, or just the direct children of $parent? |
Number of shares the user has access to.
newShare(string $owner, string $share_name = '', string $name_attribute = '') : \Horde_Share_Object
Returns a new share object.
string | $owner | The share owner name. |
string | $share_name | The share's name. |
string | $name_attribute | The name displayed to the user. |
A new share object.
addShare(\Horde_Share_Object $share)
Adds a share to the shares system.
The share must first be created with newShare(), and have any initial details added to it, before this function is called.
\Horde_Share_Object | $share | The new share object. |
fromHash(array $hash) : \Horde_Share_Object
Adds a share created from a hash.
array | $hash | A hash like exported from Horde_Share_Object#toHash(). |
A new share object.
renameShare(\Horde_Share_Object $share, string $name)
Renames a share in the shares system.
\Horde_Share_Object | $share | The share to rename. |
string | $name | The share's new name. |
removeShare(\Horde_Share_Object $share)
Removes a share from the shares system permanently.
\Horde_Share_Object | $share | The share to remove. |
getPermissions(mixed $share, string $user = null) : mixed
Finds out what rights the given user has to this object.
mixed | $share | The share that should be checked for the users permissions. |
string | $user | The user to check for. |
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.
constructId(string $owner, string $name, string $prefix = null) : string
Construct the ID from the owner name and the folder subpath.
string | $owner | The share owner. |
string | $name | The name of the folder without the namespace prefix. |
string | $prefix | The namespace prefix. |
The encoded ID.
constructFolderName(string $owner, string $subpath, string $prefix = null) : string
Construct the Kolab storage folder name based on the share name and owner attributes.
string | $owner | The owner of the share. |
string | $subpath | The folder subpath. |
string | $prefix | The namespace prefix. |
The folder name for the Kolab backend.
_getShare(string $name) : \Horde_Share_Object
Returns a Horde_Share_Object_Kolab object corresponding to the given share name, with the details retrieved appropriately.
string | $name | The name of the share to retrieve. |
The requested share.
_getShareById(integer $id) : \Horde_Share_Object_sql
Returns a Horde_Share_Object_sql object corresponding to the given unique ID, with the details retrieved appropriately.
integer | $id | The id of the share to retrieve. |
Horde_Exception_NotFound
The requested share.
_listAllShares() : array
Lists *all* shares for the current app/share, regardless of permissions.
For the Kolab backend this cannot work in the same way as for the SQL based backend. Permissions are always handled by the backend automatically (IMAP ACLs) and cannot be disabled.
listAllShares() is apparently used during command line scipts where it represents administrator access. This is possible on Kolab by using the "manager" user. In that case a standard listShares() authenticated as "manager" should be sufficient.
All shares for the current app/share.
_addShare(\Horde_Share_Object $share)
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.
\Horde_Share_Object | $share | The new share object. |
_renameShare(\Horde_Share_Object $share, string $name)
Renames a share in the shares system.
\Horde_Share_Object | $share | The share to rename. |
string | $name | The share's new name. |
_removeShare(\Horde_Share_Object $share)
Removes a share from the shares system permanently.
\Horde_Share_Object | $share | The share to remove. |
_createObject(string $id, array $data = array()) : \Horde_Share_Object
Returns a Horde_Share_Object_Kolab object corresponding to the given share name, with the details retrieved appropriately.
string | $id | The id of the share to retrieve. |
array | $data | The share data. |
The requested share.