Class Horde_Share_sqlng

Description

Located in /Share/Share/sqlng.php (line 21)

Horde_Share
   |
   --Horde_Share_sql
      |
      --Horde_Share_sqlng
Variable Summary
Method Summary
 Horde_Share_sqlng Horde_Share_sqlng ( $app)
 array convertBitmaskToArray (integer $perm)
 integer countShares (string $userid, [integer $perm = PERMS_SHOW], [mixed $attributes = null])
 array &listShares (string $userid, [ $perm = PERMS_SHOW], [ $attributes = null], [ $from = 0], [ $count = 0], [ $sort_by = null], [ $direction = 0], array $params)
 array _buildPermsFromRow (array $row, string $index)
 string _getPermsCriteria (string $base, array $perms)
 string _getShareCriteria (string $userid, array $perms, array $attributes, [array $shareids = null])
 void _getSharePerms ( &$data, array $data)
 array _getUserAndGroupShares (string $userid,  $perms)
Variables
mixed $_availablePermissions = array() (line 38)

A list of available permission.

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

string $_shareObject = 'Horde_Share_Object_sqlng' (line 28)

The Horde_Share_Object subclass to instantiate objects as


Redefinition of:
Horde_Share_sql::$_shareObject
The Horde_Share_Object subclass to instantiate objects as

Inherited Variables

Inherited from Horde_Share_sql

Horde_Share_sql::$_db
Horde_Share_sql::$_params
Horde_Share_sql::$_table
Horde_Share_sql::$_write_db

Inherited from Horde_Share

Horde_Share::$_app
Horde_Share::$_cache
Horde_Share::$_listcache
Horde_Share::$_root
Horde_Share::$_shareMap
Horde_Share::$_sortList
Methods
Constructor Horde_Share_sqlng (line 44)
  • see: Horde_Share_Base()
Horde_Share_sqlng Horde_Share_sqlng ( $app)
  • $app
convertBitmaskToArray (line 167)

Converts a bit mask number to a bit mask array.

  • return: The bit mask as an array.
array convertBitmaskToArray (integer $perm)
  • integer $perm: A bit mask.
countShares (line 145)

Returns the number of shares that $userid has access to.

  • return: The number of shares
  • throws: Horde_Share_Exception
integer countShares (string $userid, [integer $perm = PERMS_SHOW], [mixed $attributes = null])
  • 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.

Redefinition of:
Horde_Share::countShares()
Returns the number of shares that $userid has access to.
initShareObject (line 55)

Passes the available permissions to the share object.

void initShareObject (Horde_Share_Object $object)
listShares (line 76)

Returns an array of all shares that $userid has access to.

  • return: The shares the user has access to.
  • throws: Horde_Share_Exception
array &listShares (string $userid, [ $perm = PERMS_SHOW], [ $attributes = null], [ $from = 0], [ $count = 0], [ $sort_by = null], [ $direction = 0], array $params)
  • string $userid: The userid of the user to check access for.
  • 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.
  • $perm
  • $attributes
  • $from
  • $count
  • $sort_by
  • $direction

Redefinition of:
Horde_Share_sql::listShares()
Returns an array of all shares that $userid has access to.
_buildPermsFromRow (line 188)

Builds a list of permission bit masks from all columns in a data row prefixed with "perm_".

  • return: A permission hash.
array _buildPermsFromRow (array $row, string $index)
  • array $row: A data row including permission columns.
  • string $index: Name of the column that should be used as the key for the permissions list.

Redefinition of:
Horde_Share_sql::_buildPermsFromRow()
Builds a list of permission bit masks from the "perm" column.
_getPermsCriteria (line 348)

Builds an ANDed criteria snippet for a set or permissions.

  • return: The generated criteria string.
string _getPermsCriteria (string $base, array $perms)
  • string $base: A column name prefix.
  • array $perms: A list of permissions.
_getShareCriteria (line 294)

Returns a criteria statement for querying shares.

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

Redefinition of:
Horde_Share_sql::_getShareCriteria()
Returns an array of criteria for querying shares.
_getSharePerms (line 213)

Converts the permissions from the database table format into the Horde_Share format.

void _getSharePerms ( &$data, array $data)
  • array $data: The share object data to convert.
  • &$data

Redefinition of:
Horde_Share_sql::_getSharePerms()
_getUserAndGroupShares (line 240)

Returns the records and share IDs from the user and group tables that match the search criteria.

  • return: A set of user, groups, and shareids.
array _getUserAndGroupShares (string $userid,  $perms)
  • string $userid: The userid of the user to check access for.
  • array $perms: The level of permissions required.

Inherited Methods

Inherited From Horde_Share_sql

 Horde_Share_sql::getTable()
 Horde_Share_sql::getWriteDb()
 Horde_Share_sql::listAllShares()
 Horde_Share_sql::listShares()
 Horde_Share_sql::_addShare()
 Horde_Share_sql::_buildPermsFromRow()
 Horde_Share_sql::_connect()
 Horde_Share_sql::_countShares()
 Horde_Share_sql::_exists()
 Horde_Share_sql::_fromDriverCharset()
 Horde_Share_sql::_getShare()
 Horde_Share_sql::_getShareById()
 Horde_Share_sql::_getShareCriteria()
 Horde_Share_sql::_getShareGroups()
 Horde_Share_sql::_getSharePerms()
 Horde_Share_sql::_getShares()
 Horde_Share_sql::_getShareUsers()
 Horde_Share_sql::_hasGroups()
 Horde_Share_sql::_hasUsers()
 Horde_Share_sql::_listAllShares()
 Horde_Share_sql::_loadPermissions()
 Horde_Share_sql::_newShare()
 Horde_Share_sql::_removeShare()
 Horde_Share_sql::_selectDB()
 Horde_Share_sql::_toDriverCharset()
 Horde_Share_sql::_toDriverKeys()
 Horde_Share_sql::__sleep()
 Horde_Share_sql::__wakeup()

Inherited From Horde_Share

 Horde_Share::Horde_Share()
 Horde_Share::addShare()
 Horde_Share::countShares()
 Horde_Share::exists()
 Horde_Share::getIdentityByShare()
 Horde_Share::getPermissions()
 Horde_Share::getShare()
 Horde_Share::getShareById()
 Horde_Share::getShares()
 Horde_Share::listAllShares()
 Horde_Share::listShares()
 Horde_Share::newShare()
 Horde_Share::removeShare()
 Horde_Share::shutdown()
 Horde_Share::singleton()
 Horde_Share::_sortShares()
 Horde_Share::__sleep()
 Horde_Share::__wakeup()

Documentation generated on Sun, 30 Jan 2011 05:22:07 +0000 by phpDocumentor 1.4.3