Implement user authentication

In this section of the tutorial you will create all elements relative to the site's user authentication part. This will contain:

 

First, the site's main page and the login form. To build this page, you will use one of the wizards provided by MX User Login (part of MX Kollection 3): the Login Form Wizard. Follow the next steps to create the page:

  1. Open the index page in Dreamweaver.

  2. Apply the Login Form Wizard from the MX Kollection tab of the Insert bar. Configure each step as follows:

  3. After all options are set, simply click the Finish button to close the wizard and add the login form to the page.

  4. If you save and upload the page to the server, and then preview it in the browser, it should look similar to this one (depending on the skin used in your site):

 

The second element to create is the registration page. Building it is as easy as the login page, as you will use a wizard once more. To create the registration page, follow the next steps:

  1. Open the register page in Dreamweaver.

  2. Apply the User Registration Wizard from the MX Kollection tab of the Insert bar.

  3. Configure the wizard's options in each step as follows:

  4. The wizard will add both HTML elements and code to the page, and will also generate a new page, named activate. This page is used in the activation process: it contains an Update Transaction, that receives the randomly generated key as URL parameter, and changes the value in the active_usr column from 0 to 1. To reach this page, users must click the link offered in the activation e-mail message.

 

The last action to take regarding the user authentication portion of this tutorial is to protect various pages from users that do not have the right to access them. Two type of restrictions will be applied in what follows:

The pages to protect in the front-end section are: view_products, view_order, clear_order, complete_order and add_to_order. The other pages are either public or available only through e-mail links (you will get to these pages later on). To restrict access to these pages, follow the next steps:

  1. Open the page to protect in Dreamweaver.

  2. Apply the Restrict Access To Page server behavior from the Server Behaviors tab > + >MX Kollection > User Login. Configure the user interface as follows:

  3. Repeat steps 1 and 2 for each page in the list above. When all pages are protected, you can move on and continue with the development of the application.