Property | Type | Description | |
---|---|---|---|
$authz_id | LDAP user: authz_id if SASL is in use, binding dn otherwise | ||
$ldap | resource | LDAP link identifier. | |
$timeout | integer | Timeout value, in seconds. |
Method | Description | |
---|---|---|
__construct ( $hostname, $enable_tls = true, $debug = false, $timeout, $port = 389, $referrals = true ) | TODO: Flesh out documentation | |
asc2hex32 ( string $string ) : string | Borrowed function from PEAR:LDAP. | |
bind ( string $dn, string $password, array $sasl_args = null ) : boolean | Bind to LDAP with a specific DN and password. Simple wrapper around ldap_bind() with some additional logging. | |
escape_filter_value ( array $values = [], $singleValue = true ) : array | Borrowed function from PEAR:LDAP. | |
getAttributes ( string $dn, string | array $attributes = null, integer $maxsize = null ) : array | Search a given DN for attributes, and return the resulting associative array. | |
searchfordn ( string | array $base, string | array $attribute, string $value, boolean $allowZeroHits = false, $searchFilter = null ) : string | Search for a DN. | |
searchformultiple ( string | array $bases, string | array $filters, string | array $attributes = [], boolean $and = true, boolean $escape = true ) : array | This method was created specifically for the ldap:AttributeAddUsersGroups->searchActiveDirectory() method, but could be used for other LDAP search needs. It will search LDAP and return all the entries. | |
setOption ( $option, $value ) : void | Applies an LDAP option to the current connection. | |
validate ( $config, $username, $password = null ) | TODO: Documentation; only cleared up exception/log messages | |
whoami ( $searchBase, $searchAttributes ) | ldap_exop_whoami accessor, if available. Use requested authz_id otherwise. |
Method | Description | |
---|---|---|
authzid_to_dn ( $searchBase, $searchAttributes, $authz_id ) | Convert SASL authz_id into a DN | |
makeException ( string $description, $type = null ) : Exception | Convenience method to create an LDAPException as well as log the description. | |
search ( string $base, string | array $attribute, string $value, $searchFilter = null ) : string | Search for DN from a single base. |
public __construct ( $hostname, $enable_tls = true, $debug = false, $timeout, $port = 389, $referrals = true ) |
public bind ( string $dn, string $password, array $sasl_args = null ) : boolean | ||
$dn | string | The DN used. |
$password | string | The password used. |
$sasl_args | array | Array of SASL options for SASL bind |
return | boolean | Returns TRUE if successful, FALSE if LDAP_INVALID_CREDENTIALS, LDAP_X_PROXY_AUTHZ_FAILURE, LDAP_INAPPROPRIATE_AUTH, LDAP_INSUFFICIENT_ACCESS |
public static escape_filter_value ( array $values = [], $singleValue = true ) : array | ||
$values | array | Array of values to escape |
return | array | Array $values, but escaped |
public getAttributes ( string $dn, string | array $attributes = null, integer $maxsize = null ) : array | ||
$dn | string | The DN of an element. |
$attributes | string | array | The names of the attribute(s) to retrieve. Defaults to NULL; that is, all available attributes. Note that this is not very effective. |
$maxsize | integer | The maximum size of any attribute's value(s). If exceeded, the attribute will not be returned. |
return | array | The array of attributes and their values. |
public searchfordn ( string | array $base, string | array $attribute, string $value, boolean $allowZeroHits = false, $searchFilter = null ) : string | ||
$base | string | array | The base, or bases, which to search from. |
$attribute | string | array | The attribute name(s) searched for. |
$value | string | The attribute value searched for. |
$allowZeroHits | boolean | Determines if the method will throw an exception if no hits are found. Defaults to FALSE. |
return | string | The DN of the matching element, if found. If no element was found and $allowZeroHits is set to FALSE, an exception will be thrown; otherwise NULL will be returned. |
public searchformultiple ( string | array $bases, string | array $filters, string | array $attributes = [], boolean $and = true, boolean $escape = true ) : array | ||
$bases | string | array | |
$filters | string | array | Array of 'attribute' => 'values' to be combined into the filter, or a raw filter string |
$attributes | string | array | Array of attributes requested from LDAP |
$and | boolean | If multiple filters defined, then either bind them with & or | |
$escape | boolean | Weather to escape the filter values or not |
return | array |
public validate ( $config, $username, $password = null ) |
public whoami ( $searchBase, $searchAttributes ) |
protected $authz_id |