%@ CodePage = 1254 LCID = 1055 %> <% Response.expires = 0 Response.expiresabsolute = Now() - 1 Response.addHeader "pragma", "no-cache" Response.addHeader "cache-control", "private" Response.addHeader "cache-control", "no-cache" Response.addHeader "cache-control", "no-store" Response.CacheControl = "no-cache" %> <% If Request.Form("submit") <> "" 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 = Date + 365 ' 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 = Date + 365 ' 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ı Adı veya Şifre" End If 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 %>
Girişi Sayfası
<% If Session(ewSessionMessage) <> "" Then %><%= 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 AdminUsername = "uguradmin" AdminPassword = "ug1234ur" ' Check hard coded admin first If CaseSensitive Then ValidateUser = (AdminUsername = Username And AdminPassword = Password) Else ValidateUser = (LCase(AdminUsername) = LCase(Username) And LCase(AdminPassword) = LCase(Password)) End If If ValidateUser Then Session(ewSessionStatus) = "login" Session(ewSessionSysAdmin) = 1 ' System Administrator End If End Function %>