%@ CodePage=28599 LCID=1033 %>
<% Session.Timeout = 300 %>
<%
Response.Expires = 0
Response.ExpiresAbsolute = Now() - 1
Response.AddHeader "pragma", "no-cache"
Response.AddHeader "cache-control", "private, no-cache, no-store, must-revalidate"
%>
<%
If Request.Form("submit") <> "" and Request.Form("islemturu")="toplu" Then
bValidPwd = False
' Setup variables
susername = Request.Form("Username")
spassword = Request.Form("Password")
If ValidateUser(sUsername, sPassword) Then
' Write cookies
sLoginType = LCase(Request.Form("rememberme"))
If sLoginType = "a" Then
Response.Cookies(ewProjectName)("autologin") = "autologin"
Response.Cookies(ewProjectName)("username") = sUsername
Response.Cookies(ewProjectName)("password") = sPassword
Response.Cookies(ewProjectName).Expires = DateAdd("d", 365, Date) ' Change the expiry date of the cookies here
ElseIf sLoginType = "u" Then
Response.Cookies(ewProjectName)("autologin") = "rememberUsername"
Response.Cookies(ewProjectName)("username") = sUsername
Response.Cookies(ewProjectName).Expires = DateAdd("d", 365, Date) ' Change the expiry date of the cookies here
Else
Response.Cookies(ewProjectName)("autologin") = ""
End If
Session(ewSessionStatus) = "login"
Response.Redirect "default.asp"
Else
Session(ewSessionMessage) = "Yanlış Kullanıcı veya Şifre"
End If
ElseIf Request.Form("submit") <> "" and Request.Form("islemturu")="serino" Then
Response.Redirect "URUNview2.asp?ARIZA_FORMNO=" & Request.Form("formno") & "&ARIZA_SERINO=" & Request.Form("formno") & "&ARIZA_FIRMAKODU=" & Request.Form("firma")
Else
If IsLoggedIn Then
If Session(ewSessionMessage) = "" Then Response.Redirect "default.asp"
Else ' Check auto login
%>
<%
If Request.Cookies(ewProjectName)("autologin") = "autologin" Then
sUsername = Request.Cookies(ewProjectName)("username")
sPassword = Request.Cookies(ewProjectName)("password")
If ValidateUser(sUsername, sPassword) Then
Response.Redirect "default.asp"
End If
End If
End If
End If
%>
<%= Session(ewSessionMessage) %>
<% Session(ewSessionMessage) = "" ' Clear message End If %><% ' Function to validate user Function ValidateUser(Username, Password) ValidateUser = False Dim CaseSensitive, AdminUsername, AdminPassword CaseSensitive = False ' Modify case sensitivity here ' Check other users If Not ValidateUser Then Set conn = Server.CreateObject("ADODB.Connection") conn.open xDb_Conn_Str sFilter = "([KULLANICI_USER] = '" & AdjustSql(Username) & "')" sSql = ewBuildSql(ewSqlSelect, ewSqlWhere, ewSqlGroupBy, ewSqlHaving, ewSqlOrderBy, sFilter, "") Set rs = conn.Execute(sSql) If Not rs.Eof Then If CaseSensitive Then ValidateUser = (rs("KULLANICI_PASSWORD") = Password) Else ValidateUser = (LCase(rs("KULLANICI_PASSWORD")) = LCase(Password)) End If If ValidateUser Then Session(ewSessionStatus) = "login" Session(ewSessionUserName) = rs("KULLANICI_USER") ' Load user name Session(ewSessionSysAdmin) = 0 ' Non System Administrator Session("MusteriAdi") = rs("KULLANICI_ADI") Session("FirmaKodu") = request.form("firma") End If End If rs.Close Set rs = Nothing conn.Close Set conn = Nothing End If End Function %>