Class Horde_Kolab_Server_ldap

Description

This class provides methods to deal with Kolab objects stored in the standard Kolab LDAP db.

$Horde: framework/Kolab_Server/lib/Horde/Kolab/Server/ldap.php,v 1.2.2.11 2009/04/25 08:56:34 wrobel Exp $

Copyright 2008-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

Located in /Kolab_Server/lib/Horde/Kolab/Server/ldap.php (line 36)

Horde_Kolab_Server
   |
   --Horde_Kolab_Server_ldap
Direct descendents
Class Description
 class Horde_Kolab_Server_test This class provides a class for testing the Kolab Server DB.
Variable Summary
 boolean $_base_dn
 boolean $_bound
 resource $_connection
Method Summary
 array|PEAR_Error addrsForIdOrMail (string $id)
 string &buildSearchQuery (array $criteria)
 string getBaseUid ()
 array|PEAR_Error getGroupAddresses (string $uid)
 array|PEAR_Error getGroups (string $uid)
 mixed|PEAR_Error gidForAttr (string $attr, string $value, [int $restrict = KOLAB_SERVER_RESULT_SINGLE])
 mixed|PEAR_Error mailForIdOrMail (string $id)
 NULL mapAttributes ( &$data, array $data)
 The mapField (array $field)
 NULL mapKeys ( &$keys, array $keys)
 boolen|PEAR_Error memberOfGroupAddress (string $uid, string $mail)
 boolean|PEAR_Error save (string $dn, array $data)
 string searchQuery (array $criteria)
 mixed|PEAR_Error uidForAttr (string $attr, string $value, [int $restrict = KOLAB_SERVER_RESULT_SINGLE])
 mixed|PEAR_Error uidForIdOrMail (string $id)
 mixed|PEAR_Error uidForMailAddress (string $mail)
 NULL unbind ()
 NULL unmapAttributes ( &$data, array $data)
 boolean _add (string $dn, array $data)
 mixed|PEAR_Error _attrsForFilter (string $filter, array $attrs, [int $restrict = KOLAB_SERVER_RESULT_SINGLE])
 mixed|PEAR_Error _attrsFromResult (array $result, array $attrs, [int $restrict = KOLAB_SERVER_RESULT_SINGLE])
 boolean|PEAR_Error _bind ([string $dn = false], [string $pw = ''])
 boolean|PEAR_Error _connect ([string $server = null], [string $base_dn = null])
 int _count (string $result)
 int _determineType (string $dn)
 mixed|PEAR_Error _dnForFilter (string $filter, [int $restrict = KOLAB_SERVER_RESULT_SINGLE])
 string|PEAR_Error _dnFromResult (array $result, [int $restrict = KOLAB_SERVER_RESULT_SINGLE])
 int _errno ()
 string _error ()
 resource _firstEntry (resource $result)
 string|PEAR_Error _generateUid (string $type, string $id, array $info)
 array _getAttributes (resource $entry)
 string _getDn (resource $entry)
 array _getDns (resource $result, [int $from = -1], [int $to = -1])
 array _getEntries (resource $result, [int $from = -1], [int $to = -1])
 array|PEAR_Error _getObjectClasses (string $dn)
 array|PEAR_Error _listObjects (string $type, [array $params = null])
 resource _nextEntry (resource $entry)
 array|PEAR_Error _read (string $dn, [string $attrs = null])
 array|PEAR_Error _search (string $filter, [array $attributes = null], [string $base = null])
 boolean _sort (resource $result, string $attribute)
Variables
boolean $_base_dn (line 57)

The base dn .

boolean $_bound (line 50)

Flag that indicates bound state for the LDAP connection.

resource $_connection (line 43)

LDAP connection handle.

Inherited Variables

Inherited from Horde_Kolab_Server

Horde_Kolab_Server::$uid
Horde_Kolab_Server::$valid_types
Horde_Kolab_Server::$_params
Methods
addrsForIdOrMail (line 755)

Returns a list of allowed email addresses for the given user.

  • return: An array of allowed mail addresses
array|PEAR_Error addrsForIdOrMail (string $id)
  • string $id: The users primary mail address or ID.

Redefinition of:
Horde_Kolab_Server::addrsForIdOrMail()
Returns a list of allowed email addresses for the given user.
buildSearchQuery (line 1156)

Build a piece of a search query.

