CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.

YesSoftware Forums -> Archive -> GotoCode Archive

 Links in emails

Print topic Send  topic

Author Message
Posted: 01/02/2004, 10:52 AM

I'm using ASP w/templates and CC security to generate an email that contains a link to a page using the following:

strURL= "http://"+Request.ServerVariables("SERVER_NAME")+Request.ServerVariables("SCRIPT_NAME")
strURL= Mid(strURL,1,InstrRev(strURL,"/"))
"See details at " & strURL & "CaseResponse.asp?CaseNum=" & lngCase

This is an intranet app so I put the following in the Open Any Page event:

Dim intPos

If Session("NetID") = "" Then
intPos = InStr(Request.ServerVariables("LOGON_USER"), "\") + 1
Session("NetID") = UCase(Mid(Request.ServerVariables("LOGON_USER"), intPos))
End If

I also have the following at the end of the Global Functions:

Function CheckSecurity(pbytLevel)
If Session("NetID") = "" Then
Set cn = Nothing
response.redirect("SecAccessDenied.asp?QueryString=" & toURL(request.serverVariables("QUERY_STRING")) & "&ret_page=" & toURL(request.serverVariables("SCRIPT_NAME")))
If CLng(SecLevel()) < CLng(pbytLevel) Then
Set cn = Nothing
response.redirect("SecNoPrivilages.asp?QueryString=" & toURL(request.serverVariables("QUERY_STRING")) & "&ret_page=" & toURL(request.serverVariables("SCRIPT_NAME")))
End If
End If
End Function

My problem is when the user clicks on the link from the email and they do not already have the site open in there browser they get the access denied page because there Session("NetID") = "". If they do already have the site open the page opens fine. Can anyone please explain why this is?
Posted: 01/02/2004, 2:02 PM

CheckSecurity is being called before page open, check what calls the "CheckSecurity" function it is probabling in the Globals area.



These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

Internet Database

Visually create Web enabled database applications in minutes.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by  and YesSoftware, Inc.