PHP Класс Horde_Share_Kolab, horde

Copyright 2004-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Автор: Stuart Binge ([email protected])
Автор: Gunnar Wrobel ([email protected])
Наследование: extends Horde_Share_Base
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( string $app, string $user, Horde_Perms_Base $perms, Horde_Group_Base $groups ) Constructor.
constructFolderName ( string $owner, string $subpath, string $prefix = null ) : string Construct the Kolab storage folder name based on the share name and owner attributes.
constructId ( string $owner, string $name, string $prefix = null ) : string Construct the ID from the owner name and the folder subpath.
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.
deleteAcl ( string $id, string $user ) : null Delete Kolab specific access rights for a share.
getAcl ( string $id ) : An Retrieve the Kolab specific access rights for a share.
getFolderNameElements ( string $folder ) : array Retrieve namespace information for a folder name.
getList ( ) : Horde_Kolab_Storage_List Return the Kolab storage folder list handler.
getStorage ( ) : Horde_Kolab_Storage Return the Kolab storage backend associated with this driver.
getType ( ) : string Return the type of folder this share driver will access in the Kolab storage backend (depends on the application calling the share driver).
listSystemShares ( ) : array Returns an array of all system shares.
save ( string $id, string $old_id, array $data ) : null Save share data to the storage backend.
setAcl ( string $id, string $user, string $acl ) : null Set the Kolab specific access rights for a share.
setStorage ( Horde_Kolab_Storage $storage ) : null Set the Kolab storage backend.

Защищенные методы

Метод Описание
_addShare ( Horde_Share_Object $share ) Adds a share to the shares system.
_exists ( string $share ) : boolean Checks if a share exists in the system.
_getShare ( string $name ) : Horde_Share_Object Returns a Horde_Share_Object_Kolab object corresponding to the given share name, with the details retrieved appropriately.
_getShareById ( integer $id ) : Horde_Share_Object_sql Returns a Horde_Share_Object_sql object corresponding to the given unique ID, with the details retrieved appropriately.
_getShares ( array $ids ) : array Returns an array of Horde_Share_Object_kolab objects corresponding to the requested folders.
_idExists ( integer $id ) : boolean Check that a share id exists in the system.
_listAllShares ( ) : array Lists *all* shares for the current app/share, regardless of permissions.
_listShares ( string $userid, array $params = [] ) : array Returns an array of all shares that $userid has access to.
_newShare ( string $name ) : Horde_Share_Object_kolab Returns a new share object.
_removeShare ( Horde_Share_Object $share ) Removes a share from the shares system permanently.
_renameShare ( Horde_Share_Object $share, string $name ) Renames a share in the shares system.

Приватные методы

Метод Описание
_createObject ( string $id, array $data = [] ) : Horde_Share_Object Returns a Horde_Share_Object_Kolab object corresponding to the given share name, with the details retrieved appropriately.
_idDecode ( string $id ) : string Decode a share ID.
_idDeconstruct ( string $id ) : array Deconstruct the ID elements from the ID string
_idEncode ( string $id ) : string Encode a share ID.

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( string $app, string $user, Horde_Perms_Base $perms, Horde_Group_Base $groups )
$app string The application that the shares belong to
$user string The current user
$perms Horde_Perms_Base The permissions object
$groups Horde_Group_Base The Horde_Group driver.

_addShare() защищенный Метод

The share must first be created with Horde_Share::newShare(), and have any initial details added to it, before this function is called.
protected _addShare ( Horde_Share_Object $share )
$share Horde_Share_Object The new share object.

_exists() защищенный Метод

Checks if a share exists in the system.
protected _exists ( string $share ) : boolean
$share string The share to check.
Результат boolean True if the share exists.

_getShare() защищенный Метод

Returns a Horde_Share_Object_Kolab object corresponding to the given share name, with the details retrieved appropriately.
protected _getShare ( string $name ) : Horde_Share_Object
$name string The name of the share to retrieve.
Результат Horde_Share_Object The requested share.

_getShareById() защищенный Метод

Returns a Horde_Share_Object_sql object corresponding to the given unique ID, with the details retrieved appropriately.
protected _getShareById ( integer $id ) : Horde_Share_Object_sql
$id integer The id of the share to retrieve.
Результат Horde_Share_Object_sql The requested share.

