\Horde_Kolab_Server_Ldap_Standard

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

Copyright 2008-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()
connectGuid()
getGuid()
getBaseGuid()
read()
readAttributes()
find()
save()
add()
delete()
rename()
getSchema()
getParentGuid()
findBelow()
No public properties found
No constants found
_search()
No protected properties found
N/A
No private methods found
$_guid
$_conn
$_base_dn
N/A

Properties

$_guid

$_guid : string|boolean

The GUID of the current user.

Type

string|boolean

$_conn

$_conn : \Horde_Kolab_Server_Connection

LDAP connection handle.

Type

\Horde_Kolab_Server_Connection

$_base_dn

$_base_dn : string

Base DN of the LDAP server.

Type

string

Methods

__construct()

__construct(\Horde_Kolab_Server_Connection  $connection, string  $base_dn) 

Constructor.

Parameters

\Horde_Kolab_Server_Connection $connection

The LDAP connection.

string $base_dn

The LDAP server base DN.

connectGuid()

connectGuid(string  $guid = '', string  $pass = '') : \NULL.

Connect to the server.

Parameters

string $guid

The global unique id of the user.

string $pass

The password.

Throws

\Horde_Kolab_Server_Exception

If the connection failed.

Returns

\NULL.

getGuid()

getGuid() : string

Get the current GUID

Returns

string —

The GUID of the connected user.

getBaseGuid()

getBaseGuid() : string

Get the base GUID of this server

Returns

string —

The base GUID of this server.

read()

read(string  $guid) : array

Low level access to reading object data.

This function provides direct access to the Server data.

Usually you should use

$object = $server->fetch('a server uid'); $variable = $object['attribute']

to access object attributes. This is slower but takes special object handling into account (e.g. custom attribute parsing).

Parameters

string $guid

The object to retrieve.

Throws

\Horde_Kolab_Server_Exception

If the search operation hit an error or returned no result.

Returns

array —

An array of attributes.

readAttributes()

readAttributes(string  $guid, string  $attrs) : array

Low level access to reading some object attributes.

Parameters

string $guid

The object to retrieve.

string $attrs

Restrict to these attributes.

Throws

\Horde_Kolab_Server_Exception

If the search operation hit an error or returned no result.

Returns

array —

An array of attributes.

find()

find(string  $query, array  $params = array()) : \Horde_Kolab_Server_Result

Finds object data matching a given set of criteria.

Parameters

string $query

The LDAP search query

array $params

Additional search parameters.

Throws

\Horde_Kolab_Server_Exception

Returns

\Horde_Kolab_Server_Result —

The result object.

save()

save(\Horde_Kolab_Server_Object  $object, array  $data) : NULL

Modify existing object data.

Parameters

\Horde_Kolab_Server_Object $object

The object to be modified.

array $data

The attributes of the object to be stored.

Throws

\Horde_Kolab_Server_Exception

Returns

NULL

add()

add(\Horde_Kolab_Server_Object  $object, array  $data) : NULL

Add new object data.

Parameters

\Horde_Kolab_Server_Object $object

The object to be added.

array $data

The attributes of the object to be added.

Throws

\Horde_Kolab_Server_Exception

Returns

NULL

delete()

delete(string  $guid) : NULL

Delete an object.

Parameters

string $guid

The UID of the object to be deleted.

Throws

\Horde_Kolab_Server_Exception

Returns

NULL

rename()

rename(string  $guid, string  $new) : NULL

Rename an object.

Parameters

string $guid

The UID of the object to be renamed.

string $new

The new UID of the object.

Throws

\Horde_Kolab_Server_Exception

Returns

NULL

getSchema()

getSchema() : \Horde_Ldap_Schema

Return the ldap schema.

Throws

\Horde_Kolab_Server_Exception

If retrieval of the schema failed.

Returns

\Horde_Ldap_Schema —

The LDAP schema.

getParentGuid()

getParentGuid(string  $guid) : string

Get the parent GUID of this object.

Parameters

string $guid

The GUID of the child.

Returns

string —

the parent GUID of this object.

findBelow()

findBelow(string  $query, string  $parent, array  $params = array()) : \Horde_Kolab_Server_Result

Finds all object data below a parent matching a given set of criteria.

Parameters

string $query

The LDAP search query

string $parent

The parent to search below.

array $params

Additional search parameters.

Throws

\Horde_Kolab_Server_Exception

Returns

\Horde_Kolab_Server_Result —

The result object.

_search()

_search(string  $filter, array  $params, string  $base) : array

Search for object data.

Parameters

string $filter

The LDAP search filter.

array $params

Additional search parameters.

string $base

The search base

Throws

\Horde_Kolab_Server_Exception

If the search operation encountered a problem.

Returns

array —

The result array.