Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
Ldap Class Reference

Public Member Functions

 Ldap ($h=null, $p=null, $pass=null, $bdn='')
 
 connect ($h, $p=null)
 
 bind ($bdn='', $pass=null)
 
 disconnect ()
 
 connectAsUser ($bdn, $pass)
 
 search ($startdn, $filter, $sort_by=null, $multi_level=true, $multi_result=true, $attributes=Array())
 
 getEntries ($result, $binary_attributes=Array())
 
 getNumEntries ($result)
 
 addEntry ($dn, $details)
 
 modifyEntry ($dn, $details)
 
 deleteEntry ($dn)
 
 escape_filter_value ($str)
 

Data Fields

 $host = ''
 
 $port = 0
 
 $ptr = null
 

Detailed Description

Definition at line 29 of file ldap.inc.

Member Function Documentation

addEntry (   $dn,
  $details 
)

Insert an entry into LDAP

Parameters
string$dnthe level to add the entry at
array$detailsthe details for new entry
Returns
boolean public

Definition at line 290 of file ldap.inc.

bind (   $bdn = '',
  $pass = null 
)

Bind to a LDAP server

Parameters
string$bdnthe DN used to bind to the LDAP server
string$passthe password used to connect to the LDAP server
Returns
boolean public

Definition at line 118 of file ldap.inc.

connect (   $h,
  $p = null 
)

Connect to a certain LDAP server and bind to it

Parameters
string$hthe host used to connect to the LDAP server
int$pthe port used to connect to the LDAP server
Returns
boolean public

Definition at line 85 of file ldap.inc.

connectAsUser (   $bdn,
  $pass 
)

Connect to a certain LDAP server and bind to it as a particular user

Parameters
string$bdnthe root DN used to connect to the LDAP server
string$passthe password used to connect to the LDAP server
Returns
boolean public

Definition at line 168 of file ldap.inc.

deleteEntry (   $dn)

Delete an entry from LDAP

Parameters
string$dnthe DN of the entry to delete
Returns
boolean public

Definition at line 328 of file ldap.inc.

disconnect ( )

Disconnect from the LDAP server

Returns
boolean public

Definition at line 149 of file ldap.inc.

escape_filter_value (   $str)

Escapes the given string according to RFC 2254 so that they can be safely used in LDAP filters.

Parameters
string$strthe string to escape
Returns
string public

Definition at line 346 of file ldap.inc.

getEntries (   $result,
  $binary_attributes = Array() 
)

Get the entries in a given search result in a multi-dim array

Parameters
resource$resultthe search result identifier
array$binary_attributesthe attributes that need to be extracted under binary format
Returns
array public

Definition at line 222 of file ldap.inc.

getNumEntries (   $result)

Return the number of entries in a given search result

Parameters
resource$resultthe search result identifier
Returns
int public

Definition at line 273 of file ldap.inc.

Ldap (   $h = null,
  $p = null,
  $pass = null,
  $bdn = '' 
)

Constructor

Parameters
string$hthe host used to connect to the LDAP server
int$pthe port used to connect to the LDAP server
string$passthe password used to connect to the LDAP server
string$bdnthe DN used to bind to the LDAP server

Definition at line 65 of file ldap.inc.

modifyEntry (   $dn,
  $details 
)

Modify an LDAP entry

Parameters
string$dnthe DN of the entry to modify
array$detailsthe new details for entry
Returns
boolean public

Definition at line 310 of file ldap.inc.

search (   $startdn,
  $filter,
  $sort_by = null,
  $multi_level = true,
  $multi_result = true,
  $attributes = Array() 
)

Search the server starting at $startdn using $filter

Parameters
string$startdnthe DN to start searching at
string$filtersearch filter
boolean$multi_levelsearch multiple levels
boolean$multi_resultsearch for multiple entries
array$attributesarray of the attributes we want to return for the returned objects
Returns
resource (search result identifier) | zero (on error) public

Definition at line 189 of file ldap.inc.


The documentation for this class was generated from the following file: