LassoScript Utility
Basics Browse Detail

[LDAP->Search]

Tag Link [LDAP->Search] Category LDAP
Type Member Source Available No
Support Preferred Version 8.5
Change Updated Data Source Any
Output Type None Security None
Implementation Internal Sets Lasso 8.5

Description

[LDAP->Search] performs a search on the remote LDAP server. Requires a parameter specifying the base of the query. Additional parameters specify the scope, filter, attributes, and attributes-only option for the query.

Base - The distinguished name (DN) of the entry at which to start the search. Required.

Scope - The scope of the search. Optional. This parameter should be one of the following values:
LDAP_SCOPE_BASE - Search the object itself.
LDAP_SCOPE_ONELEVEL - Search the objects immediate children.
LDAP_SCOPE_SUBTREE - Search the object and all its descendents.

Filter - The filter to apply to the search. Optional.

Attributes - An array of strings specifying the attribute types to return in the search results. Optional.
* (asterisk) may be specified in the array to indicate that all attributes are to be returned.
+ (plus sign) may be specified in the array to indicate that all operational attributes should be returned.
1.1 may be specified in the array to indicate that no attributes should be returned.

Attribute-Only - A boolean indicating that only attributes and no values should be returned. Defaults to False. Optional.

The [LDAP->Results] tag returns the result array for the search. If a referral is generated it can be found using the [LDAP->Referrals] tag. The result code for the search can be found using the [LDAP->Code] tag. A code of 0 indicates success. A value greater than 0 does not necessarily indicate an error. See the Lasso Language Guide for a list of possible result codes.

Syntax

<?LassoScript
Var: 'myLDAP' = LDAP;
$myLDAP->(Open: 'ldap.example.com');
$myLDAP->(Authenticate: 'myusername', 'mysecretpassword');
$myLDAP->(Search: 'dc=example,dc=com'; LDAP_Scope_Subtree, '(objectClass=*)');
Var: 'myResult' = $myLDAP->(Results);
$myLDAP->Close;
?>

Parameters

Required Parameters
Base The distinguished name (DN) of the entry at which to start the search.
Optional Parameters
Scope The scope of the search: LDAP_SCOPE_BASE, LDAP_SCOPE_ONELEVEL, or LDAP_SCOPE_SUBTREE.
Filter The filter to apply to the search.
Attributes An array of strings specifying the attribute types to return in the search results.
Attributes-Only A boolean indicating that only attributes and no values should be returned.

Change Notes

As of Lasso 8.5.1 this tag does not return a value. The results of the latest LDAP search can be accessed with the new [LDAP->Results] tag.

Examples

See the Lasso 8 Language Guide for examples of how to use this tag.