Forums

This topic is locked

Restrict access to page.

Posted 06 Nov 2002 20:38:26
1
has voted
06 Nov 2002 20:38:26 Dave Clarke posted:
Hi

I have a small tip here if you are using the standard MM restrict access to page behaviour.
If an undesirable tries to access a page with this behaviour on, it redirects to a page of your choice, however it shows in the browsers address bar as "accessdenied" which tells the user that there is a page but they are being locked out.
My tip is to change this so that it shows "page not found" (or whatever you like) so that it doesnt tell the user that there is a page at all.
Find this bit of code in your page

If Not MM_grantAccess Then
MM_qsChar = "?"
If (InStr(1,MM_authFailedURL,"?" >= 1) Then MM_qsChar = "&"
MM_referrer = Request.ServerVariables("URL"
if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
MM_authFailedURL = MM_authFailedURL & MM_qsChar & "<b>accessdenied=</b>" & Server.URLEncode(MM_referrer)
Response.Redirect(MM_authFailedURL)
End If

then simply change the text in bold to your new message.

While we are on this subject, is it possible to set this behaviour to redirect to the standard IIS page not found error page??
If so how??

thanks

Dave


ASP|VBScript|IIS5.1|WinXPPro & WinXPHome

Replies

Replied 06 Nov 2002 23:35:07
06 Nov 2002 23:35:07 Owen Eastwick replied:
Making it show the page not found page has got to be the easiest thing in the world, think about it......

Simply make the fail condition redirect to a page that doesn't exist in your site.

Regards

Owen.

Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 07 Nov 2002 07:24:32
07 Nov 2002 07:24:32 Dave Clarke replied:
Duh me !!! <img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>

thanks Owen <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>

ASP|VBScript|IIS5.1|WinXPPro & WinXPHome

Reply to this topic