From 4c501200afa68072cac6d8e94d8fe64e20da3cd7 Mon Sep 17 00:00:00 2001 From: ja Date: Mon, 14 Feb 2022 08:44:30 +0100 Subject: [PATCH] =?UTF-8?q?=C3=84nderungen=20an=20Login=20Prozess?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- login/login_FLEX.aspx | 2 +- login/login_FLEX.aspx.vb | 40 +++++++++++++++++++++++++++++++++++++--- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/login/login_FLEX.aspx b/login/login_FLEX.aspx index 7c4dbe7..67f08ff 100644 --- a/login/login_FLEX.aspx +++ b/login/login_FLEX.aspx @@ -548,4 +548,4 @@ } - + \ No newline at end of file diff --git a/login/login_FLEX.aspx.vb b/login/login_FLEX.aspx.vb index e86ceaf..a8c7f72 100644 --- a/login/login_FLEX.aspx.vb +++ b/login/login_FLEX.aspx.vb @@ -100,7 +100,7 @@ Partial Class login_FLEX End Try End Sub - Protected Async Sub ValidateUser(sender As Object, e As EventArgs) Handles Login1.LoggingIn + Protected Async Sub ValidateUser(sender As Object, e As EventArgs) Handles Login1.Authenticate Dim ConnectionString = "" If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True @@ -248,7 +248,7 @@ Partial Class login_FLEX 'End If FormsAuthentication.RedirectFromLoginPage(UserNaMe, True) End Sub - Protected Async Sub ValidateUser_M(sender As Object, e As EventArgs) Handles Login2.LoggingIn + Protected Async Sub ValidateUser_M(sender As Object, e As EventArgs) Handles Login2.Authenticate Dim ConnectionString = "" If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True @@ -449,4 +449,38 @@ Partial Class login_FLEX TestPerformance.createnUsers(Integer.Parse(str)) End Sub -End Class \ No newline at end of file + Protected Sub setDBLastLoggedIn(Username As String) + Dim ConnectionString = "" + If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then + 'ConnectionString = "Server=DEVELOPER\DEVSQL;Database=VERAG_HOMEPAGE;Uid=sa;Pwd=BmWr501956" + ConnectionString = "Server=DEVELOPER\DEVSQL;Database=VERAG_HOMEPAGE;Uid=AppUser;Pwd=yp/THDd?xM+pZ$;" + Else + ConnectionString = "Server=DEVELOPER.verag.ost.dmn\DEVSQL;Database=VERAG_HOMEPAGE;Uid=AppUser;Pwd=yp/THDd?xM+pZ$;" + 'ConnectionString = "Server=db593295684.db.1and1.com;Database=db593295684;Uid=dbo593295684;Pwd=atilla#2;" + End If + + + Using con As New SqlConnection(ConnectionString) + + Using cmd As New SqlCommand("insert into [VERAG_HOMEPAGE].[dbo].[Users] ([LastLoginDate]) values ('" & Date.Now.ToString & "')") + ' cmd.CommandType = CommandType.StoredProcedure + cmd.Parameters.AddWithValue("@Username", Login1.UserName) + cmd.Parameters.AddWithValue("@Password", VERAG_PROG_ALLGEMEIN.cCryptography.Encrypt(Login1.Password)) + cmd.Connection = con + con.Open() + Try + con.ConnectionString = "Data Source=TYNE-PC;Initial Catalog=trial;Integrated Security=True" + con.Open() + cmd.Connection = con + cmd.ExecuteNonQuery() + + Catch ex As Exception + + Finally + con.Close() + End Try + End Using + End Using + + End Sub +End Class