Macromedia dreamweaver 8-using dreamweaver User Manual
Building pages that restrict access to your site (ColdFusion, ASP, JSP, PHP)
881
You can also use authorization levels to review newly registered users before granting them full
access to the site. For example, you may want to receive payment before allowing a user access
to the member pages of the site. To do so, you can protect the member pages with a Member
authorization level and only grant newly registered users Guest privileges. After receiving
payment from the user, you can upgrade the user’s access privileges to Member (in the
database table of registered users).
access to the site. For example, you may want to receive payment before allowing a user access
to the member pages of the site. To do so, you can protect the member pages with a Member
authorization level and only grant newly registered users Guest privileges. After receiving
payment from the user, you can upgrade the user’s access privileges to Member (in the
database table of registered users).
If you do not plan to use authorization levels, you can protect any page on your site simply by
adding a Restrict Access To Page server behavior to the page. The server behavior redirects to
another page any user who has not successfully logged in. For more information, see
adding a Restrict Access To Page server behavior to the page. The server behavior redirects to
another page any user who has not successfully logged in. For more information, see
.
If you do plan to use authorization levels, you can protect any page on your site with the
following building blocks:
following building blocks:
■
A Restrict Access To Page server behavior to redirect unauthorized users to another page
(see
(see
)
■
An extra column in your users database table to store each user’s access privileges (see
)
Whether you use authorization levels or not, you can add a link to the protected page that lets
a user log out and clears any session variables. For more information, see
a user log out and clears any session variables. For more information, see
Redirecting unauthorized users to another page
To prevent unauthorized users from accessing a page, add a Restrict Access To Page server
behavior to it. The server behavior redirects the user to another page if the user attempts to
bypass the login page by typing the protected page’s URL in a browser, or if the user is logged
in but attempts to access the protected page without the proper access privileges.
behavior to it. The server behavior redirects the user to another page if the user attempts to
bypass the login page by typing the protected page’s URL in a browser, or if the user is logged
in but attempts to access the protected page without the proper access privileges.
If you want to give many pages on your site the same access rights, you can copy and paste
access rights from one page to another.
access rights from one page to another.
To redirect unauthorized users to another page:
1.
Open the page you want to protect.
2.
In the Server Behaviors panel (Window > Server Behaviors), click the Plus (+) button and
select User Authentication > Restrict Access To Page from the pop-up menu.
select User Authentication > Restrict Access To Page from the pop-up menu.
The Restrict Access To Page dialog box appears.
NO
T
E
The Restrict Access To Page server behavior can only protect HTML pages. It does not
protect other site resources such as image files and audio files.
protect other site resources such as image files and audio files.