Taken from the Turba LDAP driver.

  • return: An LDAP query fragment.
  • access: protected
string &buildSearchQuery (array $criteria)
  • array $criteria: The array of criteria.
getBaseUid (line 401)

Return the root of the UID values on this server.

  • return: The base UID on this server (base DN on ldap).
string getBaseUid ()

Redefinition of:
Horde_Kolab_Server::getBaseUid()
Return the root of the UID values on this server.
getGroupAddresses (line 953)

Get the mail addresses for the group of this object.

  • return: An array of group ids.
  • since: 0.5.0
array|PEAR_Error getGroupAddresses (string $uid)
  • string $uid: The UID of the object to fetch.
getGroups (line 933)

Get the groups for this object.

  • return: An array of group ids.
array|PEAR_Error getGroups (string $uid)
  • string $uid: The UID of the object to fetch.

Redefinition of:
Horde_Kolab_Server::getGroups()
Get the groups for this object
gidForAttr (line 885)

Identify the GID for the first group found using a specified attribute value.

  • return: The GID or false if there was no result.
mixed|PEAR_Error gidForAttr (string $attr, string $value, [int $restrict = KOLAB_SERVER_RESULT_SINGLE])
  • string $attr: The name of the attribute used for searching.
  • string $value: The desired value of the attribute.
  • int $restrict: A KOLAB_SERVER_RESULT_* result restriction.

Redefinition of:
Horde_Kolab_Server::gidForAttr()
Identify the GID for the first group found using a specified attribute value.
mailForIdOrMail (line 688)

Identify the primary mail attribute for the first object found with the given ID or mail.

  • return: The mail address or false if there was no result.
mixed|PEAR_Error mailForIdOrMail (string $id)
  • string $id: Search for objects with this ID/mail.

Redefinition of:
Horde_Kolab_Server::mailForIdOrMail()
Identify the primary mail attribute for the first object found with the given ID or mail.
mapAttributes (line 1244)

Map attributes defined within this library into their real world counterparts.

  • access: protected
NULL mapAttributes ( &$data, array $data)
  • array $data: The data to be written.
  • &$data
mapField (line 1284)

Map a single attribute key defined within this library into its real world counterpart.

  • return: real name of this attribute on the server we connect to.
  • access: protected
The mapField (array $field)
  • array $field: The attribute name.
mapKeys (line 1264)

Map attribute keys defined within this library into their real world counterparts.

  • access: protected
NULL mapKeys ( &$keys, array $keys)
  • array $keys: The attribute keys.
  • &$keys
memberOfGroupAddress (line 911)

Is the given UID member of the group with the given mail address?

  • return: True in case the user is in the group, false otherwise.
boolen|PEAR_Error memberOfGroupAddress (string $uid, string $mail)
  • string $uid: UID of the user.
  • string $mail: Search the group with this mail address.

Redefinition of:
Horde_Kolab_Server::memberOfGroupAddress()
Is the given UID member of the group with the given mail address?
save (line 1112)

Save an object.

  • return: True if successfull.
boolean|PEAR_Error save (string $dn, array $data)
  • string $dn: The DN of the object.
  • array $data: The data for the object.

Redefinition of:
Horde_Kolab_Server::save()
Stub for saving object data.
searchQuery (line 1130)

Build a search query.

Taken from the Turba LDAP driver.

  • return: An LDAP query filter.
  • access: public
string searchQuery (array $criteria)
  • array $criteria: The array of criteria.
uidForAttr (line 858)

Identify the UID for the first object found using a specified attribute value.

  • return: The UID or false if there was no result.
mixed|PEAR_Error uidForAttr (string $attr, string $value, [int $restrict = KOLAB_SERVER_RESULT_SINGLE])
  • string $attr: The name of the attribute used for searching.
  • string $value: The desired value of the attribute.
  • int $restrict: A KOLAB_SERVER_RESULT_* result restriction.

Redefinition of:
Horde_Kolab_Server::uidForAttr()
Identify the UID for the first user found using a specified attribute value.
uidForIdOrMail (line 725)

Identify the UID for the first object found with the given ID or mail.

  • return: The UID or false if there was no result.
mixed|PEAR_Error uidForIdOrMail (string $id)
  • string $id: Search for objects with this ID/mail.

Redefinition of:
Horde_Kolab_Server::uidForIdOrMail()
Identify the UID for the first object found with the given ID or mail.
uidForMailAddress (line 822)

