function
|
Library: LDAP support (OMLDAP)
Import : omldap.xmd |
Returns: the value of a specified attribute |
define external stream function ldap.reader
of value ldap.attribute attribute
item value integer index optional
null value string null optional
using value integer datatype optional
Argument definitions
If an index is not specified, this function returns the first value of the specified attribute, otherwise it returns the specified one.
The following example outputs the telephone number for each entry satisfying the search. Each entry is assumed to have a single telephone number.
import "omldap.xmd" prefixed by ldap. process local ldap.connection my-ldap local ldap.attribute my-entry variable set my-ldap to ldap.open 'www.stilo.com' ldap.search my-ldap base "o=stilo.com" where "(Department=RD)" into my-entry select "phonenumber" repeat exit unless ldap.entry-exists my-entry output ldap.entry-name of my-entry || ": " || ldap.reader of my-entry{"phonenumber"} || "%n" ldap.advance-entry my-entry again
ldap.retrieve-values can be used when an attribute contains an unknown number of values.