home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / cfauthenticate.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  1.1 KB  |  41 lines

  1. <!--- This view-only example shows the use of CFAUTHENTICATE
  2. in an Application.cfm file --->
  3. <HTML>
  4. <HEAD>
  5. <TITLE>CFAUTHENTICATE Example</TITLE>
  6. </HEAD>
  7.  
  8. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  9. <BODY  bgcolor="#FFFFD5">
  10.  
  11. <H3>CFAUTHENTICATE Example</H3>
  12. <P>The CFAUTHENTICATE tag authenticates a user and sets the
  13. security context for an application.
  14. <P>Code this tag in the Application.cfm file to set a
  15. security context for your application. 
  16. <P>This is a view-only example. Refer to the commented
  17. source code to see what you might code for 
  18. CFAUTHENTICATE.
  19.  
  20. <!--- This code is from an Application.cfm file --->
  21. <!---
  22. <CFIF NOT IsAuthenticated()>
  23.   <CFTRY>
  24.   <CFAUTHENTICATE SECURITYCONTEXT="Allaire" USERNAME=#user#
  25.     PASSWORD=#pwd#>
  26.   <CFCATCH TYPE="Security">
  27.   <H3>Authentication error</H3>
  28.     <CFOUTPUT> --->
  29.     <!--- Display the message. Alternatively, you might place
  30.       code here to define the user to the security domain. --->
  31. <!---
  32.     <P>#CFCATCH.message#
  33.     </CFOUTPUT>
  34.   </CFCATCH>
  35.   </CFTRY>
  36. </CFIF>
  37. <CFAPPLICATION NAME="Personnel">
  38. --->
  39.  
  40. </BODY>
  41. </HTML>