Class Turba_Driver_ldap

Description

Turba directory driver implementation for PHP's LDAP extension.

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

Located in /lib/Driver/ldap.php (line 11)

Turba_Driver
   |
   --Turba_Driver_ldap
Variable Summary
 resource $_ds
Method Summary
 array toDriverKeys (array $hash)
 void _add (array $attributes)
 string _buildSearchQuery (array $criteria)
 void _canAdd ()
 void _delete ( $object_key,  $object_id)
 boolean _emptyAttributeFilter ( $var, mixed $val)
 void _encodeAttributes ( &$attributes)
 array _getResults (array $fields, resource $res)
 void _init ()
 string _makeKey (array $attributes)
 string _makeRDN (array $attributes)
 string _quoteDN (array $parts)
 array _read (string $key, mixed $ids, string $owner, array $fields)
 string _save ( $object_key,  $object_id,  $attributes)
 array _search ($criteria $criteria, $fields $fields)
Variables
resource $_ds = 0 (line 18)

Handle for the current LDAP connection.

array $_syntaxCache = array() (line 25)

Cache _getSyntax calls to avoid lots of repeated server calls.

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::$_capabilities
Turba_Driver::$_contact_owner
Turba_Driver::$_count
Turba_Driver::$_params
Methods
toDriverKeys (line 114)

Expands the parent->toDriverKeys Function to build composed fields needed for the dn based on the contents of $this->map.

  • return: Translated version of $hash.
array toDriverKeys (array $hash)
  • array $hash: Hash using Turba keys.

Redefinition of:
Turba_Driver::toDriverKeys()
Translates the keys of the first hash from the generalized Turba attributes to the driver-specific fields. The translation is based on the contents of $this->map.
_add (line 266)

Adds the specified entry to the LDAP directory.

void _add (array $attributes)
  • array $attributes: The initial attributes for the new object.

Redefinition of:
Turba_Driver::_add()
Adds the specified contact to the SQL database.
_buildObjectclassFilter (line 604)

Build an LDAP filter based on the objectclass parameter.

  • return: An LDAP filter.
string _buildObjectclassFilter ()
_buildSearchQuery (line 456)

Build a piece of a search query.

  • return: An LDAP query fragment.
string _buildSearchQuery (array $criteria)
  • array $criteria: The array of criteria.
_canAdd (line 319)
  • see: _canAdd()
void _canAdd ()

Redefinition of:
Turba_Driver::_canAdd()
_delete (line 327)

Deletes the specified entry from the LDAP directory.

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

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

Remove empty attributes from attributes array.

  • return: Boolean used by array_filter.
boolean _emptyAttributeFilter ( $var, mixed $val)
  • mixed $val: Value from attributes array.
  • $var
_encodeAttributes (line 575)

Format and encode attributes including postal addresses, character set encoding, etc.

void _encodeAttributes ( &$attributes)
  • &$attributes
_getResults (line 496)

Get some results from a result identifier and clean them up.

  • return: Hash containing the results.
array _getResults (array $fields, resource $res)
  • array $fields: List of fields to return.
  • resource $res: Result identifier.
_init (line 61)
void _init ()

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

Build a DN based on a set of attributes and what attributes make a DN for the current source.

  • return: The DN 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.
_makeRDN (line 420)

Build a RDN based on a set of attributes and what attributes make a RDN for the current source.

  • return: The RDN for the new object.
string _makeRDN (array $attributes)
  • array $attributes: The attributes (in driver keys) of the object being added.
_quoteDN (line 784)

Take an array of DN elements and properly quote it according to RFC 1485.

  • return: The properly quoted string DN.
  • see: Horde_LDAP::quoteDN()
string _quoteDN (array $parts)
  • array $parts:

    An array of tuples containing the attribute name and that attribute's value which make up the DN. Example:

    $parts = array(0 => array('cn', 'John Smith'),

    1. => array('dc', 'example'),
    2. => array('dc', 'com'));

_read (line 219)

Reads the LDAP directory for a given element 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.
  • 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.
_save (line 345)

Modifies the specified entry in the LDAP directory.

  • return: The object id, possibly updated.
string _save ( $object_key,  $object_id,  $attributes)
  • $object_key
  • $object_id
  • $attributes

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

Searches the LDAP directory with the given criteria and returns a filtered list of results. If no criteria are specified, all records are returned.

  • return: Hash containing the search results.
array _search ($criteria $criteria, $fields $fields)
  • $criteria $criteria: Array containing the search criteria.
  • $fields $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.

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:24 +0000 by phpDocumentor 1.4.3