% Response.Buffer = True %>
<%
dim strMsg
strMsg = "Please login below"
if len(Request.Form("submit")) then
Dim IsAuthorized
dim cnDB
dim rsLogIn
dim strUserName
dim strPassword
dim cmdSelect
strUserName = trim(Request.Form("username"))
strPassword = trim(Request.Form("password"))
if len(strUserName) > 0 then
DoLogin
else
bLoggedIn = ValidateSession()
if bLoggedIn then
IF NOT ISEMPTY(Session("RedirectToAfterLogin")) THEN
' TRENT: This should be re-directed to the URL they originally requested before they got forced
' to the log in screen; also I did not edit the two lines at the top of this page or anything else;
' thought you'd be able to utilize the same code only with minor modifications, hopefully
Response.Redirect Session("RedirectToAfterLogin")
ELSE
Response.Redirect ("http://www.matchmakersforsingles.com")
END IF
else
DoLogin
end if
end if
end if
'do login
sub DoLogin()
OpenDB
Set rsLogIn = Server.CreateObject("ADODB.Recordset")
GetIntraNetLogIn trim(strUserName), trim(strPassword)
IsAuthorized = "false"
if (not rsLogIn.eof) and (not rsLogIn.BOF) then
Session("ProfileNo") = trim(rsLogIn("ProfileNo"))
Session("Password") = trim(rsLogIn("Password"))
Session("CanOnlyLookAt") = trim(rsLogIn("CanOnlyLookAt"))
Session("LoginId") = "authorized"
IsAuthorized = "true"
else
Session("LoginId") = ""
IsAuthorized = "false"
end if
If IsAuthorized <> "true" then
strMsg = "Access Denied. Please enter your correct Profile Number
"
strMsg = strMsg & "and password. If you tried several times and still
"
strMsg = strMsg & "can't login, please contact the system administrator."
Else
IF NOT ISEMPTY(Session("RedirectToAfterLogin")) THEN
Response.Redirect Session("RedirectToAfterLogin")
ELSE
Response.Redirect ("http://www.matchmakersforsingles.com")
END IF
end if
rsLogIn.Close
set rsLogIn = nothing
cnDB.Close
set cnDB = nothing
end sub
' open database connection
Sub OpenDB()
Dim sConn
Set cnDB = Server.CreateObject("ADODB.Connection")
sConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("matchmakerdb.mdb")
cnDB.Open sConn
End Sub
'get login information from database
Sub GetIntraNetLogIn(strUserName, strPassword)
dim strSQL
strSQL = "SELECT * FROM LoginInfo WHERE ProfileNo = " & strUserName & " And password = '" & strPassword & "' and LockOutDate > " & cstr(fix(Now))
'Response.Write strSQL & "
" rsLogIn.Open strSQL, cnDB End Sub 'validate session login id FUNCTION ValidateSession () ' validate whether session is still alive if Session("LoginId") <> "authorized" then ValidateSession = FALSE ELSE ValidateSession = TRUE END IF END FUNCTION %>
| |
|
|
|
|
|
|
|
||||||||||||
|
|||||||||||||||||||
![]() |
|||||||||||||||||||
| |
|||||||||||||||||||
|
|
|||||||||||||||||||
|
|||||||||||||||||||