-------------------------------------------------------- Sub SAI_ReportPageKeyError(nError) On Error Resume Next If (nError <> SAI_PK_E_UNAUTHORIZED And _ nError <> SAI_PK_E_UNEXPECTED) Then nError = SAI_PK_E_UNAUTHORIZED End If Response.Clear Session.Abandon %>
<% If (nError = SAI_PK_E_UNEXPECTED) Then %> <% Else ' nError = SAI_PK_E_UNAUTHORIZED %> <% End If %>
<% Response.End End Sub '--------------------------------------------------------------------------- ' ' Sub: SAI_DisplayPageKeyError ' ' Synopsis: Reads the form data from the form created by ' SAI_ReportPageKeyError and displays the error to the user. ' See SAI_ReportPageKeyError for more information on the data ' passed through the form. ' ' Arguments: None. Inputs are read from form variables. ' '--------------------------------------------------------------------------- Sub SAI_DisplayPageKeyError() On Error Resume Next ' ' Read the parameters from the form post. ' Dim strTitle If (1 = Request.Form(SAI_FLD_ERRORTITLE).Count) Then strTitle = Request.Form(SAI_FLD_ERRORTITLE).Item(1) Else strTitle = "" End If Dim strLine1 strLine1 = Request.Form(SAI_FLD_ERRORSTRING1).Item(1) If (0 = Len(strLine1)) Then strLine1 = SAI_STR_E_UNEXPECTED End If Dim strLine2 If (1 = Request.Form(SAI_FLD_ERRORSTRING2).Count) Then strLine2 = Request.Form(SAI_FLD_ERRORSTRING2).Item(1) Else strLine2 = "" End If Dim strLine3 If (1 = Request.Form(SAI_FLD_ERRORSTRING3).Count) Then strLine3 = Request.Form(SAI_FLD_ERRORSTRING3).Item(1) Else strLine3 = "" End If Dim strButtonText If (1 = Request.Form(SAI_FLD_BUTTONTEXT).Count) Then strButtonText = Request.Form(SAI_FLD_BUTTONTEXT).Item(1) Else strButtonText = "" End If ' ' Construct the homepage URL. ' Dim strHomepageURL strHomePageURL = "https://" & SAI_PK_strServerName & ":" & _ Request.ServerVariables("SERVER_PORT") ' ' The following lines are copied from sh_page.asp to avoid circular ' inclusion of that page by including it here. ' Response.Buffer = True Response.ExpiresAbsolute = DateAdd("yyyy", -10, Date) Response.AddHeader "pragma", "no-cache" Response.AddHeader "cache-control", "no-store" ' ' End code copied from sh_page.asp ' %> <%=Server.HTMLEncode(strTitle)%> <% ' ' The following lines are copied from ' SA_EmitAdditionalStyleSheetReferences in sh_page.asp to avoid circular ' inclusion of that page by including it here. ' Dim oRetriever Set oRetriever = Server.CreateObject("Elementmgr.ElementRetriever") Dim oContainer Set oContainer = oRetriever.GetElements(1, "CSS") If (0 = Err.Number) Then Dim oElement For each oElement in oContainer Dim sStyleURL sStyleURL = Trim(oElement.GetProperty("URL")) If (0 = Err.Number) Then If ( Len(sStyleURL) > 0 ) Then %> <% End If End If Next End If ' ' End code copied from sh_page.asp ' %> <% If (0 <> Len(strLine2)) Then %> <% End If If (0 <> Len(strLine3)) Then %> <% End If If (0 <> Len(strButtonText)) Then %> <% End If %>

<%=Server.HTMLEncode(strTitle)%>

 
  <%=Server.HTMLEncode(strLine1)%>
 
  <%=Server.HTMLEncode(strLine2)%>
 
  <%=Server.HTMLEncode(strLine3)%>
  <%=Server.HTMLEncode(strHomePageURL)%>
 
  <% ' ' The following HTML is copied from ' SA_ServeOnClickButton in sh_page.asp to avoid ' circular inclusion of that page by including it ' here. ' %> <% ' ' End code copied from sh_page.asp ' %>
<% Response.End End Sub ' ' Begin normal processing. ' Select Case Request.ServerVariables("REQUEST_METHOD") Case "GET" ' ' Look for a key in the request. If one is found, verify that it is ' correct. ' If (1 = Request.QueryString(SAI_FLD_PAGEKEY).Count) Then ' ' Found a key. Verify it. ' Call SAI_VerifyPageKey(Request.QueryString(SAI_FLD_PAGEKEY).Item(1)) ElseIf (0 <> Request.QueryString.Count) Then Call SAI_ReportPageKeyError(SAI_PK_E_UNAUTHORIZED) End If ' ' If we got here, we either had a valid key or no querystring ' arguments. Either way, allow the request to succeed. ' Case "POST" ' ' Verify that only one key was submitted. ' If (Request.Form(SAI_FLD_PAGEKEY).Count <> 1) Then Call SAI_ReportPageKeyError(SAI_PK_E_UNAUTHORIZED) Else ' ' Verify that they submitted key matches the one stored in the sesion state. ' Call SAI_VerifyPageKey(Request.Form(SAI_FLD_PAGEKEY).Item(1)) End If Case Else ' ' We reject all other types of requests if we receive them. ' Response.End End Select ' ' One last check to catch anything that fell through. ' If (Err.number <> 0) Then Response.End End If %>