Änderungen an Login Prozess

This commit is contained in:
ja
2022-02-14 08:44:30 +01:00
parent 9215a45cb9
commit 4c501200af
2 changed files with 38 additions and 4 deletions

View File

@@ -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
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