Return the UID for a given primary mail, ID, or alias.

  • return: The UID or false if there was no result.
mixed|PEAR_Error uidForMailAddress (string $mail)
  • string $mail: A valid mail address for the user.

Redefinition of:
Horde_Kolab_Server::uidForMailAddress()
Return the UID for a given primary mail, uid, or alias.
unbind (line 150)

Disconnect from LDAP.

NULL unbind ()

Redefined in descendants as:
unmapAttributes (line 1224)

Map attributes defined within this library their their real world counterparts.

  • access: protected
NULL unmapAttributes ( &$data, array $data)
  • array $data: The data that has been read and needs to be mapped.
  • &$data
_add (line 248)

Add a new object

  • return: True if adding succeeded.
boolean _add (string $dn, array $data)
  • string $dn: The DN of the object to be added.
  • array $data: The attributes of the object to be added.

Redefined in descendants as:
_attrsForFilter (line 669)

Identify attributes for the first object found using a filter.

  • return: The DN or false if there was no result.
mixed|PEAR_Error _attrsForFilter (string $filter, array $attrs, [int $restrict = KOLAB_SERVER_RESULT_SINGLE])
  • string $filter: The LDAP filter to use.
  • array $attrs: The attributes to retrieve.
  • int $restrict: A KOLAB_SERVER_RESULT_* result restriction.
_attrsFromResult (line 497)

Get the attributes of the first result entry.

  • return: The attributes or false if there were no results.
mixed|PEAR_Error _attrsFromResult (array $result, array $attrs, [int $restrict = KOLAB_SERVER_RESULT_SINGLE])
  • array $result: The LDAP search result.
  • array $attrs: The attributes to retrieve.
  • int $restrict: A KOLAB_SERVER_RESULT_* result restriction.
_bind (line 114)

Binds the LDAP connection with a specific user and pass.

  • return: Whether or not the binding succeeded.
boolean|PEAR_Error _bind ([string $dn = false], [string $pw = ''])
  • string $dn: DN to bind with
  • string $pw: Password associated to this DN.

Redefined in descendants as:
_connect (line 67)

Connects to the LDAP server.

  • return: True if the connection succeeded.
boolean|PEAR_Error _connect ([string $server = null], [string $base_dn = null])
  • string $server: LDAP server URL.
  • string $base_dn: LDAP server base DN.
_count (line 269)

Count the number of results.

  • return: The number of records found.
int _count (string $result)
  • string $result: The LDAP search result.

Redefined in descendants as:
_determineType (line 571)

Determine the type of a Kolab object.

  • return: The corresponding Kolab object type.
int _determineType (string $dn)
  • string $dn: The DN of the object to examine.

Redefinition of:
Horde_Kolab_Server::_determineType()
Determine the type of a Kolab object.
_dnForFilter (line 647)

Identify the DN for the first object found using a filter.

  • return: The DN or false if there was no result.
mixed|PEAR_Error _dnForFilter (string $filter, [int $restrict = KOLAB_SERVER_RESULT_SINGLE])
  • string $filter: The LDAP filter to use.
  • int $restrict: A KOLAB_SERVER_RESULT_* result restriction.
_dnFromResult (line 447)

Identify the DN of the first result entry.

  • return: The DN.
string|PEAR_Error _dnFromResult (array $result, [int $restrict = KOLAB_SERVER_RESULT_SINGLE])
  • array $result: The LDAP search result.
  • int $restrict: A KOLAB_SERVER_RESULT_* result restriction.
_errno (line 375)

Return the current LDAP error number.

  • return: The current LDAP error number.
int _errno ()

Redefined in descendants as:
_error (line 385)

Return the current LDAP error description.

  • return: The current LDAP error description.
string _error ()

Redefined in descendants as:
_firstEntry (line 305)

Return the first entry of a result.

  • return: The first entry of the result.
resource _firstEntry (resource $result)
  • resource $result: The LDAP search result.

Redefined in descendants as:
_generateUid (line 1070)

Generates a UID for the given information.

  • return: The DN.
string|PEAR_Error _generateUid (string $type, string $id, array $info)
  • string $type: The type of the object to create.
  • string $id: The id of the object.
  • array $info: Any additional information about the object to create.

Redefinition of:
Horde_Kolab_Server::_generateUid()
Generates a UID for the given information.
_getAttributes (line 293)

