Tariqa  3.0
 All Data Structures Namespaces Files Functions Variables Enumerations
mLDAP Class Reference
Inheritance diagram for mLDAP:
EC_LDAP

Public Member Functions

 __construct ($server, $port=389)
 connect ($username=false, $password=false)
 close ()
 setHost ($server, $port=389)
 search ($basedn, $filter, $attributes)
 error ()
 errno ()

Static Public Member Functions

static entryToArray ($ldap_entry)
static hasAttribute ($ldap_entry, $attribute)
static testAttribute ($ldap_entry, $attribute, $value)
static hasAttributeI ($ldap_entry, $attribute)
static testAttributeI ($ldap_entry, $attribute, $value)

Data Fields

 $server
 $port
 $max_results = 0
 $max_time = 0
 $deref = LDAP_DEREF_NEVER

Protected Attributes

 $hldap

Constructor & Destructor Documentation

__construct ( server,
port = 389 
)

Initialize the mLDAP object

Parameters:
string$serverLDAP Server host
int$portLDAP Server's port

Member Function Documentation

close ( )

Close the connection with the server

connect ( username = false,
password = false 
)

Connect to the server

Parameters:
string$usernameThe username to use to connect to the LDAP server, or false for anonymous connection
string$passwordThe password to use to connect to the LDAP server, or false for anonymous connection
Returns:
boolean True on success, false otherwise

Reimplemented in EC_LDAP.

static entryToArray ( ldap_entry) [static]

"Converts" an LDAP attributes array into a classical PHP array

Parameters:
array$ldap_entryan entry returned by a call to ldap_search
Returns:
a PHP array simplifying the ldap entry
errno ( )

Get the last LDAP error code

Returns:
integer
error ( )

Get the last LDAP error message

Returns:
string
static hasAttribute ( ldap_entry,
attribute 
) [static]

Test if an attribute exists in the LDAP entry

Parameters:
array$ldap_entryThe LDAP entry, as returned by
See also:
search or
entryToArray
Parameters:
string$attributeThe name of the attribute to search for
Returns:
boolean
static hasAttributeI ( ldap_entry,
attribute 
) [static]

Test if an attribute exists in the LDAP entry (Case Insensitive!)

Parameters:
array$ldap_entryThe LDAP entry, as returned by
See also:
search or
entryToArray
Parameters:
string$attributeThe name of the attribute to search for
Returns:
boolean
search ( basedn,
filter,
attributes 
)

Execute a Search operation and return its results in an array

Parameters:
string$basednBase DN
string$filterFilter
array$attributesAn array of attribute names to retreive (this array should be numerically indexed)
Returns:
mixed An array of entries on success, or false on error.
setHost ( server,
port = 389 
)

Select a different LDAP server than the one set by the constructor (implicitelly closes the current connection)

Parameters:
string$serverLDAP Server host
int$portLDAP Server's port
static testAttribute ( ldap_entry,
attribute,
value 
) [static]

Test if an attribute exists in the LDAP entry, and if it haves a given value

Parameters:
array$ldap_entryThe LDAP entry, as returned by
See also:
search or
entryToArray
Parameters:
string$attributeThe name of the attribute to search for
string$valueThe value amongst which to test the attributes
Returns:
boolean
static testAttributeI ( ldap_entry,
attribute,
value 
) [static]

Test if an attribute exists in the LDAP entry, and if it haves a given value (Case Insensitive!)

Parameters:
array$ldap_entryThe LDAP entry, as returned by
See also:
search or
entryToArray
Parameters:
string$attributeThe name of the attribute to search for
string$valueThe value amongst which to test the attributes
Returns:
boolean

Field Documentation

$deref = LDAP_DEREF_NEVER
$hldap [protected]
$max_results = 0
$max_time = 0
$port
$server

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