Class Turba_Driver_imsp

Description

Turba directory driver implementation for an IMSP server.

$Horde: turba/lib/Driver/imsp.php,v 1.21.4.23 2009/10/07 16:16:38 mrubinsk Exp $

Located in /lib/Driver/imsp.php (line 13)

Turba_Driver
   |
   --Turba_Driver_imsp
Variable Summary
 boolean $_authenticated
 string $_bookName
 string $_groupField
 string $_groupValue
 Net_IMSP $_imsp
 boolean $_noGroups
Method Summary
 Turba_Driver_imsp Turba_Driver_imsp (array $params)
 void checkDefaultShare ( &$share,  $srcConfig)
 mixed &createShare (array $share_id,  $params)
 boolean hasPermission (integer $perm)
 integer _aclToHordePerms (string $acl)
 void _add ( $attributes)
 void _canAdd ()
 integer _countDelimiters (string $in)
 void _delete ( $object_key,  $object_id)
 mixed _deleteAll ()
 array _doSearch (array $criteria, string $glue)
 array _getDuplicated (array $names)
 array _getGroupEmails ($emailText $emailText)
 void _init ()
 string _makeKey (array $attributes)
 array _read (string $key, mixed $ids, string $owner, array $fields)
 array _removeDuplicated (array $names)
 string _save (string $object_key, string $object_id, array $attributes)
 array _search (array $criteria, array $fields)
 array _sendSearch (array $criteria)
Variables
boolean $_authenticated = '' (line 34)

Holds if we are authenticated.

string $_bookName = '' (line 27)

The name of the addressbook.

mixed $_capabilities = array(
'delete_all' => true,
'delete_addressbook' => true
)
(line 57)

Redefinition of:
Turba_Driver::$_capabilities
What can this backend do?
string $_groupField = '' (line 41)

Holds name of the field indicating an IMSP group.

string $_groupValue = '' (line 48)

Holds value that $_groupField will have if entry is an IMSP group.

Net_IMSP $_imsp (line 20)

Handle for the IMSP connection.

boolean $_noGroups = '' (line 55)

Used to set if the current search is for contacts only.

Inherited Variables

Inherited from Turba_Driver

Turba_Driver::$alternativeName
Turba_Driver::$approximate
Turba_Driver::$fields
Turba_Driver::$listNameField
Turba_Driver::$map
Turba_Driver::$name
Turba_Driver::$strict
Turba_Driver::$tabs
Turba_Driver::$title
Turba_Driver::$_contact_owner
Turba_Driver::$_count
Turba_Driver::$_params
Methods
Constructor Turba_Driver_imsp (line 67)

Constructs a new Turba imsp driver object.

Turba_Driver_imsp Turba_Driver_imsp (array $params)
  • array $params: Hash containing additional configuration parameters.
checkDefaultShare (line 693)

Check if the passed in share is the default share for this source.

  • see: checkDefaultShare($share, $srcconfig)
void checkDefaultShare ( &$share,  $srcConfig)
  • &$share
  • $srcConfig

Redefinition of:
Turba_Driver::checkDefaultShare()
Check if the passed in share is the default share for this source.
createShare (line 641)

Creates a new Horde_Share and creates the address book on the IMSP server.

  • return: The share object or PEAR_Error.
  • since: Turba 2.2
mixed &createShare (array $share_id,  $params)
  • array $share_id: The params for the share.
  • $params

Redefinition of:
Turba_Driver::createShare()
Creates a new Horde_Share for this source type.
hasPermission (line 602)

Checks if the current user has the requested permission on this source.

  • return: true if user has permission, false otherwise.
boolean hasPermission (integer $perm)
  • integer $perm: The permission to check for.

Redefinition of:
Turba_Driver::hasPermission()
Checks if the current user has the requested permissions on this address book.
_aclToHordePerms (line 614)

Converts an acl string to a Horde Permissions bitmask.

  • return: Horde Permissions bitmask.
integer _aclToHordePerms (string $acl)
  • string $acl: A standard, IMAP style acl string.
_add (line 271)

Adds the specified object to the IMSP server.

void _add ( $attributes)
  • $attributes

Redefinition of:
Turba_Driver::_add()
Adds the specified contact to the SQL database.
_canAdd (line 321)
  • see: _canAdd()
void _canAdd ()

Redefinition of:
Turba_Driver::_canAdd()
_countDelimiters (line 668)

Helper function to count the occurances of the ':' delimter in group member entries.

  • return: The number of ':' in $in.
integer _countDelimiters (string $in)
  • string $in: The group member entry.
_delete (line 329)

Deletes the specified object from the IMSP server.

void _delete ( $object_key,  $object_id)
  • $object_key
  • $object_id

Redefinition of:
Turba_Driver::_delete()
Deletes the specified contact from the SQL database.
_deleteAll (line 340)

Deletes the address book represented by this driver from the IMSP server.

  • return: true | PEAR_Error
  • since: Turba 2.2
mixed _deleteAll ()
_doSearch (line 405)

Parses the search criteria, requests the individual searches from the server and performs any necessary ANDs / ORs on the results.

  • return: Array containing contact names that match $criteria.
array _doSearch (array $criteria, string $glue)
  • array $criteria: Array containing the search criteria.
  • string $glue: Type of search to perform (AND / OR).
_getContactOwner (line 683)

Returns the owner for this contact. For an IMSP source, this should be the name of the address book.

void _getContactOwner ()

Redefinition of:
Turba_Driver::_getContactOwner()
_getDuplicated (line 552)

Returns only those names that are duplicated in $names

  • return: Array containing the 'AND' of all arrays in $names
array _getDuplicated (array $names)
  • array $names: A nested array of arrays containing names
_getGroupEmails (line 388)

Parses out $emailText into an array of pure email addresses suitable for searching the IMSP datastore with.

  • return: of pure email address.
array _getGroupEmails ($emailText $emailText)
  • $emailText $emailText: string single string containing email addressses.
_init (line 79)

Initialize the IMSP connection and check for error.

void _init ()

Redefinition of:
Turba_Driver::_init()
Initialize the driver.
_makeKey (line 376)

Create an object key for a new object.

  • return: A unique ID for the new object.
string _makeKey (array $attributes)
  • array $attributes: The attributes (in driver keys) of the object being added.

Redefinition of:
Turba_Driver::_makeKey()
Creates an object key for a new object.
_read (line 155)

Reads the given data from the IMSP server and returns the results.

  • return: Hash containing the search results.
array _read (string $key, mixed $ids, string $owner, array $fields)
  • string $key: The primary key field to use (always 'name' for IMSP).
  • mixed $ids: The ids of the contacts to load.
  • string $owner: Only return contacts owned by this user.
  • array $fields: List of fields to return.

Redefinition of:
Turba_Driver::_read()
Reads the given data from the address book and returns the results.
_removeDuplicated (line 583)

Returns an array with all duplicate names removed.

  • return: Array containg the 'OR' of all arrays in $names.
array _removeDuplicated (array $names)
  • array $names: Nested array of arrays containing names.
_save (line 355)

Saves the specified object to the IMSP server.

  • return: The object id, possibly updated.
string _save (string $object_key, string $object_id, array $attributes)
  • string $object_key: (Ignored) name of the field in $attributes[] to treat as key.
  • string $object_id: The value of the key field.
  • array $attributes: Contains the field names and values of the entry.

Redefinition of:
Turba_Driver::_save()
Saves the specified object in the SQL database.
_search (line 113)

Returns all entries matching $critera.

  • return: Hash containing the search results.
array _search (array $criteria, array $fields)
  • array $criteria: Array containing the search criteria.
  • array $fields: List of fields to return.

Redefinition of:
Turba_Driver::_search()
Searches the address book with the given criteria and returns a filtered list of results. If the criteria parameter is an empty array, all records will be returned.
_sendSearch (line 449)

Sends a search request to the server.

  • return: Array containing a list of names that match the search.
array _sendSearch (array $criteria)
  • array $criteria: Array containing the search critera.

Inherited Methods

Inherited From Turba_Driver

 Turba_Driver::Turba_Driver()
 Turba_Driver::add()
 Turba_Driver::canAdd()
 Turba_Driver::checkDefaultShare()
 Turba_Driver::count()
 Turba_Driver::createShare()
 Turba_Driver::delete()
 Turba_Driver::deleteAll()
 Turba_Driver::generateUID()
 Turba_Driver::getBlobs()
 Turba_Driver::getContactOwner()
 Turba_Driver::getCountry()
 Turba_Driver::getCriteria()
 Turba_Driver::getFields()
 Turba_Driver::getName()
 Turba_Driver::getObject()
 Turba_Driver::getObjects()
 Turba_Driver::getParams()
 Turba_Driver::hasCapability()
 Turba_Driver::hasPermission()
 Turba_Driver::listTimeObjects()
 Turba_Driver::makeSearch()
 Turba_Driver::removeUserData()
 Turba_Driver::save()
 Turba_Driver::search()
 Turba_Driver::singleton()
 Turba_Driver::toDriver()
 Turba_Driver::toDriverKeys()
 Turba_Driver::toHash()
 Turba_Driver::toTurbaKeys()
 Turba_Driver::tovCard()
 Turba_Driver::_add()
 Turba_Driver::_canAdd()
 Turba_Driver::_delete()
 Turba_Driver::_getContactOwner()
 Turba_Driver::_getTimeObjectTurbaList()
 Turba_Driver::_getTimeObjectTurbaListFallback()
 Turba_Driver::_init()
 Turba_Driver::_makeKey()
 Turba_Driver::_read()
 Turba_Driver::_save()
 Turba_Driver::_search()
 Turba_Driver::_toTurbaObjects()

Documentation generated on Sun, 30 Jan 2011 05:39:23 +0000 by phpDocumentor 1.4.3