<% Option Explicit %> <% Response.Buffer = TRUE Dim sUsername, sPassword, iPageAction, iNewPageAction, sPageMessage, sSubmitValue Dim sFolder, bEnabled, sClientId, sIPAddress iPageAction = Int(Request("ACT")) sUsername = LCase(Request.Form("txtUsername")) sPassword = LCase(Request.Form("txtPassword")) sIPAddress = Request.ServerVariables("REMOTE_ADDR") Sub ClientLogin sSQL = "ClientLogin '" & sUsername & "','" & sPassword & "'" Set rs = oConn.Execute(sSQL) If Not rs.EOF Then sClientId = rs("PK_ClientAccess_Id") sFolder = rs("Folder") bEnabled = rs("Enabled") rs.Close Else sFolder = NULL bEnabled = FALSE End If Set rs = Nothing End Sub ' iPageAction = -1 Sub ShowFormTop Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "Graule.com: Client Area" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "
" & vbCrLf Response.Write "
" & vbCrLf Response.Write "













" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf End Sub Sub ShowLoginForm sSubmitValue = "Login" iNewPageAction = 1 Call ShowFormTop Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf Call ShowFormBottom End Sub Sub ShowFormBottom Response.Write "
" Response.Write "
" & sPageMessage & "
" & vbCrLf Response.Write "
" & vbCrLf Response.Write "Username: " Response.Write "
" & vbCrLf Response.Write "Password: " Response.Write "" & vbCrLf Response.Write "
 
" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf End Sub Select Case iPageAction Case -1 'Members Area Unavailable sPageMessage = "We're sorry, but the Client Area is currently unavailable. Please try back shortly." Session.Abandon Call ShowFormTop Call ShowFormBottom Case 0 'First Time Login sPageMessage = "
" Session.Abandon Call ShowLoginForm Case 1 'Validate User Call ClientLogin If IsNull(sFolder) Then sPageMessage = "Invalid Username or Password" ' sSQL = "AccessLog_insert " & sClientId & ", 120,'" & sIPAddress & "'" ' oConn.Execute(sSQL) Call ShowLoginForm Else If bEnabled Then Session("clientid") = sClientId Session("username") = sUsername Session("folder") = sFolder ' sSQL = "AccessLog_insert " & sClientId & ", 100,'" & sIPAddress & "'" ' oConn.Execute(sSQL) Response.Redirect "index.asp" Else sPageMessage = "Account Disabled" ' sSQL = "AccessLog_insert " & sClientId & ", 140,'" & sIPAddress & "'" ' oConn.Execute(sSQL) Call ShowLoginForm End If End If Case 5 'Logout sPageMessage = "You have been logged out." Session.Abandon Call ShowLoginForm End Select %>