Adobe ColdFusion 8

Structure code generated by the Login Wizard

The wizard generates or modifies the following files in the directory or site that you specify:

Application.cfc: If this file does not exist, the wizard creates it with a single onRequestStart method; it does not specify an application name or any other methods. If the file exists, but does not have an onRequestStart method, it adds the method. If Application.cfc and the onRequestStart method exist, the wizard inserts the required code at the beginning of the method. The resulting onRequestStart method has a cfinclude tag that specifies mm_wizard_application_include.cfm; it also has a simple form with a logout button, which will display at the top of each page in the application.

Note: If the wizard creates the Application.cfc file, you should, at least, change the file to specify the application name. For more information on Application.cfc, see Designing and Optimizing a ColdFusion Application.

mm_wizard_application_include.cfm: The Login Wizard uses the information specified in the wizard fields to set several CFC method arguments. It then uses them to invoke the performlogin method of the master login CFC, mm_wizard.authenticate.

mm_wizard_authenticate.cfc: This CFC contains all of the user authentication and login logic. The CFC consists of the following methods:

  • The ntauth, ldapauth, and simpleauth authentication methods check the user's name and ID against the valid login information, and return information about whether the user is authenticated. For the details of how they authenticate the user and the specific return values, see the methods.
  • The performLogin method is the master login method. It contains the cflogin tag, which displays the login form and calls the required authentication method. If the authentication method's return argument indicates a valid user, the method logs the user in.
  • The logout method logs a user out. If you specified Browser Dialog Box as the login page type, it also calls the closeBrowser method to close the browser window. This behavior is necessary because the browser continues to send the old login credentials after the user logs out, and the cflogin tag will automatically use them and log the user in again.
  • The closeBrowser method closes the browser window or tells the user to close the browser window to complete the logout, depending on the browser type.

mm_wizard_login.cfm: This file contains a ColdFusion login form. The wizard generates this file for all options, but does not use it if you specify Browser Dialog login.

index.cfm or mm_wizard_index.cfm: The wizard generates an index.cfm page if the directory does not have one; otherwise, creates an mm_wizard_index.cfm page. These pages let you test the generated login code before you implement your application, or without using any of your standard application pages. To test your login, open the index.cfm page in your browser.