This allows you to have pages that only members with a shared username and password can access.
1) The Login Page. Create a new page using your standard site template. Name it "Login" and edit the visibility to Online, but not linked from the menu.
Save and publish the page. Note: We'll come back to this page once we have a contentid number for the XXX above. Once this page is published, note the contentid number for your new page. You can get this by looking at the browser statusbar when mousing over the page name.
2) The Members Template.
Copy your standard site template and rename it something like Members Template. Edit the page and add the following to the top of the template.
<% if session("member")="" then if Request.Form("user")="YOURUSERNAME" AND Request.Form("password")="YOURPASSWORD" then session("member")="true" else response.redirect "default.asp?contentid=XXX" end if end if %>
Change YOURUSERNAME and YOURPASSWORD as required. Replace XXX with the contentid of your login page we just created.
3) Members Page. Now create a new page for your members. Select your new Secure Template and publish the page. It can be linked to the menu. Once it is published, note the contentid number. Take this number and edit your login page.
This concludes the MOD. Let me know if you have any problems with it or can suggest a better method.
I am attempting to use this mod and have ran into a block. In step 2 you specify to paste the code in the "top" of the template. Just where should it go? Before the body tag? Within the head tag? Or at the VERY top/beginning of the template? I tried almost every combination. Each time I do, the code that I place in the template shows up on the published page.
Hi RSAdevelopment and welcome to the Allinta Support Forum.
Yes - The ASP code in step 2 goes right at the top of the template - the very first thing. The logic being, if the session variable has not been set, then redirect the user to another page.
I can't see any problems on the URL you have posted. Have you go it to work?
Yep, I incorporated this into one of my projects as well and it worked great!
Furthermore, I made the protected page a template so that I could just add it as a new page and my client could edit the pages without disturbing the code.