"Converts" an LDAP attributes array into a classical PHP array
static
a
entryToArray
(array $ldap_entry)
-
array
$ldap_entry: an entry returned by a call to ldap_search
Test if an attribute exists in the LDAP entry
static
boolean
hasAttribute
(array $ldap_entry, string $attribute)
-
array
$ldap_entry: The LDAP entry, as returned by @see search or @see entryToArray
-
string
$attribute: The name of the attribute to search for
Test if an attribute exists in the LDAP entry (Case Insensitive!)
static
boolean
hasAttributeI
(array $ldap_entry, string $attribute)
-
array
$ldap_entry: The LDAP entry, as returned by @see search or @see entryToArray
-
string
$attribute: The name of the attribute to search for
Test if an attribute exists in the LDAP entry, and if it haves a given value
static
boolean
testAttribute
(array $ldap_entry, string $attribute, string $value)
-
array
$ldap_entry: The LDAP entry, as returned by @see search or @see entryToArray
-
string
$attribute: The name of the attribute to search for
-
string
$value: The value amongst which to test the attributes
Test if an attribute exists in the LDAP entry, and if it haves a given value (Case Insensitive!)
static
boolean
testAttributeI
(array $ldap_entry, string $attribute, string $value)
-
array
$ldap_entry: The LDAP entry, as returned by @see search or @see entryToArray
-
string
$attribute: The name of the attribute to search for
-
string
$value: The value amongst which to test the attributes
Initialize the mldap object
mldap
__construct
(
string $server, [
int $port =
389])
-
string
$server: LDAP Server host
-
int
$port: LDAP Server's port
Redefined in descendants as:
Close the connection with the server
void
close
()
Connect to the server
boolean
connect
([string $username = false], [string $password = false])
-
string
$username: The username to use to connect to the LDAP server, or false for anonymous connection
-
string
$password: The password to use to connect to the LDAP server, or false for anonymous connection
Get the last LDAP error code
integer
errno
()
Get the last LDAP error message
string
error
()
Execute a Search operation and return its results in an array
mixed
search
(string $basedn, string $filter, array $attributes)
-
string
$basedn: Base DN
-
string
$filter: Filter
-
array
$attributes: An array of attribute names to retreive (this array should be numerically indexed)
Redefined in descendants as:
Select a different LDAP server than the one set by the constructor (implicitelly closes the current connection)
void
setHost
(string $server, [int $port = 389])
-
string
$server: LDAP Server host
-
int
$port: LDAP Server's port