_getShares() защищенный Метод

Returns an array of Horde_Share_Object_kolab objects corresponding to the requested folders.
protected _getShares ( array $ids ) : array
$ids array The ids of the shares to fetch.
Результат array An array of Horde_Share_Object_kolab objects.

_idExists() защищенный Метод

Check that a share id exists in the system.
protected _idExists ( integer $id ) : boolean
$id integer The share id
Результат boolean True if the share exists.

_listAllShares() защищенный Метод

For the Kolab backend this cannot work in the same way as for the SQL based backend. Permissions are always handled by the backend automatically (IMAP ACLs) and cannot be disabled. listAllShares() is apparently used during command line scipts where it represents administrator access. This is possible on Kolab by using the "manager" user. In that case a standard listShares() authenticated as "manager" should be sufficient.
protected _listAllShares ( ) : array
Результат array All shares for the current app/share.

_listShares() защищенный Метод

Returns an array of all shares that $userid has access to.
protected _listShares ( string $userid, array $params = [] ) : array
$userid string The userid of the user to check access for.
$params array See listShares().
Результат array The shares the user has access to.

_newShare() защищенный Метод

Returns a new share object.
protected _newShare ( string $name ) : Horde_Share_Object_kolab
$name string The share's name.
Результат Horde_Share_Object_kolab A new share object.

_removeShare() защищенный Метод

Removes a share from the shares system permanently.
protected _removeShare ( Horde_Share_Object $share )
$share Horde_Share_Object The share to remove.

_renameShare() защищенный Метод

Renames a share in the shares system.
protected _renameShare ( Horde_Share_Object $share, string $name )
$share Horde_Share_Object The share to rename.
$name string The share's new name.

constructFolderName() публичный Метод

Construct the Kolab storage folder name based on the share name and owner attributes.
public constructFolderName ( string $owner, string $subpath, string $prefix = null ) : string
$owner string The owner of the share.
$subpath string The folder subpath.
$prefix string The namespace prefix.
Результат string The folder name for the Kolab backend.

constructId() публичный Метод

Construct the ID from the owner name and the folder subpath.
public constructId ( string $owner, string $name, string $prefix = null ) : string
$owner string The share owner.
$name string The name of the folder without the namespace prefix.
$prefix string The namespace prefix.
Результат string The encoded ID.

countShares() публичный Метод

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?
Результат integer Number of shares the user has access to.

deleteAcl() публичный Метод

Delete Kolab specific access rights for a share.
public deleteAcl ( string $id, string $user ) : null
$id string The share ID.
$user string The user to delete the ACL for
Результат null

getAcl() публичный Метод

Retrieve the Kolab specific access rights for a share.
public getAcl ( string $id ) : An
$id string The share ID.
Результат An array of rights.

getFolderNameElements() публичный Метод

Retrieve namespace information for a folder name.
public getFolderNameElements ( string $folder ) : array
$folder string The folder name.
Результат array A list of namespace prefix, the delimiter and the folder subpath.

getList() публичный Метод

Return the Kolab storage folder list handler.
public getList ( ) : Horde_Kolab_Storage_List
Результат Horde_Kolab_Storage_List The folder list handler.

getStorage() публичный Метод

Return the Kolab storage backend associated with this driver.
public getStorage ( ) : Horde_Kolab_Storage
Результат Horde_Kolab_Storage The Kolab storage driver.

getType() публичный Метод

Return the type of folder this share driver will access in the Kolab storage backend (depends on the application calling the share driver).
public getType ( ) : string
Результат string

listSystemShares() публичный Метод

Returns an array of all system shares.
public listSystemShares ( ) : array
Результат array All system shares.

save() публичный Метод

Save share data to the storage backend.
public save ( string $id, string $old_id, array $data ) : null
$id string The share id.
$old_id string The old share id.
$data array The share data.
Результат null

setAcl() публичный Метод

Set the Kolab specific access rights for a share.
public setAcl ( string $id, string $user, string $acl ) : null
$id string The share ID.
$user string The user to set the ACL for.
$acl string The ACL.
Результат null

setStorage() публичный Метод

Set the Kolab storage backend.
public setStorage ( Horde_Kolab_Storage $storage ) : null
$storage Horde_Kolab_Storage The Kolab storage handler.
Результат null