home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 1999 April / APC443.iso / features / grpware / coldfus / coldfusi.exe / data1.cab / Documentation / snippets / cfldap.cfm < prev    next >
Encoding:
Text File  |  1998-10-08  |  2.0 KB  |  80 lines

  1. <!---  This example shows the use of CFLDAP --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>CFLDAP Example</TITLE>
  5. </HEAD>
  6.  
  7. <BODY bgcolor=silver>
  8. <H3>CFLDAP Example</H3>
  9.  
  10. <P>CFLDAP provides an interface to LDAP 
  11. (Lightweight Directory Access Protocol) directory
  12. servers like BigFoot (<a href="http://www.bigfoot.com">http://www.bigfoot.com</A> and Four11 (<a href="http://www.four11.com">http://www.four11.com</A>).
  13.  
  14. <P>Enter a name (try your own name) and search a public
  15. LDAP resource.
  16.  
  17. <FORM ACTION="cfldap.cfm" METHOD="POST">
  18. <TABLE BORDER=0 CELLSPACING=2 CELLPADDING=2>
  19. <TR>
  20.  <TH ALIGN="RIGHT">Name:</TH>
  21.  <TD><INPUT TYPE="text" NAME="name"></TD>
  22. </TR>
  23. <TR>
  24.  <TH ALIGN="RIGHT">Server:</TH>
  25.  <TD>
  26.   <SELECT NAME="server">
  27.        <OPTION VALUE="Four11">Four11
  28.   </SELECT>
  29.  </TD>
  30. </TR>
  31. <TR>
  32.  <TH COLSPAN=2><INPUT TYPE="submit" VALUE="Search"></TH>
  33. </TR>
  34. </TABLE>
  35. </FORM>
  36.  
  37. <!--- If the server has been defined, run the query --->
  38. <CFIF IsDefined("form.server")>
  39. <!--- check to see that there is a name listed --->
  40. <CFIF form.name is not "">
  41. <!--- make the LDAP query --->
  42. <CFLDAP
  43.  SERVER="ldap.four11.com"
  44.  ACTION="QUERY"
  45.  NAME="results"
  46.  START="cn=#name#,c=US"
  47.  FILTER="(cn=#name#)"
  48.  ATTRIBUTES="cn,o,l,st,c,mail,telephonenumber"
  49.  SORT="cn ASC">
  50.  
  51. <!--- Display results --->
  52.     <CENTER>
  53.     <TABLE BORDER=0 CELLSPACING=2 CELLPADDING=2>
  54.      <TR>
  55.           <TH COLSPAN=5><CFOUTPUT>#results.RecordCount# matches found</CFOUTPUT></TH>
  56.      </TR>
  57.      <TR>
  58.           <TH><FONT SIZE="-2">Name</FONT></TH>
  59.           <TH><FONT SIZE="-2">Organization</FONT></TH>
  60.           <TH><FONT SIZE="-2">Location</FONT></TH>
  61.           <TH><FONT SIZE="-2">E-Mail</FONT></TH>
  62.           <TH><FONT SIZE="-2">Phone</FONT></TH>
  63.      </TR>
  64.     <CFOUTPUT QUERY="results">
  65.      <TR>
  66.           <TD><FONT SIZE="-2">#cn#</FONT></TD>
  67.           <TD><FONT SIZE="-2">#o#</FONT></TD>
  68.           <TD><FONT SIZE="-2">#l#, #st#, #c#</FONT></TD>
  69.           <TD><FONT SIZE="-2"><A HREF="mailto:#mail#">#mail#</A></FONT></TD>
  70.           <TD><FONT SIZE="-2">#telephonenumber#</FONT></TD>
  71.      </TR>
  72.     </CFOUTPUT>
  73.     </TABLE>
  74.     </CENTER>
  75. </CFIF>
  76. </CFIF>
  77.  
  78. </BODY>
  79. </HTML>       
  80.