I have a summary page which lists events, each with a unique ID. Currently, the user can click on "Edit" and be taken to the detail page to edit the event. What I would like to do is replace "Edit" with a button that goes to a routine which checks to see if the user is logged in before going to the detail page. I'm using Dreamweaver CS4. Is that possible?
Are you using dreamweaver's code to log in? If you are, then you can use the Server Behavior > User Authentication > Restrict Access to Page.
You will end up with some type of code that looks like
<%' *** Restrict Access To Page: Grant or deny access to this pageMM_authorizedUsers=""MM_authFailedURL="good_by_not_logged_in.asp"MM_grantAccess=falseIf Session("MM_Username") <> "" Then If (true Or CStr(Session("MM_UserAuthorization"))="") Or _ (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then MM_grantAccess = true End IfEnd IfIf 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 & "accessdenied=" & Server.URLEncode(MM_referrer) Response.Redirect(MM_authFailedURL)End If%>
You will end up with some type of code that looks like
Open in new window
Make sure that is on the very top of your detail page.