Methods summary
public
|
#
__construct( string $app, string $user, Horde_Perms_Base $perms, Horde_Group_Base $groups )
Constructor.
Parameters
- $app
- <p>The application that the shares belong
to.</p>
- $user
- The current user.
- $perms
- The permissions object.
- $groups
- The Horde_Group driver.
|
public
|
#
setLogger( Horde_Log_Logger $logger )
Set a logger object.
Inject
Var
Horde_Log_Logger $logger The logger object.
|
public
|
|
public
|
|
public
string
|
#
getApp( )
Returns the application we're managing shares for.
Returns the application we're managing shares for.
Returns
string The application this share belongs to.
|
public
Horde_Share_Object
|
#
getShare( string $name )
Returns a Horde_Share_Object object corresponding to the given share
name, with the details retrieved appropriately.
Returns a Horde_Share_Object object corresponding to the given share
name, with the details retrieved appropriately.
Parameters
- $name
- The name of the share to retrieve.
Returns
|
public
Horde_Share_Object
|
#
getShareById( string $cid )
Returns a Horde_Share_Object object corresponding to the given unique
ID, with the details retrieved appropriately.
Returns a Horde_Share_Object object corresponding to the given unique
ID, with the details retrieved appropriately.
Parameters
- $cid
- The id of the share to retrieve.
Returns
|
public
array
|
#
getShares( array $cids )
Returns an array of Horde_Share_Object objects corresponding to the
given set of unique IDs, with the details retrieved appropriately.
Returns an array of Horde_Share_Object objects corresponding to the
given set of unique IDs, with the details retrieved appropriately.
Parameters
- $cids
- The array of ids to retrieve.
Returns
array The requested shares.
|
public
array
|
#
listAllShares( )
Lists all shares for the current app/share, regardless of
permissions.
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!
Returns
array All shares for the current app/share.
|
public
array
|
#
listShares( string $userid, array $params = array() )
Returns an array of all shares that $userid has access to.
Returns an array of all shares that $userid has access to.
Parameters
- $userid
- <p>The userid of the user to check access for. An
empty value for the userid will only return shares
with guest access.</p>
- $params
- Additional parameters for the search.
<pre><span class="php-quote">'perm'</span> <span class="php-keyword1">Require</span> this level of permissions. Horde_Perms <span class="php-keyword2">constant</span>.
<span class="php-quote">'attributes'</span> Restrict shares to these attributes. A <span class="php-keyword2">hash</span> <span class="php-keyword1">or</span> username.
<span class="php-quote">'from'</span> Offset. Start at this share
<span class="php-quote">'count'</span> Limit. Only <span class="php-keyword1">return</span> this many.
<span class="php-quote">'sort_by'</span> <span class="php-keyword2">Sort</span> by attribute.
<span class="php-quote">'direction'</span> <span class="php-keyword2">Sort</span> by direction.</pre>
Returns
array The shares the user has access to.
|
public
array
|
#
listSystemShares( )
Returns an array of all system shares.
Returns an array of all system shares.
Returns
array All system shares.
|
public
integer
|
#
countShares( string $userid, integer $perm = Horde_Perms::SHOW, mixed $attributes = null )
Returns the number of shares that $userid has access to.
Returns the number of shares that $userid has access to.
Parameters
- $userid
- The userid of the user to check access for.
- $perm
- The level of permissions required.
- $attributes
- <p>Restrict the shares counted to those
matching $attributes. An array of
attribute/values pairs or a share owner
username.</p>
Returns
integer The number of shares
|
public
Horde_Share_Object
|
#
newShare( string $owner, string $share_name = '', string $name_attribute = '' )
Returns a new share object.
Returns a new share object.
Parameters
- $owner
- The share owner name.
- $share_name
- The share's name.
- $name_attribute
- The name displayed to the user.
Returns
Throws
|
public
|
#
addShare( Horde_Share_Object $share )
Adds a share to the shares system.
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.
Parameters
- $share
- The new share object.
Throws
|
public
|
#
renameShare( Horde_Share_Object $share, string $name )
Renames a share in the shares system.
Renames a share in the shares system.
Parameters
- $share
- The share to rename.
- $name
- The share's new name.
Throws
|
public
|
#
removeShare( Horde_Share_Object $share )
Removes a share from the shares system permanently.
Removes a share from the shares system permanently.
Parameters
- $share
- The share to remove.
Throws
|
public
boolean
|
#
exists( string $share )
Checks if a share name exists in the system.
Checks if a share name exists in the system.
Parameters
- $share
- The share name to check.
Returns
boolean True if the share exists.
|
public
boolean
|
#
idExists( integer $id )
Check that a share id exists in the system.
Check that a share id exists in the system.
Parameters
Returns
boolean True if the share exists.
|
public
mixed
|
#
getPermissions( mixed $share, string $user = null )
Finds out what rights the given user has to this object.
Finds out what rights the given user has to this object.
Parameters
- $share
- <p>The share that should be checked for the users
permissions.</p>
- $user
- The user to check for.
Returns
mixed 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
Horde_Perms::getPermissions
|
public
|
#
setShareClass( mixed $classname )
Set the class type to use for creating share objects.
Set the class type to use for creating share objects.
Var
string $classname The classname to use.
|
public
Horde_Perms_Base
|
#
getPermsObject( )
Getter for Horde_Perms object
Getter for Horde_Perms object
Returns
Horde_Perms_Base
|
public
|
#
toDriverCharset( array $data )
Convert TO the storage driver's charset. Individual share objects should
implement this method if needed.
Convert TO the storage driver's charset. Individual share objects should
implement this method if needed.
Parameters
- $data
- Data to be converted.
|
public
|
#
addCallback( string $type, array $callback )
Add a callback to the collection
Add a callback to the collection
Parameters
|
public
array
|
#
getListCache( )
Returns the share's list cache.
Returns the share's list cache.
Returns
array
|
public
|
|
public
|
#
resetCache( )
Resets the internal caches.
Resets the internal caches.
|
public
mixed
|
#
runCallback( string $type, array $params )
Give public access to call the share callbacks. Needed to run the
callbacks from the Horde_Share_Object objects.
Give public access to call the share callbacks. Needed to run the
callbacks from the Horde_Share_Object objects.
Parameters
- $type
- The callback to run
- $params
- The parameters to pass to the callback.
Returns
mixed
|
public
|
#
expireListCache( )
Expire the current list cache. This would be needed anytime a share is
either added, deleted, had a change in owner, parent, or perms.
Expire the current list cache. This would be needed anytime a share is
either added, deleted, had a change in owner, parent, or perms.
|