Method |
Description |
|
encode ( string $value, string $toEncoding ) : string |
Encode a string for LDAP with a specific encoding type. |
|
escapeValue ( mixed $value, null | string $ignore = null, null | integer $flags = null ) : string |
Escape any special characters for LDAP to their hexadecimal representation. |
|
explodeDn ( string $dn, integer $withAttributes = 1 ) : array |
Converts a string distinguished name into its separate pieces. |
|
getAliasAndAttribute ( string $attribute ) : array |
Given an attribute, split it between its alias and attribute. This will return an array where the first value
is the alias and the second is the attribute name. If there is no alias then the first value will be null. |
|
getLdapServersForDomain ( string $domain ) : string[] |
Get an array of all the LDAP servers for a domain by querying DNS. |
|
getLdapSslCertificates ( string $server, integer $port = 389 ) : array |
Get an array containing the SSL certificates of the LDAP server. This runs over the standard LDAP port and
initiates a TlsStart operation. |
|
getRdnFromDn ( string $dn ) : string |
Given a full escaped DN return the RDN in escaped form. |
|
implodeDn ( array $dn ) : string |
Given a DN as an array in ['cn=Name', 'ou=Employees', 'dc=example', 'dc=com'] form, return it as its string
representation that is safe to pass back to a query or to save back to LDAP for a DN. |
|
isBinary ( string $value ) : boolean |
Check if a string contains non-printable, and likely binary, data. There is no easy way to do this, as there can
really only be a best effort attempt to detect it. |
|
isValidAttributeFormat ( string $value ) : boolean |
Determine whether a value is a valid attribute name or OID. The name should meet the format described in RFC 2252. |
|
isValidGuid ( string $value ) : boolean |
Determine whether a value is in valid GUID format. |
|
isValidLdapObjectDn ( string $dn ) : boolean |
Given a string, try to determine if it is a valid distinguished name for a LDAP object. This is a somewhat
unsophisticated approach. A regex might be a better solution, but would probably be rather difficult to get
right. |
|
isValidSid ( string $value ) : boolean |
Determine whether a value is in SID format. |
|
sanitizeAttributeArray ( array $attributes ) : array |
Sanitizes certain values in an attribute key => value array to make them safe for logging (ie. mask passwords,
replace binary data). |
|
sanitizeBatchArray ( array $batches ) : array |
Sanitizes certain values in a batch array to make them safe for logging (ie. mask passwords, replace binary data). |
|
unescapeValue ( string $value ) : string |
Un-escapes a value from its hexadecimal form back to its string representation. |
|
uuid4 ( ) : string |
Generate a UUIDv4 string. |
|