PHP Class Turba_Driver_Ldap, horde

Copyright 2010-2016 Horde LLC (http://www.horde.org/) See the enclosed file LICENSE for license information (ASL). If you did did not receive this file, see http://www.horde.org/licenses/apache.
Author: Chuck Hagenbuch ([email protected])
Author: Jon Parise ([email protected])
Inheritance: extends Turba_Driver
Afficher le fichier Open project: horde/horde

Protected Properties

Свойство Type Description
$_ds resource Handle for the current LDAP connection.
$_syntaxCache array Cache _getSyntax() calls.

Méthodes publiques

Méthode Description
__construct ( string $name = '', array $params = [] ) : Turba_Driver_Ldap Constructs a new Turba LDAP driver object.
toDriverKeys ( array $hash ) : array Extends parent function to build composed fields needed for the dn based on the contents of $this->map.

Méthodes protégées

Méthode Description
_add ( array $attributes, array $blob_fields = [], array $date_fields = [] ) Adds the specified contact to the addressbook.
_buildSearchQuery ( array $criteria ) : string Build a piece of a search query.
_canAdd ( ) : boolean TODO
_checkRequiredAttributes ( array $objectclasses ) : array Returns a list of required attributes.
_connect ( ) Initiate LDAP connection.
_convertParameters ( array $in ) : array Converts Turba connection parameter so Horde_Ldap parameters.
_delete ( string $object_key, string $object_id ) Deletes the specified entry from the LDAP directory.
_emptyAttributeFilter ( $var ) : boolean Remove empty attributes from attributes array.
_encodeAttributes ( array &$attributes ) Format and encode attributes including postal addresses, character set encoding, etc.
_getResults ( array $fields, resource $res ) : array Get some results from a result identifier and clean them up.
_getSyntax ( string $att ) : string Returns the syntax of an attribute, if necessary recursively.
_isPostalAddress ( string $attribute ) : boolean Checks if an attribute refers to a Postal Address.
_isString ( string $attribute ) : boolean Checks if an attribute refers to a string.
_makeKey ( array $attributes ) : string Build a DN based on a set of attributes and what attributes make a DN for the current source.
_makeRDN ( array $attributes ) : string Build a RDN based on a set of attributes and what attributes make a RDN for the current source.
_makeRDNhelper ( array $attributes, array $dn ) : string Helper function for _makeRDN().
_read ( string $key, mixed $ids, string $owner, array $fields, array $blobFields = [], array $dateFields = [] ) : array Reads the LDAP directory for a given element and returns the results.
_save ( Turba_Object $object ) : string Modifies the specified entry in the LDAP directory.
_search ( array $criteria, array $fields, array $blobFields = [], $count_only = false ) : array Searches the LDAP directory with the given criteria and returns a filtered list of results. If no criteria are specified, all records are returned.

Method Details

__construct() public méthode

Constructs a new Turba LDAP driver object.
public __construct ( string $name = '', array $params = [] ) : Turba_Driver_Ldap
$name string The source name
$params array Hash containing additional configuration parameters.
Résultat Turba_Driver_Ldap

_add() protected méthode

Adds the specified contact to the addressbook.
protected _add ( array $attributes, array $blob_fields = [], array $date_fields = [] )
$attributes array The attribute values of the contact.
$blob_fields array Fields that represent binary data.
$date_fields array Fields that represent dates. @since 4.2.0

_buildSearchQuery() protected méthode

Build a piece of a search query.
protected _buildSearchQuery ( array $criteria ) : string
$criteria array The array of criteria.
Résultat string An LDAP query fragment.

_canAdd() protected méthode

TODO
protected _canAdd ( ) : boolean
Résultat boolean TODO

_checkRequiredAttributes() protected méthode

Returns a list of required attributes.
protected _checkRequiredAttributes ( array $objectclasses ) : array
$objectclasses array List of objectclasses that should be checked for required attributes.
Résultat array List of attribute names of the specified objectclasses that have been configured as being required.

_connect() protected méthode

Not done in __construct(), only when a read or write action is necessary.
protected _connect ( )

_convertParameters() protected méthode

Converts Turba connection parameter so Horde_Ldap parameters.
protected _convertParameters ( array $in ) : array
$in array Turba parameters.
Résultat array Horde_Ldap parameters.

_delete() protected méthode

Deletes the specified entry from the LDAP directory.
protected _delete ( string $object_key, string $object_id )
$object_key string
$object_id string

_emptyAttributeFilter() protected méthode

Remove empty attributes from attributes array.
protected _emptyAttributeFilter ( $var ) : boolean
Résultat boolean Boolean used by array_filter.

_encodeAttributes() protected méthode

Format and encode attributes including postal addresses, character set encoding, etc.
protected _encodeAttributes ( array &$attributes )
$attributes array The attributes array.

_getResults() protected méthode

Get some results from a result identifier and clean them up.
protected _getResults ( array $fields, resource $res ) : array
$fields array List of fields to return.
$res resource Result identifier.
Résultat array Hash containing the results.

_getSyntax() protected méthode

Returns the syntax of an attribute, if necessary recursively.
protected _getSyntax ( string $att ) : string
$att string Attribute name.
Résultat string Attribute syntax.

_isPostalAddress() protected méthode

Checks if an attribute refers to a Postal Address.
protected _isPostalAddress ( string $attribute ) : boolean
$attribute string An attribute name.
Résultat boolean True if the specified attribute refers to a Postal Address.

_isString() protected méthode

Checks if an attribute refers to a string.
protected _isString ( string $attribute ) : boolean
$attribute string An attribute name.
Résultat boolean True if the specified attribute refers to a string.

_makeKey() protected méthode

Build a DN based on a set of attributes and what attributes make a DN for the current source.
protected _makeKey ( array $attributes ) : string
$attributes array The attributes (in driver keys) of the object being added.
Résultat string The DN for the new object.

_makeRDN() protected méthode

Build a RDN based on a set of attributes and what attributes make a RDN for the current source.
protected _makeRDN ( array $attributes ) : string
$attributes array The attributes (in driver keys) of the object being added.
Résultat string The RDN for the new object.

_makeRDNhelper() protected méthode

Recursively builds the (possibly nested) attribute-value array to build a DN. Nested arrays will be joined with the '+' character, see Horde_Ldap::quoteDN().
protected _makeRDNhelper ( array $attributes, array $dn ) : string
$attributes array The attributes (in driver keys) of the object being added.
$dn array The array describing how the DN should be built.
Résultat string The array to be passed to Horde_Ldap::quoteDN().

_read() protected méthode

Reads the LDAP directory for a given element and returns the results.
protected _read ( string $key, mixed $ids, string $owner, array $fields, array $blobFields = [], array $dateFields = [] ) : array
$key string The primary key field to use.
$ids mixed The ids of the contacts to load.
$owner string Only return contacts owned by this user.
$fields array List of fields to return.
$blobFields array Array of fields containing binary data.
$dateFields array Array of fields containing date data. @since 4.2.0
Résultat array Hash containing the search results.

_save() protected méthode

Modifies the specified entry in the LDAP directory.
protected _save ( Turba_Object $object ) : string
$object Turba_Object The object we wish to save.
Résultat string The object id, possibly updated.

toDriverKeys() public méthode

Extends parent function to build composed fields needed for the dn based on the contents of $this->map.
public toDriverKeys ( array $hash ) : array
$hash array Hash using Turba keys.
Résultat array Translated version of $hash.

Property Details

$_ds protected_oe property

Handle for the current LDAP connection.
protected resource $_ds
Résultat resource

$_syntaxCache protected_oe property

Cache _getSyntax() calls.
protected array $_syntaxCache
Résultat array