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
}
Syntax
string ldap_get_dn(int ldapid, ldapentry entry[, boolean trace])
Description
ldap_get_dn returns the DN of the specified entry, as a string. ldapentry is a valid entry returned by a previous call to ldap_first_entry or ldap_next_entry.
If the optional trace parameter is set to true, any errors or warnings from the LDAP function are written to stdout.
Example
dnstr=ldap_get_dn(ldapid,entry;
Syntax
list ldap_get_values(int ldapid, ldapentry entry, string attr[, boolean trace] )
Description
ldap_get_values returns a list of values for the specified attribute from the given LDAP entry.
If the optional trace parameter is set to true, any errors or warnings from the LDAP function are written to stdout.
Example
values=ldap_get_values(ldapid, entry, "uid");
if (user !in values) {
reject "You are not authorized";
}