Horde_Core_Imsp_Utils
in package
Horde_Imsp_Utils.
Tags
Table of Contents
Methods
- createBook() : mixed
- Utility function to help clients create new address books without having to create an imsp driver instance first.
- getAllBooks() : array<string|int, mixed>
- 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() : string
- Translates Horde_Share permissions into IMSP acl.
- setACL() : mixed
- Set's an address book's acl on the IMSP server.
- synchShares() : mixed
- Synchronize Horde_Shares to existing IMSP address books.
- _createShare() : mixed
- Creates a Horde_Share for an *existing* IMSP address book.
- _isOwner() : bool
- Determine if we are the owner of the address book.
- _setPerms() : mixed
- Translates IMSP acl into share permissions and sets them in share.
Methods
createBook()
Utility function to help clients create new address books without having to create an imsp driver instance first.
public
static createBook(array<string|int, mixed> $source, string $newName) : mixed
Parameters
- $source : array<string|int, mixed>
-
Information about the user's default IMSP address book.
- $newName : string
-
The name of the new address book.
Return values
mixed —true on success or PEAR_Error on failure.
getAllBooks()
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<string|int, mixed> $serverInfo) : array<string|int, mixed>
Parameters
- $serverInfo : array<string|int, mixed>
-
Information about the server and the current user.
Return values
array<string|int, mixed> —Information about all the address books or PEAR_Error.
permsToACL()
Translates Horde_Share permissions into IMSP acl.
public
static permsToACL(int $perms) : string
Parameters
- $perms : int
-
Horde_Perms style permission bitmask.
Return values
string —An IMSP acl string
setACL()
Set's an address book's acl on the IMSP server.
public
static setACL(mixed $params, string $book, string $name, string $acl) : mixed
Parameters
- $params : 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 values
mixed —True | Pear_Error
synchShares()
Synchronize Horde_Shares to existing IMSP address books.
public
synchShares(Horde_Share $share_obj, array<string|int, mixed> $serverInfo) : mixed
Parameters
- $share_obj : Horde_Share
-
The Horde_Share object to use.
- $serverInfo : array<string|int, mixed>
-
Information about the IMSP server and the current user.
Return values
mixed —Array describing any shares added or removed | PEAR_Error.
_createShare()
Creates a Horde_Share for an *existing* IMSP address book.
protected
static _createShare(mixed $share_obj, array<string|int, mixed> $params, array<string|int, mixed> $shareparams) : mixed
Needed for creating shares for address books created outside of Horde.
Parameters
- $share_obj : mixed
- $params : array<string|int, mixed>
- $shareparams : array<string|int, mixed>
Return values
mixed —True | PEAR_Error
_isOwner()
Determine if we are the owner of the address book.
protected
static _isOwner(string $bookName, mixed $username, mixed $acl) : bool
Assumes ownership if username is beginning address book name or if user has admin rights ('a') in acl.
Parameters
- $bookName : string
-
The address book name to check
- $username : mixed
- $acl : mixed
Return values
bool —True if $user is owner, otherwise false.
_setPerms()
Translates IMSP acl into share permissions and sets them in share.
protected
static _setPerms(Horde_Share_Object &$share, string $acl) : mixed
Parameters
- $share : Horde_Share_Object
-
The share to assign perms to
- $acl : string
-
The IMSP acl string.