PHP Class Horde_Core_Imsp_Utils, horde

Author: Michael Rubinsky ([email protected])
Datei anzeigen Open project: horde/horde Class Usage Examples

Public Methods

Method Description
createBook ( array $source, string $newName ) : mixed Utility function to help clients create new address books without having to create an imsp driver instance first.
getAllBooks ( array $serverInfo ) : array Utility function to retrieve the names of all the address books that the user has access to, along with the acl for those books. For information about the $serverInfo array see turba/config/sources.php as this is the cfgSources[] entry for the address books.
permsToACL ( integer $perms ) : string Translates Horde_Share permissions into IMSP acl.
setACL ( $params, string $book, string $name, string $acl ) : mixed Set's an address book's acl on the IMSP server.
synchShares ( Horde_Share $share_obj, array $serverInfo ) : mixed Synchronize Horde_Shares to existing IMSP address books.

Protected Methods

Method Description
_createShare ( $share_obj, array $params, array $shareparams ) : mixed Creates a Horde_Share for an *existing* IMSP address book.
_isOwner ( string $bookName, $username, $acl ) : boolean Determine if we are the owner of the address book.
_setPerms ( Horde_Share_Object &$share, string $acl ) Translates IMSP acl into share permissions and sets them in share.

Method Details

_createShare() protected static method

Needed for creating shares for address books created outside of Horde.
protected static _createShare ( $share_obj, array $params, array $shareparams ) : mixed
$params array
$shareparams array
return mixed True | PEAR_Error

_isOwner() protected static method

Assumes ownership if username is beginning address book name or if user has admin rights ('a') in acl.
protected static _isOwner ( string $bookName, $username, $acl ) : boolean
$bookName string The address book name to check
return boolean True if $user is owner, otherwise false.

_setPerms() protected static method

Translates IMSP acl into share permissions and sets them in share.
protected static _setPerms ( Horde_Share_Object &$share, string $acl )
$share Horde_Share_Object The share to assign perms to
$acl string The IMSP acl string.

createBook() public static method

Utility function to help clients create new address books without having to create an imsp driver instance first.
public static createBook ( array $source, string $newName ) : mixed
$source array Information about the user's default IMSP address book.
$newName string The name of the new address book.
return mixed true on success or PEAR_Error on failure.

getAllBooks() public static method

Utility function to retrieve the names of all the address books that the user has access to, along with the acl for those books. For information about the $serverInfo array see turba/config/sources.php as this is the cfgSources[] entry for the address books.
public static getAllBooks ( array $serverInfo ) : array
$serverInfo array Information about the server and the current user.
return array Information about all the address books or PEAR_Error.

permsToACL() public static method

Translates Horde_Share permissions into IMSP acl.
public static permsToACL ( integer $perms ) : string
$perms integer Horde_Perms style permission bitmask.
return string An IMSP acl string

setACL() public static method

Set's an address book's acl on the IMSP server.
public static setACL ( $params, string $book, string $name, string $acl ) : mixed
$book string The address book name to set
$name string The user name to set for.
$acl string The acl string to set.
return mixed True | Pear_Error

synchShares() public method

Synchronize Horde_Shares to existing IMSP address books.
public synchShares ( Horde_Share $share_obj, array $serverInfo ) : mixed
$share_obj Horde_Share The Horde_Share object to use.
$serverInfo array Information about the IMSP server and the current user.
return mixed Array describing any shares added or removed | PEAR_Error.