ColdFusion 9.0 Resources |
cfldapDescriptionProvides an interface to a Lightweight Directory Access Protocol (LDAP) directory server, such as the Netscape Directory Server. Syntax<cfldap action = "action" server = "server name" attributes = "attribute, attribute" delimiter = "delimiter character" dn = "distinguished name" filter = "filter" maxRows = "number" modifyType = "replace|add|delete" name = "name" password = "password" port = "port number" rebind = "yes|no" referral = "number of allowed hops" returnAsBinary = "column name, column name" scope = "scope" secure = "multifield security string" separator = "separator character" sort = "attribute[, attribute]..." sortControl = "nocase|desc|asc" start = "distinguished name" startRow = "row number" timeout = "milliseconds" username = "user name"> Note: You
can specify this tag’s attributes in an attributeCollection attribute
whose value is a structure. Specify the structure name in the attributeCollection attribute
and use the tag’s attribute names as structure keys.
See alsocfftp, cfhttp, cfmail, cfmailparam, cfpop,Managing LDAP Directories in the Developing ColdFusion Applications HistoryColdFusion 8: Added the ability to use a comma as a delimiter when specifying a list of variables in the returnAsBinary attribute, for example, returnAsBinary="objectGUID,objectSID". Previously, the allowed delimiter was a space. ColdFusion MX 7: Added the returnAsBinary attribute. Added SSL V2 client based authentication; this means that ColdFusion supports the CFSSL_CLIENT_AUTH option. If CFSSL_CLIENT_AUTH is selected, ColdFusion assumes that the first certificate in the cacerts (or the certificate database) contains the Client Certificate. ColdFusion MX:
Attributes
UsageIf you use the query action, cfldap creates a query object, allowing access to information in the query variables, as follows:
If you use the security="CFSSL_BASIC" option, ColdFusion determines whether to trust the server by comparing the server’s certificate with the information in the jre/lib/security/cacerts keystore of the JRE used by ColdFusion. The ColdFusion default cacerts file contains information about many certificate granting authorities. If you must update the file with additional information, you can use the keytool utility in the ColdFusion jre/bin directory to import certificates that are in X.509 format. For example, enter the following: keytool -import -keystore cacerts -alias ldap -file ldap.crt -keypass bl19mq Then restart ColdFusion. The keytool utility initial keypass password is “change it”. For more information on using the keytool utility, see the Sun JDK documentation. 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 the Developing ColdFusion Applications. Example<h3>cfldap Example</h3> <p>Provides an interface to LDAP directory servers. The example uses the University of Connecticut public LDAP server. For more public LDAP servers, see <a href="http://www.emailman.com">http://www.emailman.com</a>.</p> <p>Enter a name and search the public LDAP resource. An asterisk before or after the name acts as a wildcard.</p> <!--- If form.name exists, the form was submitted; run the query. ---> <cfif IsDefined("form.name")> <!--- Check to see that there is a name listed. ---> <cfif form.name is not ""> <!--- Make the LDAP query. ---> <cfldap server = "ldap.uconn.edu" action = "query" name = "results" start = "dc=uconn,dc=edu" filter = "cn=#name#" attributes = "cn,o,title,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">Title</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">#title#</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> <form action="#cgi.script_name#" method="POST"> <p>Enter a name to search in the database.</p> <input type="Text" name="name"> <input type="Submit" value="Search" name=""> </form> |