Tutorials
Page access levels
If you download my free minisuite (here) - Server Behaviour 108 allows you to specify which access levels should be allowed to view the page.
Unless you are using the login server behaviours supplied with dreamweaver, you will need to set up a Session Variable on your login success page first to hold the users Access Level.
For example:
In VBScript
<% Session("MM_UserAuthorization") = (rsName.Fields.Item("AccessLevel").Value) %>
Notes
- The code should be all on one line.
- The Session Variable MM_UserAuthorization can be named whatever you like - it's a good idea to use MM_UserAuthorization, especially if you are using macromedia's user authentication server behaviours.
- rsName is the name of your recordset
- AccessLevel is the name of the column in your database that contains the users access level.
This piece of code would have to go after your recordset code in order for it to assign the relevant recordset value to the session variable.
Once you've done that, apply Server Behaviour 108 from my free minisuite to the page you want to protect.
You will need to provide the following information to the Server Behaviour interface...
- The name of the Session Variable you set up to hold the users access level.
- A comma separated string of Access Levels that should be allowed to view this page.
- A page to redirect to if the user is not permitted to view the page.
Once you've provided that information, click OK and you're done.
© Copyright 2008 - robgt.com

