Syntax
list ldap_explode_dn(string dnstr [, boolean noTypes[, boolean trace]] )
Description
ldap_explode_dn returns a list of strings composed of the elements of the specified DN. If the optional noTypes parameter is set to true, the types are stripped from the exploded values. The default for noTypes is false.
If the optional trace parameter is set to true, any errors or warnings from the LDAP function are written to stdout.
Example
dnlist=ldap_explode_dn("uid=jsmith,ou=Users,dn=directory,dn=ourdomain,dn=com");
stripped=ldap_explode_dn("uid=jsmith,ou=Users,dn=directory,dn=ourdomain,dn=com");
print(dnlist);
print(stripped);
#prints the following output
#{ uid=jsmith ou=Users dn=directory dn=ourdomain dn=com}
#{jsmith, Users, directory, ourdomain, com}
Syntax
string ldap_first_attribute(int ldapid, ldapentry entry[, boolean trace] )
Description
ldap_first_attribute returns the first attribute name in the ldapentry returned by a previous call to ldap_first_entry or ldap_next_entry.
If not present, returns an empty string. If the optional trace parameter is set to true, any errors or warnings from the LDAP function are written to stdout.
Example
str=ldap_first_attribute(ldapid, entry);
while (length(str) > 0) {
#process attribute
…
str=ldap_next_attribute(ldapid, entry);
}
Syntax
int ldap_first_entry(int ldapid, ldapresult, result[, boolean trace] )
Description
ldap_first_entry returns the first entry from the list of results returned by ldap_search if present, otherwise returns an empty entry.
If the optional trace parameter is set to true, any errors and warnings from the LDAP function are written to stdout.
Example
entry=ldap_first_entry(ldapid, searchresults);
while( entry) {
func_process_entry(entry);
entry=ldap_next_entry(ldapid, entry);
}
Syntax
list ldap_get_attributes(int ldapid, ldapentry entry[, boolean trace] )
Description
ldap_get_attributes returns the full list of attribute names in an ldapentry returned by a previous call to ldap_first_entry or ldap_next_entry.
If none are present, it returns an empty list. If the optional trace parameter is set to true, any errors or warnings from the LDAP function are written to stdout.
Example
allattributes=ldap_get_attributes(ldapid, entry);
if (selected_attribute in allattributes) {
#process matching attribute
}