Restrict Access To Page

The goal of having users login onto your site is to allow them to access information that others cannot. In order to do so, you must protect the private pages by restricting access for the users that haven't logged in. When using MX User Login, you can implement this through the Restrict Access To Page server behavior.

You can access the server behavior from the Application panel, Server Behaviors -> + -> MX Kollection -> User Login -> Restrict Access To Page. The user interface has only one tab.

 

Configure the dialog box that opens so that only the users that you want will get access, while others will get redirected to a specified page. Set the criteria to use when blocking access by following the given instructions:

 

  1. The Restrict based on radio group offers the criteria to use: Username and password or Username, password and access level. While the latter is more complex, it also requires that you have user levels defined in your table.

  2. If using the Username, password and access level option, you will have to select from the list the levels that are granted access to the page. This list is retrieved from the login settings of the Control Panel.

  3. If you need to add (new) levels or change any settings, you can press the Change Login settings button to open the mentioned entry in the control panel.

  4. The three buttons in the top right corner of the interface offer you the next functionalities:
    · Click OK when you are done configuring the server behavior.
    · Click Cancel to exit without the new settings to be applied.
    · The Help button takes you to this help page.

When viewed in the browser, if you are not logged in properly, you will get redirected either to the default login failed page, or the page specified as redirect for your precise user level.

Note: If you use this server behavior on the ColdFusion server model, a file named Application.cfm will be automatically generated in the site root folder. Do not delete this file, as it contains settings related to session variables used by the server behavior and the current application. If you remove this file or modify it, application pages that use sessions will not function properly.