<% Response.Buffer = true Dim failed failed = 0 If Request("logout") <> "" or Request("timeout") <> "" then Session("companyid") = "" Session("kao") = "" If Request("timeout") <> "" then failed = 1 End If End If If Session("companyid") & "" <> "" then Response.Redirect "owner_menu.asp" End If If Request("login") <> "" then sql = "SELECT CompanyID, CompanyName, Password, Active FROM owners WHERE Username = '" & Request("txtUsername") & "'" 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 Request("txtPassword") <> m_rs("Password") then ' incorrect password failed = 4 Else Session("companyid") = m_rs("CompanyID") ' is user a kao contracotr? if LCase(Left(Request("CompanyName"),3)) = "kao" then Session("kao") = True end if Response.Redirect "owner_menu.asp" End If End If m_rs.Close End If %> MASC Contractor Safety Questionnaire Search <%If failed > 0 then%> <%End If%> " onSubmit="return isValid(this)">
MASC Contractor Safety Questionnaire Search  

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 WACSC administration 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 %>