The code as promised:(not sure exactly which part you want but here is some of the code): (This is the beginning login to the site. Note the userID as the login name but its not the bolt- on VPASP ecomm portion)
<!--#include virtual="/inc/conn.asp" -->
' *******************************************
' The conn.asp file simply makes the call to the database
'********************************************
<%
' **********************************************
' * This version of the login page uses UserID instead of email for authentication
' * Date: 9/21/2004
' **********************************************
%>
<% Dim ReferringPage
if instr(request.ServerVariables("HTTP_REFERER"), "loginError.asp") <> 0 then
ReferringPage = "http://xxxxxxxxxxxxxxxOmitted.com"
else 'if instr(request.ServerVariables("HTTP_REFERER"), "LoginError.asp") <> 0 then
if session("Page") <> "" then
ReferringPage = session("Page")
session("Page") = ""
else 'if session("Page") <> "" then
if request.ServerVariables("HTTP_REFERER") <> "" then
ReferringPage = request.ServerVariables("HTTP_REFERER")
else 'if request.ServerVariables("HTTP_REFERER") <> "" then
ReferringPage = "http://xxxxxxxxxxxxxxxOmitted.com/index.asp"
end if 'if request.ServerVariables("HTTP_REFERER") <> "" then
end if 'if request("ReferringPage") <> "" then
end if 'if instr(request.ServerVariables("HTTP_REFERER"), "LoginError.asp") <> 0 then
if request("login") <> "" then
if IsNumeric(request("UserID")) = False OR len(request("UserID")) > 9 then
Call NonNumericLogin()
response.Redirect("LoginError.asp?Erro=1")
End if 'if IsNumeric(request("UserID")) = False then
' **********************************************
' * Check to see whether record exists in the database
' **********************************************
set rs = server.createobject("adodb.recordset")
rs.CursorLocation=2
rs.CursorType=0
rs.LockType=1
rs.open "SELECT UserID,EmailLogin,Password,UserStatusID,AdminToolsAccess,FirstName,LastName,RenewalType,RenewalAnniversary,BoardMember FROM vw_Security WHERE UserID='"&fixSQL(request("UserID"))&"' AND Password='"&fixSQL(request("Password"))&"'",conn
DIM UserStatus, Erro, AdminToolsAccessAccess
if not rs.eof then
' **********************************************
' * Check to see if user is active
' **********************************************
UserStatus = rs("UserStatusID")
if UserStatus = 2 then
Call ValidLogin_Expired()
response.Cookies("UserID") = request("UserID")
response.Cookies("Login") = "expired"
response.Cookies("Login").Expires = Date() + 1
response.Redirect("../xxxxxxxxxxxxxxxOmitted.com/overview.asp")
end if
if UserStatus = 1 OR UserStatus=5 then
'if rs("RenewalType") = "Standard" then
' **********************************************
' * See if user's renewal date is current
' **********************************************
if int(DateDiff("d", FormatDateTime(Now(),vbShortDate), FormatDateTime(rs("RenewalAnniversary"),vbShortDate))) < int(0) then
response.Cookies("UserID") = rs("UserID")
tempID = rs("UserID")
response.Cookies("Renewal") = FormatDateTime(rs("RenewalAnniversary"),vbShortDate)
Call ValidLogin_Expired()
response.Redirect("LoginError.asp?Erro=3&UserID=" & tempID)
'else ' if rs("RenewalAnniversary") < FormatDateTime(Now(),vbShortDate)&" 12:00:00 AM" then
' **********************************************
' * See if user's renewal date is less than 45 days away
' **********************************************
if DateDiff("d", FormatDateTime(Now(),vbShortDate), FormatDateTime(rs("RenewalAnniversary"),vbShortDate)) < 45 then
response.Cookies("UserRenew") = "Yes"
else 'if DateDiff("d", rs("RenewalAnniversary"), FormatDateTime(Now(),vbShortDate)&" 12:00:00 AM") < 45 then
response.Cookies("UserRenew") = ""
end if 'if DateDiff("d", rs("RenewalAnniversary"), FormatDateTime(Now(),vbShortDate)&" 12:00:00 AM") < 45 then
end if ' if rs("RenewalAnniversary") < FormatDateTime(Now(),vbShortDate)&" 12:00:00 AM" then
'end if 'if rs("RenewalType") = "Standard" then
response.Cookies("Login") = 1
response.Cookies("Login").Expires = Date() + 1
response.Cookies("UserID") = rs("UserID")
response.Cookies("UserID").Expires = Date() + 1
response.Cookies("AdminToolsAccess") = rs("AdminToolsAccess")
response.Cookies("AdminToolsAccess").Expires = Date() + 1
response.Cookies("BoardMember") = rs("BoardMember")
response.Cookies("BoardMember").Expires = Date() + 1
response.Cookies("FullName") = rs("FirstName") & " " & rs("LastName")
response.Cookies("FullName").Expires = Date() + 1
response.Cookies("UserStatus") = UserStatus
response.Cookies("UserStatus").Expires = Date() + 1
if rs("RenewalType") = "Standard" then
response.Cookies("Renewal") = rs("RenewalAnniversary")
response.Cookies("Renewal").Expires = Date() + 1
end if
Validation code below this is ommitted since it's not the subject for discussion. If you want it posted however, let me know.
Hope this helps and thank you for reviewing!