\Horde_Core_Imsp_Utils

Horde_Imsp_Utils.

Summary

Methods
Properties
Constants
getAllBooks()
createBook()
synchShares()
permsToACL()
setACL()
No public properties found
No constants found
_createShare()
_isOwner()
_setPerms()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

getAllBooks()

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.

Parameters

array $serverInfo

Information about the server and the current user.

Returns

array —

Information about all the address books or PEAR_Error.

createBook()

createBook(array  $source, string  $newName) : mixed

Utility function to help clients create new address books without having to create an imsp driver instance first.

Parameters

array $source

Information about the user's default IMSP address book.

string $newName

The name of the new address book.

Returns

mixed —

true on success or PEAR_Error on failure.

synchShares()

synchShares(\Horde_Share  $share_obj, array  $serverInfo) : mixed

Synchronize Horde_Shares to existing IMSP address books.

Parameters

\Horde_Share $share_obj

The Horde_Share object to use.

array $serverInfo

Information about the IMSP server and the current user.

Returns

mixed —

Array describing any shares added or removed | PEAR_Error.

permsToACL()

permsToACL(integer  $perms) : string

Translates Horde_Share permissions into IMSP acl.

Parameters

integer $perms

Horde_Perms style permission bitmask.

Returns

string —

An IMSP acl string

setACL()

setACL(  $params, string  $book, string  $name, string  $acl) : mixed

Set's an address book's acl on the IMSP server.

Parameters

$params
string $book

The address book name to set

string $name

The user name to set for.

string $acl

The acl string to set.

Returns

mixed —

True | Pear_Error

_createShare()

_createShare(  $share_obj, array  $params, array  $shareparams) : mixed

Creates a Horde_Share for an *existing* IMSP address book.

Needed for creating shares for address books created outside of Horde.

Parameters

$share_obj
array $params
array $shareparams

Returns

mixed —

True | PEAR_Error

_isOwner()

_isOwner(string  $bookName,   $username,   $acl) : boolean

Determine if we are the owner of the address book.

Assumes ownership if username is beginning address book name or if user has admin rights ('a') in acl.

Parameters

string $bookName

The address book name to check

$username
$acl

Returns

boolean —

True if $user is owner, otherwise false.

_setPerms()

_setPerms(\Horde_Share_Object  $share, string  $acl) 

Translates IMSP acl into share permissions and sets them in share.

Parameters

\Horde_Share_Object $share

The share to assign perms to

string $acl

The IMSP acl string.