%@ LANGUAGE = "VBScript" ENABLESESSIONSTATE = True %> <%Option Explicit%> <%Response.Buffer = True%> <% '** PREVENT PAGE FROM BEING CACHED Response.Expires = -1 Response.ExpiresAbsolute = Now() - 2 Response.AddHeader "pragma","no-cache" Response.AddHeader "cache-control","private" Response.CacheControl = "No-Store" %> <% '*********************************************************** '** Copyright Notice ** '** Tassietek - MailerPro ** '** Copyright 2001-2004 Tassietek All Rights Reserved. ** '*********************************************************** If DataBaseType = "mssql" Then Server.Execute"sql.asp" Elseif DatabaseType = "mysql" Then Server.Execute"mysql.asp" End If Server.Execute"settings.asp" If Session("FirstTimeSetup") = "YES" Then Response.Cookies("firsttime") = "yes" Response.Redirect"registration.asp" Response.End End If Dim error, sql, rs, chkstring error = "" If Request("logoff") = 1 Then If Request.Cookies("a") = "s" Then error = "You have changed you setup settings which requires a re-login!" Response.Cookies("logon") = "" Elseif Request.Cookies("a") = "ended" Then error = "Your session as ended you need to login again." Response.Cookies("login") = "" Response.Cookies("a") = "" Else Response.Cookies("logon") = "" error = "You have successfully logged off!" End If End If If Request.Cookies("a") = "error" Then error = "Access Denied, either wrong username and or password!" End If If Request.Cookies("action") = "error" Then error = "Either invalid login or an attempted unsecure access to a file" Response.Cookies("action") = "" End If If Request("action") = "login" Then If IsValidString(Request("password")) = Not True Then error = "Password as Invalid Characters!" Elseif IsValidString(Request("username")) = Not True Then error = "User Name as Invalid Characters!" Else sql = "SELECT name, username, pass_word, securitylevel, lastaccessed from " & tbl_prefix & "users Where username = '" & Request("username") & "' And pass_word = '" & Request("password") & "'" Set rs = conn.execute(sql) If err <> 0 Then Response.Write"" err.clear Response.End End If If rs.EOF Then error = "Login failed, please check your User Name and Password and try again!" Else Response.Cookies("user") = rs("name") conn.execute("Update " & tbl_prefix & "users Set lastaccessed = " & FormatDatabaseDate(SetDate(Now()))) If err <> 0 Then Response.Write"" err.clear Response.End End If Response.Cookies("login") = rs("securitylevel") If rs("securitylevel") = 3 Then Response.Redirect "sendemail.asp" Else If Request.Cookies("a") = "s" Then Response.Redirect"setup.asp" Else Response.Redirect"default.asp" End If rs.close Set rs = nothing End If End If End If End If %>
<%=error%> |