Return the attributes of an entry.

  • return: The attributes of the entry.
array _getAttributes (resource $entry)
  • resource $entry: The LDAP entry.

Redefined in descendants as:
_getDn (line 281)

Return the dn of an entry.

  • return: The DN of the entry.
string _getDn (resource $entry)
  • resource $entry: The LDAP entry.

Redefined in descendants as:
_getDns (line 415)

Return the DNs of a result.

  • return: The DNs of the result.
array _getDns (resource $result, [int $from = -1], [int $to = -1])
  • resource $result: The LDAP search result.
  • int $from: Only return results after this position.
  • int $to: Only return results until this position.
_getEntries (line 331)

Return the entries of a result.

  • return: The entries of the result.
array _getEntries (resource $result, [int $from = -1], [int $to = -1])
  • resource $result: The LDAP search result.
  • int $from: Only return results after this position.
  • int $to: Only return results until this position.

Redefined in descendants as:
_getObjectClasses (line 624)

Get the LDAP object classes for the given DN.

  • return: An array of object classes.
array|PEAR_Error _getObjectClasses (string $dn)
  • string $dn: DN of the object.
_listObjects (line 983)

List all objects of a specific type

  • return: An array of Kolab objects.
array|PEAR_Error _listObjects (string $type, [array $params = null])
  • string $type: The type of the objects to be listed
  • array $params: Additional parameters.

Redefinition of:
Horde_Kolab_Server::_listObjects()
List all objects of a specific type
_nextEntry (line 317)

Return the next entry of a result.

  • return: The next entry of the result.
resource _nextEntry (resource $entry)
  • resource $entry: The current LDAP entry.

Redefined in descendants as:
_read (line 203)

Read object data.

  • return: An array of attributes.
array|PEAR_Error _read (string $dn, [string $attrs = null])
  • string $dn: The object to retrieve.
  • string $attrs: Restrict to these attributes.

Redefinition of:
Horde_Kolab_Server::_read()
Stub for reading object data.

Redefined in descendants as:
_search (line 170)

Search for an object.

  • return: A LDAP search result.
array|PEAR_Error _search (string $filter, [array $attributes = null], [string $base = null])
  • string $filter: Filter criteria.
  • array $attributes: Restrict the search result to these attributes.
  • string $base: The base location for searching.

Redefined in descendants as:
_sort (line 365)

Sort the entries of a result.

  • return: True if sorting succeeded.
boolean _sort (resource $result, string $attribute)
  • resource $result: The LDAP search result.
  • string $attribute: The attribute used for sorting.

Redefined in descendants as:

Inherited Methods

Inherited From Horde_Kolab_Server

 Horde_Kolab_Server::Horde_Kolab_Server()
 Horde_Kolab_Server::add()
 Horde_Kolab_Server::addrsForIdOrMail()
 Horde_Kolab_Server::factory()
 Horde_Kolab_Server::fetch()
 Horde_Kolab_Server::generateUid()
 Horde_Kolab_Server::getBaseUid()
 Horde_Kolab_Server::getGroups()
 Horde_Kolab_Server::gidForAttr()
 Horde_Kolab_Server::gidForMail()
 Horde_Kolab_Server::listHash()
 Horde_Kolab_Server::listObjects()
 Horde_Kolab_Server::mailForIdOrMail()
 Horde_Kolab_Server::memberOfGroupAddress()
 Horde_Kolab_Server::read()
 Horde_Kolab_Server::save()
 Horde_Kolab_Server::singleton()
 Horde_Kolab_Server::store()
 Horde_Kolab_Server::uidForAlias()
 Horde_Kolab_Server::uidForAttr()
 Horde_Kolab_Server::uidForId()
 Horde_Kolab_Server::uidForIdOrMail()
 Horde_Kolab_Server::uidForMail()
 Horde_Kolab_Server::uidForMailAddress()
 Horde_Kolab_Server::uidForMailOrAlias()
 Horde_Kolab_Server::uidForMailOrIdOrAlias()
 Horde_Kolab_Server::_determineType()
 Horde_Kolab_Server::_generateUid()
 Horde_Kolab_Server::_listObjects()
 Horde_Kolab_Server::_read()

Documentation generated on Sun, 30 Jan 2011 05:19:08 +0000 by phpDocumentor 1.4.3