% WebKey="9IPpXlc2gnkyvmmd" %><% FormView=1 %><% Sentry_ID=2089 %><% Frm="FRM_2089_nXZk5p235hk53" %><%
' This is Sentry_keyfile.asp Version 2.5.2
' Password Protection Code Copyright Sentrylogin.com, Shawn, Co. http://www.sentrylogin.com
CookieTime = 30 ' length of time that cookies last, shown in minutes. May be changed at will. Don't use commas!
URLnoQueryStr = ""
NtvQueryStr = ""
PreviousURL = ""
' define functions (v. 2.5.2)
Function SentryEncrypt(str)
Const diff = 3
temp = ""
str = StrReverse(str)
For i = 1 To Len(str)
char = Asc(Mid(str,i,1))
code = char + diff
temp = temp & Chr(code)
Next
SentryEncrypt = temp
End Function
Function SentryDecrypt(str)
Const diff = 3
temp = ""
For i = 1 To Len(str)
char = Asc(Mid(str,i,1))
code = char - diff
temp = temp & Chr(code)
Next
temp = StrReverse(temp)
SentryDecrypt = temp
End Function
' get the protocol
srvrHTTPS = Request.ServerVariables("HTTPS")
If (srvrHTTPS = "off") OR (srvrHTTPS = "OFF") OR (srvrHTTPS = "FALSE") OR (srvrHTTPS = FALSE) OR (srvrHTTPS = "") OR (srvrHTTPS = NULL) Then
proto = "http://"
Else
proto = "https://"
End If ' Request.ServerVariables("HTTPS") = "off"
' preserve the current Querystring, if any
If Request.QueryString <> "" Then
querStr = "?" & Request.QueryString
NtvQueryStr = Request.QueryString
Else
querStr = ""
End If ' Request.QueryString <> ""
' construct values to pass in the URL
base_domain = Request.ServerVariables("SERVER_NAME")
If (IsNull(base_domain)) OR (base_domain = "") Then
base_domain = Request.ServerVariables("HTTP_HOST")
End If ' (IsNull(base_domain)) OR (base_domain = "")
URL_remainder = Request.ServerVariables("SCRIPT_NAME")
If (IsNull(URL_remainder)) OR (URL_remainder = "") Then
URL_remainder = Request.ServerVariables("URL")
End If ' (IsNull(URL_remainder)) OR (URL_remainder = "")
If (IsNull(URL_remainder)) OR (URL_remainder = "") Then
URL_remainder = Request.ServerVariables("PATH_INFO")
End If ' (IsNull(URL_remainder)) OR (URL_remainder = "")
URLnoQueryStr = proto & base_domain & URL_remainder
PreviousURL = proto & base_domain & URL_remainder & querStr
ip = ""
ip = Request.ServerVariables("REMOTE_ADDR")
If ((MembersOnly = "" OR IsNull(MembersOnly) OR IsEmpty(MembersOnly)) AND (FormView <> "" AND (NOT IsNull(FormView)) AND (NOT IsEmpty(FormView)))) Then
' checking FormView ensures keyfile was included, not browsed directly
' this is NOT a Protected Page Access
logOut = Request.QueryString("logOut")
If ((logOut <> "") AND (NOT IsNull(logOut)) AND (NOT IsEmpty(logOut))) Then
' member is logging out, delete Sentry cookies
Response.Cookies("Sentry_loginTkn") = ""
Response.Cookies("Sentry_loginTkn").Expires = #Jan 1,1998#
Response.Cookies("Sentry_member_ID") = ""
Response.Cookies("Sentry_member_ID").Expires = #Jan 1,1998#
Response.Cookies("Sentry_memberAccessLvl") = ""
Response.Cookies("Sentry_memberAccessLvl").Expires = #Jan 1,1998#
Response.Cookies("Sentry_firstName") = ""
Response.Cookies("Sentry_firstName").Expires = #Jan 1,1998#
Response.Cookies("Sentry_lastName") = ""
Response.Cookies("Sentry_lastName").Expires = #Jan 1,1998#
Response.Cookies("Sentry_frmIso") = ""
Response.Cookies("Sentry_frmIso").Expires = #Jan 1,1998#
logOutURL = Request.QueryString("logOutURL")
Response.Redirect(logOutURL)
Response.End
End If ' ((logOut <> "") AND (NOT IsNull(logOut)) AND (NOT IsEmpty(logOut)))
isReturn = FALSE
loggedIn = FALSE
' determine if this browser is already still logged in, determine if this a returning hit from loginAction.asp
newLogin = ""
newLogin = Request.QueryString("newLogin") ' newLogin will only contain a value if this IS DEFINITELY a login return hit from loginAction.asp
If (NOT Request.Cookies("Sentry_loginTkn") Is Nothing) AND (Request.Cookies("Sentry_loginTkn") <> "") AND newLogin = "" Then
If (NOT Request.Cookies("Sentry_frmIso") Is Nothing) AND (Request.Cookies("Sentry_frmIso") <> "") Then
' there was an Isolator cookie created when member logged in
Sentry_frmIso = Request.Cookies("Sentry_frmIso")
If Sentry_frmIso = Frm Then
' the Isolator matches the Frm variable in the login topcode
loggedIn = TRUE
Else
' the Isolator did NOT match
loggedIn = FALSE
End If ' Sentry_frmIso = Frm
Else ' If (NOT Request.Cookies("Sentry_frmIso") Is Nothing) AND (Request.Cookies("Sentry_frmIso") <> "")
' there was NOT an Isolator cookie
loggedIn = FALSE
End If ' (NOT Request.Cookies("Sentry_frmIso") Is Nothing) AND (Request.Cookies("Sentry_frmIso") <> "")
If loggedIn = TRUE Then
' freshen the cookies' expiration dates on refresh,
' otherwise, they will expire at preset time
newExpire = DateAdd("n",CookieTime,now)
Sentry_loginTkn = Request.Cookies("Sentry_loginTkn")
Sentry_member_ID = Request.Cookies("Sentry_member_ID")
Sentry_memberAccessLvl = Request.Cookies("Sentry_memberAccessLvl")
Sentry_firstName = Request.Cookies("Sentry_firstName")
Sentry_lastName = Request.Cookies("Sentry_lastName")
Sentry_frmIso = Request.Cookies("Sentry_frmIso")
Response.Cookies("Sentry_loginTkn") = Sentry_loginTkn
Response.Cookies("Sentry_loginTkn").Expires = newExpire
Response.Cookies("Sentry_member_ID") = Sentry_member_ID
Response.Cookies("Sentry_member_ID").Expires = newExpire
Response.Cookies("Sentry_memberAccessLvl") = Sentry_memberAccessLvl
Response.Cookies("Sentry_memberAccessLvl").Expires = newExpire
Response.Cookies("Sentry_firstName") = Sentry_firstName
Response.Cookies("Sentry_firstName").Expires = newExpire
Response.Cookies("Sentry_lastName") = Sentry_lastName
Response.Cookies("Sentry_lastName").Expires = newExpire
Response.Cookies("Sentry_frmIso") = Sentry_frmIso
Response.Cookies("Sentry_frmIso").Expires = newExpire
disabledStr = " disabled"
color = " color=""#CCCCCC"""
Else
' loggedIn did NOT equal TRUE
disabledStr = ""
color = ""
End If ' loggedIn = TRUE
Else ' (NOT Request.Cookies("Sentry_loginTkn") Is Nothing) AND (Request.Cookies("Sentry_loginTkn") <> "") AND newLogin = ""
' the browser is NOT already still logged in OR this is a newLogin=1 hit from loginAction.asp
loggedIn = FALSE
disabledStr = ""
color = ""
' determine if this is a fresh browse or examinable return from Sentry action page
Sentry_sendEmTo = Request.QueryString("Sentry_sendEmTo")
If ((Sentry_sendEmTo <> "") AND (NOT IsNull(Sentry_sendEmTo)) AND (NOT IsEmpty(Sentry_sendEmTo))) Then
isReturn = TRUE
Else
isReturn = FALSE
End If ' ((Sentry_sendEmTo <> "") AND (NOT IsNull(Sentry_sendEmTo)) AND (NOT IsEmpty(Sentry_sendEmTo)))
' base actions on whether browse is fresh or returned
If isReturn = FALSE Then
' do nothing
Else
' isReturn equals True, this is a returning hit
' determine if Sentry_sendEmTo in querystr was alone (user dumped) or not (user admitted)
Sentry_loginTkn = Request.QueryString("Sentry_loginTkn")
If ((Sentry_loginTkn <> "") AND (NOT IsNull(Sentry_loginTkn)) AND (NOT IsEmpty(Sentry_loginTkn))) Then
' user admitted by Sentry
' get values from Querystring
Expire = DateAdd("n",CookieTime,now)
' already retrieved Sentry_loginTkn above
Sentry_member_ID = Request.QueryString("Sentry_member_ID")
Sentry_memberAccessLvl = Request.QueryString("Sentry_memberAccessLvl")
Sentry_firstName = Request.QueryString("Sentry_firstName")
Sentry_lastName = Request.QueryString("Sentry_lastName")
' encrypt personally identifiable info (v. 2.5.2)
Sentry_firstName = SentryEncrypt(Sentry_firstName)
Sentry_lastName = SentryEncrypt(Sentry_lastName)
' BEGIN Webmaster (User) may place their custom Database code below this line
' (this section only executes after your Member has safely been admitted to your site).
' END Webmaster (User) may place their custom Database code above this line
' set Cookies
If NOT IsEmpty(Frm) Then
' Frm contains a value
If Frm <> "" Then
' Frm was NOT empty string
Response.Cookies("Sentry_frmIso") = Frm
Response.Cookies("Sentry_frmIso").Expires = Expire
Else
' Frm WAS empty string
Response.Write("Frm value not set to a value in topcode. Keyfile version may be newer than topcode. To fix, update all Sentry code to newest version.")
Response.End
End If ' Frm <> ""
Else ' NOT IsEmpty(Frm)
' Frm WAS Empty
Response.Write("Frm value not set to a value in topcode. Keyfile version may be newer than topcode. To fix, update all Sentry code to newest version.")
Response.End
End If ' NOT IsEmpty(Frm)
Response.Cookies("Sentry_loginTkn") = Sentry_loginTkn
Response.Cookies("Sentry_loginTkn").Expires = Expire
Response.Cookies("Sentry_member_ID") = Sentry_member_ID
Response.Cookies("Sentry_member_ID").Expires = Expire
Response.Cookies("Sentry_memberAccessLvl") = Sentry_memberAccessLvl
Response.Cookies("Sentry_memberAccessLvl").Expires = Expire
Response.Cookies("Sentry_firstName") = Sentry_firstName
Response.Cookies("Sentry_firstName").Expires = Expire
Response.Cookies("Sentry_lastName") = Sentry_lastName
Response.Cookies("Sentry_lastName").Expires = Expire
' send the browser to final place
Response.Redirect(Sentry_sendEmTo)
Response.End
Else
' Sentry_sendEmTo was alone, send away
Response.Redirect(Sentry_sendEmTo)
Response.End
End If ' ((Sentry_loginTkn <> "") AND (NOT IsNull(Sentry_loginTkn)) AND (NOT IsEmpty(Sentry_loginTkn)))
End If ' isReturn = FALSE
End If ' (NOT Request.Cookies("Sentry_loginTkn") Is Nothing) AND (Request.Cookies("Sentry_loginTkn") <> "") AND newLogin = ""
ElseIf ((FormView = "" OR IsNull(FormView) OR IsEmpty(FormView)) AND (MembersOnly <> "" AND (NOT IsNull(MembersOnly)) AND (NOT IsEmpty(MembersOnly)))) Then
' this IS a Protected Page Access (MembersOnly has some value, whether true or false)
If MembersOnly = TRUE Then
' page protection is toggled on, ignore otherwise
If (NOT Request.Cookies("Sentry_Verified") Is Nothing) AND (Request.Cookies("Sentry_Verified") <> "") Then
' Sentry_Verified IS set
Sentry_Verified = Request.Cookies("Sentry_Verified")
If Sentry_Verified = WebKey Then ' would be set to their db webKey in the include
' they are clear, delete Sentry_Verified cookie
Response.Cookies("Sentry_Verified") = ""
Response.Cookies("Sentry_Verified").Expires = #Jan 1,1998#
' refresh other cookies, and display page
newExpire = DateAdd("n",CookieTime,now)
Sentry_loginTkn = Request.Cookies("Sentry_loginTkn")
Sentry_member_ID = Request.Cookies("Sentry_member_ID")
Sentry_memberAccessLvl = Request.Cookies("Sentry_memberAccessLvl")
Sentry_firstName = Request.Cookies("Sentry_firstName")
Sentry_lastName = Request.Cookies("Sentry_lastName")
Sentry_frmIso = Request.Cookies("Sentry_frmIso")
Response.Cookies("Sentry_loginTkn") = Sentry_loginTkn
Response.Cookies("Sentry_loginTkn").Expires = newExpire
Response.Cookies("Sentry_member_ID") = Sentry_member_ID
Response.Cookies("Sentry_member_ID").Expires = newExpire
Response.Cookies("Sentry_memberAccessLvl") = Sentry_memberAccessLvl
Response.Cookies("Sentry_memberAccessLvl").Expires = newExpire
Response.Cookies("Sentry_firstName") = Sentry_firstName
Response.Cookies("Sentry_firstName").Expires = newExpire
Response.Cookies("Sentry_lastName") = Sentry_lastName
Response.Cookies("Sentry_lastName").Expires = newExpire
Response.Cookies("Sentry_frmIso") = Sentry_frmIso
Response.Cookies("Sentry_frmIso").Expires = newExpire
Else
' Sentry_Verified cookie WAS set, but did NOT match, delete and dump
Response.Cookies("Sentry_Verified") = ""
Response.Cookies("Sentry_Verified").Expires = #Jan 1,1998#
URL = "http://www.sentrylogin.com/sentry/Sentry_noAccess.asp?Site_ID=" & Sentry_ID & "&Reason=mustLogin&VerifCkNoMtch=1"
Response.Redirect(URL)
Response.End
End If ' Sentry_Verified = WebKey
Else
' Sentry_Verified Cookie is NOT set
Sentry_loginTkn = Request.QueryString("Sentry_loginTkn")
If ((Sentry_loginTkn <> "") AND (NOT IsNull(Sentry_loginTkn)) AND (NOT IsEmpty(Sentry_loginTkn))) Then
' this is (apparently) a returned hit from loginAction.asp
If (NOT Request.Cookies("Sentry_loginTkn") Is Nothing) AND (Request.Cookies("Sentry_loginTkn") <> "") Then
' there is a cookie set
' compare cookie with qs
If (Request.Cookies("Sentry_loginTkn")) = (Request.QueryString("Sentry_loginTkn")) Then
' they match
' set Verified cookie, redirect to this page with Native qs only
fiveMin = DateAdd("n",5,now) ' 5 minutes from now
Response.Cookies("Sentry_Verified") = WebKey ' set to their db webKey from the include line
Response.Cookies("Sentry_Verified").Expires = fiveMin
Sentry_sendEmTo = Request.QueryString("Sentry_sendEmTo")
Response.Redirect(Sentry_sendEmTo)
Response.End
Else
' cookie and qs do NOT match, dump
URL = "http://www.sentrylogin.com/sentry/Sentry_noAccess.asp?Site_ID=" & Sentry_ID & "&Reason=mustLogin&CkQsNoMtch=1"
Response.Redirect(URL)
Response.End
End If '(Request.Cookies("Sentry_loginTkn")) = (Request.QueryString("Sentry_loginTkn"))
Else
' there is NO cookie set, possible query spoof attempt, dump
URL = "http://www.sentrylogin.com/sentry/Sentry_noAccess.asp?Site_ID=" & Sentry_ID & "&Reason=mustLogin&SpoofTknCk=1"
Response.Redirect(URL)
Response.End
End If ' (NOT Request.Cookies("Sentry_loginTkn") Is Nothing) AND (Request.Cookies("Sentry_loginTkn") <> "")
Else
' there is no returned Sentry_loginTkn in qs, this is a Fresh Browse or Refresh
' check registry
' retrieve cookies, if any
If (NOT Request.Cookies("Sentry_loginTkn") Is Nothing) AND (Request.Cookies("Sentry_loginTkn") <> "") Then
'cookie is set, load value
Sentry_loginTkn = Request.Cookies("Sentry_loginTkn")
Else
'cookie is NOT set, dump
URL = "http://www.sentrylogin.com/sentry/Sentry_noAccess.asp?Site_ID=" & Sentry_ID & "&Reason=mustLogin&NoLgnTknCk=1"
Response.Redirect(URL)
Response.End
End If ' (NOT Request.Cookies("Sentry_loginTkn") Is Nothing) AND (Request.Cookies("Sentry_loginTkn") <> "")
If (NOT Request.Cookies("Sentry_member_ID") Is Nothing) AND (Request.Cookies("Sentry_member_ID") <> "") Then
' Sentry_member_ID cookie is set, retrieve
Sentry_member_ID = Request.Cookies("Sentry_member_ID")
Else
'Sentry_member_ID cookie is NOT set, dump
URL = "http://www.sentrylogin.com/sentry/Sentry_noAccess.asp?Site_ID=" & Sentry_ID & "&Reason=mustLogin&NoMbrID=1"
Response.Redirect(URL)
Response.End
End If '(NOT Request.Cookies("Sentry_member_ID") Is Nothing) AND (Request.Cookies("Sentry_member_ID") <> "")
' construct checkRegistryURL
checkRegistryURL = "http://www.sentrylogin.com/sentry/noSockets/checkRegistry.asp?Sentry_ID=" & Sentry_ID
checkRegistryURL = checkRegistryURL & "&tkn=" & Sentry_loginTkn
checkRegistryURL = checkRegistryURL & "&memb_ID=" & Sentry_member_ID
URLnoQueryStr = Server.URLEncode(URLnoQueryStr)
checkRegistryURL = checkRegistryURL & "&URLnoQry=" & URLnoQueryStr
NtvQueryStr = Server.URLEncode(NtvQueryStr)
checkRegistryURL = checkRegistryURL & "&NtvQry=" & NtvQueryStr
If ((PpLID <> "") AND (NOT IsNull(PpLID)) AND (NOT IsEmpty(PpLID))) Then
checkRegistryURL = checkRegistryURL & "&PpLID=" & PpLID ' optional
End If ' ((PpLID <> "") AND (NOT IsNull(PpLID)) AND (NOT IsEmpty(PpLID)))
If ((Level <> "") AND (NOT IsNull(Level)) AND (NOT IsEmpty(Level))) Then
checkRegistryURL = checkRegistryURL & "&LvL=" & Level ' optional
End If ' ((Level <> "") AND (NOT IsNull(Level)) AND (NOT IsEmpty(Level)))
If ((SingleOut <> "") AND (NOT IsNull(SingleOut)) AND (NOT IsEmpty(SingleOut))) Then
checkRegistryURL = checkRegistryURL & "&SngOut=" & SingleOut ' optional
End If ' ((SingleOut <> "") AND (NOT IsNull(SingleOut)) AND (NOT IsEmpty(SingleOut)))
Response.Redirect(checkRegistryURL)
Response.End
End If ' ((Sentry_loginTkn <> "") AND (NOT IsNull(Sentry_loginTkn)) AND (NOT IsEmpty(Sentry_loginTkn)))
End If ' (NOT Request.Cookies("Sentry_Verified") Is Nothing) AND (Request.Cookies("Sentry_Verified") <> "")
End If ' MembersOnly = TRUE
End If ' ElseIf ((FormView = "" OR IsNull(FormView) OR IsEmpty(FormView)) AND (MembersOnly <> "" AND (NOT IsNull(MembersOnly)) AND (NOT IsEmpty(MembersOnly))))
%><%
If ((MembersOnly = "" OR IsNull(MembersOnly) OR IsEmpty(MembersOnly)) AND ((FormView = "" OR IsNull(FormView) OR IsEmpty(FormView)))) Then
' this is a direct browse to the keyfile
%>
This is Sentry_keyfile.asp, Version 2.5.2
Sentry Login Password Protection, Membership Management System. Sentrylogin.com
The value of Request.ServerVariables("HTTPS") is: <%= Request.ServerVariables("HTTPS") %>
<%
End If ' ((MembersOnly = "" OR IsNull(MembersOnly) OR IsEmpty(MembersOnly)) AND ((FormView = "" OR IsNull(FormView) OR IsEmpty(FormView))))
%>
|
If you need to register, click here to send an email requesting Webmaster to send you an email containing a link for the registration form. Expect a response with link information in 24-48 hours.
|
||