\Horde_Imsp_Book

Horde_Imsp_Book Class - provides api for dealing with IMSP address books.

Copyright 2002-2017 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Summary

Methods
Properties
Constants
__construct()
getAddressBookList()
search()
getEntry()
createAddressBook()
deleteAddressBook()
renameAddressBook()
addEntry()
deleteEntry()
lockEntry()
unlockEntry()
setACL()
getACL()
deleteACL()
myRights()
$sort
ACL_RIGHTS
_parseFetchAddressResponse()
$_imsp
$_params
N/A
No private methods found
No private properties found
N/A

Constants

ACL_RIGHTS

ACL_RIGHTS

Supported ACLs

Properties

$sort

$sort : string

Sort order.

Type

string

$_params

$_params : array

Parameter list.

Type

array

Methods

__construct()

__construct(\Horde_Imsp_Client_Base  $client, array  $params) 

Constructor function.

Parameters

\Horde_Imsp_Client_Base $client
array $params

Hash containing IMSP parameters.

getAddressBookList()

getAddressBookList() : mixed

Returns an array containing the names of all the address books available to the logged in user.

Returns

mixed —

Array of address book names

search()

search(string  $abook, mixed  $search) : array

Returns an array containing the names that match $search critera in the address book named $abook.

Parameters

string $abook

Address book name to search.

mixed $search

Search criteria either a string (name) or an array in the form of 'fieldName' => 'searchTerm'.

Throws

\Horde_Imsp_Exception

Returns

array —

Array of names of the entries that match.

getEntry()

getEntry(string  $abook, string  $entryName) : array

Returns an associative array of a single address book entry.

Note that there will always be a 'name' field.

Parameters

string $abook

Name of the address book to search.

string $entryName

'name' attribute of the entry to retrieve

Throws

\Horde_Imsp_Exception
\Horde_Exception_NotFound

Returns

array —

Array containing entry.

createAddressBook()

createAddressBook(string  $abookName) 

Creates a new address book.

Parameters

string $abookName

FULLY QUALIFIED name such 'jdoe.clients' etc...

Throws

\Horde_Imsp_Exception

deleteAddressBook()

deleteAddressBook(string  $abookName) 

Deletes an address book completely!

Parameters

string $abookName

Name of address book to delete.

Throws

\Horde_Imsp_Exception

renameAddressBook()

renameAddressBook(string  $abookOldName, string  $abookNewName) 

Renames an address book.

Parameters

string $abookOldName

Old name.

string $abookNewName

New address book name.

Throws

\Horde_Imsp_Exception

addEntry()

addEntry(string  $abook, array  $entryInfo) 

Adds an address book entry to an address book.

Parameters

string $abook

Name of address book to add entry to.

array $entryInfo

Address book entry information - there MUST be a field 'name' containing the entry name.

Throws

\Horde_Imsp_Exception

deleteEntry()

deleteEntry(string  $abook, string  $bookEntry) 

Deletes an abook entry.

Parameters

string $abook

Name of address book containing entry.

string $bookEntry

Name of entry to delete.

Throws

\Horde_Imsp_Exception

lockEntry()

lockEntry(string  $abook, string  $bookEntry) : mixed

Attempts to acquire a semaphore on the address book entry.

Parameters

string $abook

Address book name

string $bookEntry

Name of entry to lock

Returns

mixed —

true or array on success (depends on server in use).

unlockEntry()

unlockEntry(string  $abook, string  $bookEntry) 

Unlocks a previously locked address book.

Parameters

string $abook

Name of address book containing locked entry.

string $bookEntry

Name of entry to unlock.

Throws

\Horde_Imsp_Exception

setACL()

setACL(string  $abook, string  $ident, string  $acl) : mixed

Sets an Access Control List for an abook.

Parameters

string $abook

Name of address book.

string $ident

Name of user for this acl.

string $acl

acl for this user/book.

Returns

mixed —

True on success / PEAR_Error on failure.

getACL()

getACL(string  $abook) : mixed

Retrieves an address book's ACL.

Parameters

string $abook

Name of address book to retrieve acl for.

Returns

mixed —

array containing acl for every user with access to address book or PEAR_Error on failure.

deleteACL()

deleteACL(string  $abook, string  $ident) 

Deletes an ACL entry for an address book.

Parameters

string $abook

Name of the address book.

string $ident

Name of entry to remove acl for.

Throws

\Horde_Imsp_Exception

myRights()

myRights(string  $abook) : mixed

Returns an ACL string containing the rights for the current user

Parameters

string $abook

Name of address book to retrieve acl.

Returns

mixed —

acl of current user.

_parseFetchAddressResponse()

_parseFetchAddressResponse(string  $server_response) : array

Parses a IMSP fetchaddress response text string into key-value pairs

Parameters

string $server_response

The raw fetchaddress response.

Returns

array —

Address book entry information as key=>value pairs.