Provides an interface to a Lightweight Directory Access Protocol (LDAP) directory server, such as the Netscape Directory Server.
Forms tags, Internet Protocol tags
<cfldap server = "server_name" port = "port_number" username = "name" password = "password" action = "action" name = "name" timeout = "seconds" maxRows = "number" start = "distinguished_name" scope = "scope" attributes = "attribute, attribute" filter = "filter" sort = "attribute[, attribute]..." sortControl = "nocase" and/or "desc" or "asc" dn = "distinguished_name" startRow = "row_number" modifyType = "replace" or "add" or "delete" rebind = "Yes" or "No" referral = "number_of_allowed_hops" secure = "multi_field_security_string" separator = "separator_character" delimiter = "delimiter_character">
cfftp, cfhttp, cfmail, cfmailparam, cfpop
name attribute.
sort and sortcontrol attributes.) filterconfig and filterfile attributes are deprecated. Do not use them in new applications. They might not work, and might cause an error, in later releases. If they are used, this tag throws an exception.
If you use the query action, cfldap creates a query object, allowing access to information in the query variables, as follows:
| Variable name | Description |
|---|---|
queryname.recordCount |
Number of records returned by query |
queryname.currentRow |
Current row of query that cfoutput is processing |
queryname.columnList |
Column names in query |
To use the security = "CFSSL_BASIC" option, you must copy the cert7.db and/or key3.db key files to the default directory location of a user-installed LDAP directory; on Windows, the directory is C:\cfusion\ldap.
The security certificate encrypts conversation. The server always sends a digital certificate to confirm the server.
Characters that are illegal in ColdFusion can be used in LDAP attribute names. As a result, the cfldap tag could create columns in the query result set whose names contain illegal characters and are, therefore, inaccessible in CFML. In ColdFusion, illegal characters are automatically mapped to the underscore character; therefore, column names in the query result set might not exactly match the names of the LDAP attributes.
For usage examples, see Developing ColdFusion MX Applications with CFML.
<h3>cfldap Example</h3>
<p>Provides an interface to LDAP directory servers like BigFoot
(<a href = "http://www.bigfoot.com">http://www.bigfoot.com</A>).
<p>Enter a name (try your own name) and search a public LDAP resource.
<!--- If the server has been defined, run the query --->
<cfif IsDefined("form.server")>
<!--- check to see that there is a name listed --->
<cfif form.name is not "">
<!--- make the LDAP query --->
<cfldap server = "ldap.bigfoot.com"
action = "query"
name = "results"
start = "cn = #name#,c = US"
filter = "(cn = #name#)"
attributes = "cn,o,l,st,c,mail,telephonenumber"
sort = "cn ASC">
<!--- Display results --->
<center>
<table border = 0 cellspacing = 2 cellpadding = 2>
<tr>
<th colspan = 5>
<cfoutput>#results.recordCount# matches found
</cfoutput></TH>
</tr>
<tr>
<th><font size = "-2">Name</font></TH>
<th><font size = "-2">Organization</font></TH>
<th><font size = "-2">Location</font></TH>
<th><font size = "-2">E-Mail</font></TH>
<th><font size = "-2">Phone</font></TH>
</tr>
<cfoutput query = "results">
<tr>
<td><font size = "-2">#cn#</font></td>
<td><font size = "-2">#o#</font></td>
<td><font size = "-2">#l#, #st#, #c#</font></td>
<td><font size = "-2">
<A href = "mailto:#mail#">#mail#</A></font></td>
<td><font size = "-2">#telephonenumber#</font></td>
</tr>
</cfoutput>
</table>
</center>
</cfif>
</cfif>
ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting
Version 6
Comments are no longer accepted for ColdFusion MX. ColdFusion 8 is the current version.
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/coldfusion/6/CFML_Reference/Tags-pt165.htm
Comments
rbils@amkor.com said on Jun 27, 2002 at 8:35 PM : rbils@amkor.com said on Jun 27, 2002 at 8:51 PM : sgilson102 said on Jul 1, 2002 at 8:00 PM : ctina said on Jul 19, 2002 at 8:28 PM : draum said on Aug 23, 2002 at 8:31 PM : devin said on Apr 23, 2003 at 8:10 PM : uzma said on May 1, 2003 at 6:04 AM : Olivier Boël said on May 8, 2003 at 10:57 AM : Olivier Boël said on May 17, 2003 at 10:08 AM : mwaddell said on Aug 12, 2003 at 8:00 AM :