$_app
$_app : string
The application we're managing shares for.
Base class for all Horde_Share drivers.
Copyright 2002-2017 Horde LLC (http://www.horde.org/) Copyright 2002-2007 Infoteck Internet webmaster@infoteck.qc.ca
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) : integer
Returns the number of 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. |
The number of shares
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.
_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(integer $id) : \Horde_Share_Object_sql
Returns a Horde_Share_Object 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.
_newShare(string $name) : \Horde_Share_Object
Returns a new share object.
string | $name | The share's name. |
A new share object
_addShare(\Horde_Share_Object $share)
Adds a share to the shares system.
The share must first be created with Horde_Share_sql::_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. |