PHP Class Horde_Kolab_Server_Connection_Mock_Ldap, horde

Copyright 2008-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
ファイルを表示 Open project: horde/horde Class Usage Examples

Public Methods

Method Description
__construct ( array $params, array $data ) Constructor.
add ( Horde_Ldap_Entry $entry ) : Horde_Ldap_Error | true Add a new entryobject to a directory.
bind ( string $dn = '', string $pw = '' ) : null Binds the LDAP connection with a specific user and pass.
delete ( string $uid ) : null Delete an object.
doSearch ( array $filter, array $attributes = null ) : array Perform the search.
getEntries ( array $result ) : mixed Return the entries of a result.
getEntry ( string $dn, array $attr = [] ) : Horde_Ldap_Entry | Horde_Ldap_Error Get a specific entry based on the DN
modify ( $entry, $data = [] ) : Horde_Ldap_Error | true Modify an ldapentry directly on the server
move ( string $uid, string $new ) : null Rename an object.
parse ( string $filter ) : array Parse LDAP filter.
parseSub ( string $filter ) : array Parse a LDAP subfilter.
schema ( )
search ( string $base = null, string $filter = null, string $params = [] ) : array Search for object data.

Protected Methods

Method Description
toStorage ( array $data ) : array Rewrite a data array to our internal storage format.

Private Methods

Method Description
_checkBound ( ) : null Check if the current connection is bound.

Method Details

__construct() public method

Constructor.
public __construct ( array $params, array $data )
$params array Connection parameters.
$data array Mockup LDAP data.

add() public method

Add a new entryobject to a directory.
public add ( Horde_Ldap_Entry $entry ) : Horde_Ldap_Error | true
$entry Horde_Ldap_Entry Horde_Ldap_Entry
return Horde_Ldap_Error | true Horde_Ldap_Error object or true

bind() public method

Binds the LDAP connection with a specific user and pass.
public bind ( string $dn = '', string $pw = '' ) : null
$dn string DN to bind with
$pw string Password associated to this DN.
return null

delete() public method

Delete an object.
public delete ( string $uid ) : null
$uid string The UID of the object to be deleted.
return null

doSearch() public method

Perform the search.
public doSearch ( array $filter, array $attributes = null ) : array
$filter array Filter criteria-
$attributes array Restrict the search result to these attributes.
return array A LDAP serach result.

getEntries() public method

Return the entries of a result.
public getEntries ( array $result ) : mixed
$result array The LDAP search result.
return mixed The entries of the result or false.

getEntry() public method

Get a specific entry based on the DN
public getEntry ( string $dn, array $attr = [] ) : Horde_Ldap_Entry | Horde_Ldap_Error
$dn string DN of the entry that should be fetched
$attr array Array of Attributes to select. If ommitted, all attributes are fetched.
return Horde_Ldap_Entry | Horde_Ldap_Error Reference to a Horde_Ldap_Entry object or Horde_Ldap_Error object

modify() public method

Modify an ldapentry directly on the server
public modify ( $entry, $data = [] ) : Horde_Ldap_Error | true
return Horde_Ldap_Error | true Horde_Ldap_Error object or true

move() public method

Rename an object.
public move ( string $uid, string $new ) : null
$uid string The UID of the object to be renamed.
$new string The new UID of the object.
return null

parse() public method

Partially derived from Net_LDAP_Filter.
public parse ( string $filter ) : array
$filter string The filter string.
return array An array of the parsed filter.

parseSub() public method

Parse a LDAP subfilter.
public parseSub ( string $filter ) : array
$filter string The subfilter string.
return array An array of the parsed subfilter.

schema() public method

public schema ( )

toStorage() protected method

Rewrite a data array to our internal storage format.
protected toStorage ( array $data ) : array
$data array The attributes of the object to be added/replaced.
return array The transformed data set.