Overview

Packages

  • None
  • Share

Classes

  • Horde_Share_Base
  • Horde_Share_Datatree
  • Horde_Share_Kolab
  • Horde_Share_Object
  • Horde_Share_Object_Datatree
  • Horde_Share_Object_DataTree_Share
  • Horde_Share_Object_Kolab
  • Horde_Share_Object_Sql
  • Horde_Share_Object_Sqlng
  • Horde_Share_Sql
  • Horde_Share_Sqlng
  • Horde_Share_Translation
  • Overview
  • Package
  • Class
  • Tree

Class Horde_Share_Sql

Horde_Share_Base
Extended by Horde_Share_Sql

Direct known subclasses

Horde_Share_Sqlng
Package: Share
Located at Horde/Share/Sql.php
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

Horde_Share_Base::__construct()

Overrides

Horde_Share_Base::__construct()
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

Get storage table

Returns

string
public
# setStorage( Horde_Db_Adapter $db )
public Horde_Db_Adapter
# getStorage( )

Returns

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

Horde_Share_Exception

Overrides

Horde_Share_Base::listAllShares()
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

Horde_Share_Exception

Overrides

Horde_Share_Base::listShares()
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

Horde_Share_Exception
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

Horde_Share_Exception
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

Horde_Share_Object
The parent share, if it exists.
public array
# listSystemShares( )

Returns an array of all system shares.

Returns an array of all system shares.

Returns

array
All system shares.

Throws

Horde_Share_Exception

Overrides

Horde_Share_Base::listSystemShares()
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

Horde_Share_Exception

Overrides

Horde_Share_Base::countShares()
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

Horde_Share_Exception

Overrides

Horde_Share_Base::removeShare()
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

Horde_Share_Exception
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

Horde_Share_Base::toDriverCharset()
Methods inherited from Horde_Share_Base
addCallback(), addShare(), exists(), expireListCache(), getApp(), getListCache(), getPermissions(), getPermsObject(), getShare(), getShareById(), getShares(), idExists(), initShareObject(), newShare(), renameShare(), resetCache(), runCallback(), setListCache(), setLogger(), setShareCallback(), setShareClass()
Constants summary
integer SQL_FLAG_USERS
# 1
integer SQL_FLAG_GROUPS
# 2
integer VERSION
# 1
API documentation generated by ApiGen