<% Response.Buffer = true Dim failed failed = 0 If cleanText(Request("logout")) <> "" or cleanText(Request("timeout")) <> "" then Session("contractorid") = "" Session("kao") = "" If cleanText(Request("timeout")) <> "" then failed = 1 End If End If If cleanText(Session("contractorid")) & "" <> "" then Response.Redirect "owner_menu.asp" End If If cleanText(Request("login")) <> "" then sql = "SELECT ContractorID, Password, Active FROM contractor_logins WHERE Username = '" & cleanText(Request("txtUsername")) & "'" 'response.write(sql) m_rs.Open sql, OpenConn, adOpenForwardOnly, adLockReadOnly, adCmdText If m_rs.EOF and m_rs.BOF then ' username doesn't exist failed = 2 Else If m_rs("Active") = false then ' account de-activated failed = 3 ElseIf cleanText(Request("txtPassword")) <> m_rs("Password") then ' incorrect password failed = 4 Else Session("contractorid") = m_rs("ContractorID") ' is user a kao contracotr? if LCase(Left(cleanText(Request("txtUsername")),3)) = "kao" then Session("kao") = True end if Response.Redirect "owner_menu.asp" End If End If m_rs.Close End If %> <% Response.Expires=0 Response.cachecontrol="private" %> MASC Contractor Safety Questionnaire <%If failed > 0 then%> <%End If%> " onSubmit="return isValid(this)">
MASC Contractor Safety Questionnaire  

Enter your username and password below, then click 'Log In'.

 
  <% Select Case failed case 1: Response.Write "Either your session timed out or you attempted to access a protected page. Please log in again." case 2: Response.Write "The username you entered does not exist in our database." case 3: Response.Write "The username you entered has been de-activated. Please contact MASC for more details." case 4: Response.Write "The password you entered was incorrect. Please double check your spelling and try again." End Select %>
Username:
Password:
 

 

<% on error resume next m_rs.close set m_rs = nothing m_conn.close set m_conn = nothing %>