Methods summary
public
|
#
__construct( string $app, string $user, Horde_Perms_Base $perms, Horde_Group_Base $groups )
Parameters
- $app
- <p>The application that the shares belong
to.</p>
- $user
- The current user.
- $perms
- The permissions object.
- $groups
- The Horde_Group driver.
See
Overrides
|
public
|
#
setTable( mixed $table )
Set the SQL table name to use for the current scope's share storage.
Set the SQL table name to use for the current scope's share storage.
Var
string $table The table name
|
public
string
|
#
getTable( )
Get storage table
Returns
string
|
public
|
|
public
Horde_Db_Adapter
|
|
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.
Throws
Overrides
|
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">'attribtues'</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.
<span class="php-quote">'parent'</span> Start at this share in the hierarchy. Either share_id <span class="php-keyword1">or</span>
Horde_Share_Object
<span class="php-quote">'all_levels'</span> <span class="php-keyword1">List</span> all levels <span class="php-keyword1">or</span> just the direct children of parent?</pre>
Returns
array The shares the user has access to.
Throws
Overrides
|
public
array
|
#
listOwners( integer $perm = Horde_Perms::SHOW, mixed $parent = null, boolean $allLevels = true, integer $from = 0, integer $count = 0 )
Return a list of users who have shares with the given permissions
for the current user.
Return a list of users who have shares with the given permissions
for the current user.
Parameters
- $perm
- The level of permissions required.
- $parent
- <p>The parent share to start looking in.
(Horde_Share_Object, share_id, or null)</p>
- $allLevels
- <p>Return all levels, or just the direct
children of $parent? Defaults to all levels.</p>
- $from
- The user to start listing at.
- $count
- The number of users to return.
Returns
array List of users.
Throws
|
public
integer
|
#
countOwners( integer $perm = Horde_Perms::SHOW, mixed $parent = null, boolean $allLevels = true )
Count the number of users who have shares with the given permissions
for the current user.
Count the number of users who have shares with the given permissions
for the current user.
Parameters
- $perm
- The level of permissions required.
- $parent
- <p>The parent share to start looking in.
(Horde_Share_Object, share_id, or null).</p>
- $allLevels
- <p>Return all levels, or just the direct
children of $parent?</p>
Returns
integer Number of users.
Throws
|
public
Horde_Share_Object
|
#
getParent( Horde_Share_Object $child )
Returns a share's direct parent object.
Returns a share's direct parent object.
Parameters
- $child
- The share to get parent for.
Returns
|
public
array
|
#
listSystemShares( )
Returns an array of all system shares.
Returns an array of all system shares.
Returns
array All system shares.
Throws
Overrides
|
public
integer
|
#
countShares( string $userid, integer $perm = Horde_Perms::SHOW, mixed $attributes = null, mixed $parent = null, boolean $allLevels = true )
Returns the count of all shares that $userid has access to.
Returns the count of all 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>
- $parent
- <p>The share to start searching from
(Horde_Share_Object, share_id, or null)</p>
- $allLevels
- <p>Return all levels, or just the direct
children of $parent?</p>
Returns
integer Number of shares the user has access to.
Throws
Overrides
|
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
Overrides
|
public
string
|
#
getShareCriteria( string $userid, integer $perm = Horde_Perms::SHOW, mixed $attributes = null, mixed $parent = null, boolean $allLevels = true )
Returns an array of criteria for querying shares.
Returns an array of criteria for querying shares.
Parameters
- $userid
- The userid of the user to check access for.
- $perm
- <p>The level of permissions required. Set to null
to skip permission filtering.</p>
- $attributes
- <p>Restrict the shares returned to those who
have these attribute values.</p>
- $parent
- <p>The share to start searching in.
(A Horde_Share_Object, share_id or null)</p>
- $allLevels
- <p>Return all levels, or just the direct
children of $parent? Defaults to all levels.</p>
Returns
string The criteria string for fetching this user's shares.
Throws
|
public
|
#
toDriverCharset( array $data )
Utility function to convert TO the SQL server's charset.
Utility function to convert TO the SQL server's charset.
Parameters
- $data
- Data to be converted.
See
Horde_Share#toDriverCharset
Overrides
|