WebLdapCompare Function

Action

Compares an attribute type and value with a given LDAP directory entry.

Include file

WebAPI.bdh

Syntax

WebLdapCompare( in hLdap      : number,
                in sEntry     : string,
                in sAttribute : string,
                in sValue     : string,
                in nLength    : number optional ): boolean;

Return value

  • true if the attribute type and value are equal to the specified LDAP directory entry

  • false otherwise

Parameter Description
hLdap Handle to a connection that was created by WebLdapConnect.
sEntry Name of the directory entry that will be compared with the attribute type and value
sAttribute Attribute type that will be compared with the specified LDAP directory entry
sValue Value type that will be compared with the specified LDAP directory entry
nLength Length of the value type that will be compared with the specified LDAP directory entry (optional). This parameter has to be passed to the function only if the value contains binary data

Example

dcltrans
  transaction TWebLdapCompare
  var
    hLdap : number;
    equal : boolean;
  begin
    WebLdapConnect(hLdap, "standardhost", WEB_PORT_LDAP);
    equal := WebLdapCompare(hLdap, "uid=user,o=company",
                           "attribute", "value1");
    equal := WebLdapCompare(hLdap, "uid=user,o=company",
                           "attribute", "value2");
    equal := WebLdapCompare(hLdap, "uid=user,o=company",
                           "attribute", "value3");
    WebLdapDisconnect(hLdap);
  end TWebLdapCompare;

SilkEssential sample

LDAP.sep