%
'AJLogin v4.1
'By: Adam Jarret
'RandomRavings.com
%>
<%
strStatusMessage = ""
strAttemptedURL = Request.QueryString("u")
strPageMode = Request.QueryString("m")
strPageData = Request.QueryString("d")
if IsNumeric(strPageMode) and strPageMode<>"" then
intRequiredLevel = strPageMode
strPageMode = "InsufficientAccess"
end if
if strPageMode = "LogIn" then
if Request.Form("UseCookies") <> "" then
UseCookies = true
else
UseCookies = false
end if
strLoginResult = AttemptLogin(Request.Form("UserName"), Request.Form("Password"), UseCookies, true)
if strLoginResult = "SUCCESS" then
if Request.Form("AttemptedURL") <> "" then
Response.Redirect Request.Form("AttemptedURL")
else
if CInt(Session("UserLevel")) >= ajlogin_adminlevel then
Response.Redirect ajlogin_adminurl
else
Response.Redirect ajlogin_memberurl
end if
end if
else
if strLoginResult = "ERROR:UNCONFIRMED" then
strPageMode = "ConfirmEMail"
elseif strLoginResult = "ERROR:UNAPPROVED" then
strPageMode = "ApproveMember"
else
strPageMode = "BadLogin"
end if
end if
end if
select case strPageMode
case "BadLogin"
strStatusMessage = "Incorrect User Name/Password"
case "InsufficientAccess"
if CInt(intRequiredLevel) = 1 then
strStatusMessage="You must be logged-in to view this page."
else
strStatusMessage="Level "& intRequiredLevel &" access is required to view this page."
end if
case "ApproveMember"
strStatusMessage="You account has not been approved by a site admin. You will not be able to log in until your account is approved."
case "ConfirmEMail"
strStatusMessage="The e-mail address for this account has not been confirmed.
Click here to confirm your address."
case "Confirmed"
strStatusMessage="Your e-mail address has been verified."
case "SendPass"
strStatusMessage="A password reset link has been sent to " & strPageData &". The link will expire in 24 hours."
case "ResetPass"
strStatusMessage="Your password has been changed."
case "SendConf"
strStatusMessage="An address ownership verification message has been sent to " & strPageData
case "New"
if ajlogin_sendconfirmation then strStatusMessage = strStatusMessage & "
An address ownership verification message has been sent to " & strPageData & ". Please confirm your e-mail address by clicking the confirmation link in this message.
" if ajlogin_requireapproval then strStatusMessage = strStatusMessage & "You will not be able to Log In until your account is approved by a site admin.
" case "LogOut" Response.Cookies (ajlogin_cookiename) = "" Session.Abandon strStatusMessage="You Are Now Logged Out." end select %> <% PageTitle = "Please Log In" %> <% if strStatusMessage <> "" then %><%=strStatusMessage%>