PHP Class Horde_Share_Sqlng, horde

Inheritance: extends Horde_Share_Sql
Mostra file Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_availablePermissions This is necessary to unset certain permission when updating existing share objects.
$_shareObject string The Horde_Share_Object subclass to instantiate objects as

Public Methods

Method Description
__construct ( $app, $user, Horde_Perms_Base $perms, Horde_Group_Base $groups )
convertBitmaskToArray ( $perm ) : array Converts a bit mask number to a bit mask array.
countOwners ( integer $perm = Horde_Perms::SHOW, mixed $parent = null, boolean $allLevels = true ) : integer Count the number of users who have shares with the given permissions for the current user.
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.
initShareObject ( Horde_Share_Object $object ) Passes the available permissions to the share object.
listOwners ( integer $perm = Horde_Perms::SHOW, mixed $parent = null, boolean $allLevels = true, integer $from, integer $count ) : array Return a list of users who have shares with the given permissions for the current user.
listShares ( string $userid, array $params = [] ) : array Returns an array of all shares that $userid has access to.
listSystemShares ( ) : array Returns an array of all system shares.

Protected Methods

Method Description
_buildPermsFromRow ( array $row ) : integer Builds a permission bit mask from all columns in a data row prefixed with "perm_".
_getPermsCriteria ( string $base, array $perms ) : string Builds an ANDed criteria snippet for a set or permissions.
_getShareCriteria ( string $userid, array $perms, array $attributes, array $shareids = null, $parent = null, $allLevels = true ) : string Returns a criteria statement for querying shares.
_getSharePerms ( array &$data ) Converts the permissions from the database table format into the Horde_Share format.
_getUserAndGroupShares ( string $userid, array $perms ) : array Returns the records and share IDs from the user and group tables that match the search criteria.

Method Details

__construct() public method

See also: Horde_Share_Base::__construct()
public __construct ( $app, $user, Horde_Perms_Base $perms, Horde_Group_Base $groups )
$perms Horde_Perms_Base
$groups Horde_Group_Base

_buildPermsFromRow() protected method

Builds a permission bit mask from all columns in a data row prefixed with "perm_".
protected _buildPermsFromRow ( array $row ) : integer
$row array A data row including permission columns.
return integer A permission mask.

_getPermsCriteria() protected method

Builds an ANDed criteria snippet for a set or permissions.
protected _getPermsCriteria ( string $base, array $perms ) : string
$base string A column name prefix.
$perms array A list of permissions.
return string The generated criteria string.

_getShareCriteria() protected method

Returns a criteria statement for querying shares.
protected _getShareCriteria ( string $userid, array $perms, array $attributes, array $shareids = null, $parent = null, $allLevels = true ) : string
$userid string The userid of the user to check access for.
$perms array The level of permissions required.
$attributes array Restrict the shares returned to those who have these attribute values.
$shareids array Additional share IDs from user and group permissions.
return string The criteria string for fetching this user's shares.

_getSharePerms() protected method

Converts the permissions from the database table format into the Horde_Share format.
protected _getSharePerms ( array &$data )
$data array The share object data to convert.

_getUserAndGroupShares() protected method

Returns the records and share IDs from the user and group tables that match the search criteria.
protected _getUserAndGroupShares ( string $userid, array $perms ) : array
$userid string The userid of the user to check access for.
$perms array The level of permissions required.
return array A set of user, groups, and shareids.

convertBitmaskToArray() public static method

Converts a bit mask number to a bit mask array.
public static convertBitmaskToArray ( $perm ) : array
return array The bit mask as an array.

countOwners() public method

Count the number of users who have shares with the given permissions for the current user.
public countOwners ( integer $perm = Horde_Perms::SHOW, mixed $parent = null, boolean $allLevels = true ) : integer
$perm integer The level of permissions required.
$parent mixed The parent share to start looking in. (Horde_Share_Object, share_id, or null).
$allLevels boolean Return all levels, or just the direct children of $parent?
return integer Number of users.

countShares() public method

Returns the count of all shares that $userid has access to.
public countShares ( string $userid, integer $perm = Horde_Perms::SHOW, mixed $attributes = null, mixed $parent = null, boolean $allLevels = true ) : integer
$userid string The userid of the user to check access for.
$perm integer The level of permissions required.
$attributes mixed Restrict the shares counted to those matching $attributes. An array of attribute/values pairs or a share owner username.
$parent mixed The share to start searching from (Horde_Share_Object, share_id, or null)
$allLevels boolean Return all levels, or just the direct children of $parent?
return integer Number of shares the user has access to.

initShareObject() public method

Passes the available permissions to the share object.
public initShareObject ( Horde_Share_Object $object )
$object Horde_Share_Object

listOwners() public method

Return a list of users who have shares with the given permissions for the current user.
public listOwners ( integer $perm = Horde_Perms::SHOW, mixed $parent = null, boolean $allLevels = true, integer $from, integer $count ) : array
$perm integer The level of permissions required.
$parent mixed The parent share to start looking in. (Horde_Share_Object, share_id, or null)
$allLevels boolean Return all levels, or just the direct children of $parent? Defaults to all levels.
$from integer The user to start listing at.
$count integer The number of users to return.
return array List of users.

listShares() public method

Returns an array of all shares that $userid has access to.
public listShares ( string $userid, array $params = [] ) : array
$userid string The userid of the user to check access for.
$params array 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.
 'parent'        Start at this share in the hierarchy. Either share_id or
                 Horde_Share_Object
 'all_levels'    List all levels or just the direct children of parent?
return array The shares the user has access to.

listSystemShares() public method

Returns an array of all system shares.
public listSystemShares ( ) : array
return array All system shares.

Property Details

$_availablePermissions protected_oe property

This is necessary to unset certain permission when updating existing share objects.
protected $_availablePermissions

$_shareObject protected_oe property

The Horde_Share_Object subclass to instantiate objects as
protected string $_shareObject
return string