Login Problem behoben am Desktop

This commit is contained in:
ja
2022-02-14 11:24:26 +01:00
parent 46723f8567
commit ccb0eb652f
2 changed files with 30 additions and 18 deletions

View File

@@ -75,7 +75,7 @@ Partial Class Customers_Default3
<ScriptMethod(ResponseFormat:=ResponseFormat.Json, UseHttpGet:=False)> <ScriptMethod(ResponseFormat:=ResponseFormat.Json, UseHttpGet:=False)>
Public Shared Function filltabledetails(Kennzeichen As String, Kundennr As String, CardNo As String, SDLNr As String, History As String) As FormattedList Public Shared Function filltabledetails(Kennzeichen As String, Kundennr As String, CardNo As String, SDLNr As String, History As String) As FormattedList
Dim list As List(Of String) = New List(Of String) Dim list As List(Of String) = New List(Of String)
Dim list2 As List(Of VERAG_PROG_ALLGEMEIN.cSDL) = VERAG_PROG_ALLGEMEIN.cSDL.GET_LIST_WEB_LKW(Integer.Parse(Kdnrtext), Kennzeichen) Dim list2 As List(Of VERAG_PROG_ALLGEMEIN.cSDL) = VERAG_PROG_ALLGEMEIN.cSDL.GET_LIST_WEB_LKW(Integer.Parse(Kundennr), Kennzeichen)
Dim listdetails As New List(Of List(Of String)) Dim listdetails As New List(Of List(Of String))
For Each l2 In list2 For Each l2 In list2
If l2.KundenNr.ToString = Kundennr AndAlso l2.SDLNr.ToString = SDLNr And l2.History.ToString = History Then If l2.KundenNr.ToString = Kundennr AndAlso l2.SDLNr.ToString = SDLNr And l2.History.ToString = History Then

View File

@@ -171,8 +171,8 @@ Partial Class login_FLEX
reqfieldvalpassw.Validate() reqfieldvalpassw.Validate()
If reqfieldvalpassw.IsValid = True Then If reqfieldvalpassw.IsValid = True Then
intzahl = VERAG_VARIABLES.RandomInteger(107, Math.Pow(2, 10)) intzahl = VERAG_VARIABLES.RandomInteger(107, Math.Pow(2, 10))
Dim hashpw1 As Byte() = Await VERAG_VARIABLES.HashPasswordAsync(tb3_M.Text, salt, intzahliterats, intzahl) Dim hashpw1 As Byte() = Await VERAG_VARIABLES.HashPasswordAsync(tb3.Text, salt, intzahliterats, intzahl)
passw = tb3_M.Text passw = tb3.Text
End If End If
End If End If
@@ -214,12 +214,12 @@ Partial Class login_FLEX
VERAG_VARIABLES.seterrorcount(8) VERAG_VARIABLES.seterrorcount(8)
Login1.FailureText = VERAG_VARIABLES.geterrornumb + "Username is not in the database!" Login1.FailureText = VERAG_VARIABLES.geterrornumb + "Username is not in the database!"
End If End If
If String.Equals(tb3.Text, dr("Password")) = True Then If String.Equals(tb3.Text, dr("Password").ToString) = True Then
intzahl = VERAG_VARIABLES.RandomInteger(VERAG_VARIABLES.RandomInteger(95, 200), Math.Pow(2, 10)) intzahl = VERAG_VARIABLES.RandomInteger(VERAG_VARIABLES.RandomInteger(95, 200), Math.Pow(2, 10))
salt = VERAG_VARIABLES.GenerateSalt(intzahl) salt = VERAG_VARIABLES.GenerateSalt(intzahl)
Dim hashpw As Byte() = Await VERAG_VARIABLES.HashPasswordAsync(passw, salt, intzahliterats, intzahl) Dim hashpw As Byte() = Await VERAG_VARIABLES.HashPasswordAsync(tb3.Text, salt, intzahliterats, intzahl)
If Await VERAG_VARIABLES.VerifyhashAsync(dr("Password").ToString, salt, hashpw, intzahliterats, intzahl) = True Then If Await VERAG_VARIABLES.VerifyhashAsync(dr("Password").ToString, salt, hashpw, intzahliterats, intzahl) = True Then
passw = dr("Password").ToString passw = tb3.Text
Else Else
passw = String.Empty passw = String.Empty
End If End If
@@ -227,12 +227,22 @@ Partial Class login_FLEX
VERAG_VARIABLES.seterrorcount(9) VERAG_VARIABLES.seterrorcount(9)
Login1.FailureText = VERAG_VARIABLES.geterrornumb + "Password is not in the Database!" Login1.FailureText = VERAG_VARIABLES.geterrornumb + "Password is not in the Database!"
End If End If
If String.IsNullOrEmpty(tb2.Text) = False AndAlso String.IsNullOrEmpty(tb2_M.Text) = True And String.Equals(tb.Text, dr("KundenNr").ToString) = True AndAlso String.Equals(tb2.Text, dr("Username").ToString) = True AndAlso String.Equals(tb3.Text, dr("Password").ToString) = True Then
FormsAuthentication.SetAuthCookie(Login1.UserName, cb.Checked)
'If (String.IsNullOrEmpty(passw) = False And String.IsNullOrEmpty(UserNaMe) = False And String.IsNullOrEmpty(Customer_ID) = False) Then
'Dim str = gensaltToken(UserNaMe, passw, Customer_ID, Session.IsNewSession)
'MsgBox(str)
'End If
FormsAuthentication.RedirectFromLoginPage(UserNaMe, True)
End If
'MsgBox("Erfolgreich validiert.") 'MsgBox("Erfolgreich validiert.")
Session.Add("test", UserNaMe) Session.Add("test", UserNaMe)
Session.Add("CustomerID", Customer_ID) Session.Add("CustomerID", Customer_ID)
Session.Add("PW", passw) Session.Add("PW", passw)
Exit Select Exit Select
setDBLastLoggedIn(tb2.Text) 'setDBLastLoggedIn(tb2.Text)
End Select End Select
End If End If
dr.Close() dr.Close()
@@ -240,15 +250,7 @@ Partial Class login_FLEX
End Using End Using
End Using End Using
If String.IsNullOrEmpty(tb2_M.Text) = False AndAlso String.IsNullOrEmpty(tb2.Text) = True Then
FormsAuthentication.SetAuthCookie(Login1.UserName, cb.Checked)
End If
'If (String.IsNullOrEmpty(passw) = False And String.IsNullOrEmpty(UserNaMe) = False And String.IsNullOrEmpty(Customer_ID) = False) Then
'Dim str = gensaltToken(UserNaMe, passw, Customer_ID, Session.IsNewSession)
'MsgBox(str)
'End If
FormsAuthentication.RedirectFromLoginPage(UserNaMe, True)
End Sub End Sub
Protected Async Sub ValidateUser_M(sender As Object, e As EventArgs) Handles Login2.Authenticate Protected Async Sub ValidateUser_M(sender As Object, e As EventArgs) Handles Login2.Authenticate
Dim ConnectionString = "" Dim ConnectionString = ""
@@ -365,9 +367,9 @@ Partial Class login_FLEX
If String.Equals(tb3_M.Text, dr("Password")) = True Then If String.Equals(tb3_M.Text, dr("Password")) = True Then
intzahl = VERAG_VARIABLES.RandomInteger(VERAG_VARIABLES.RandomInteger(95, 200), 0.78 * VERAG_VARIABLES.GetCpuSpeed) intzahl = VERAG_VARIABLES.RandomInteger(VERAG_VARIABLES.RandomInteger(95, 200), 0.78 * VERAG_VARIABLES.GetCpuSpeed)
salt = VERAG_VARIABLES.GenerateSalt(intzahl) salt = VERAG_VARIABLES.GenerateSalt(intzahl)
Dim hashpw As Byte() = Await VERAG_VARIABLES.HashPasswordAsync(passw, salt, intzahliterats, intzahl) Dim hashpw As Byte() = Await VERAG_VARIABLES.HashPasswordAsync(tb3_M.Text, salt, intzahliterats, intzahl)
If Await VERAG_VARIABLES.VerifyhashAsync(dr("Password").ToString, salt, hashpw, intzahliterats, intzahl) = True Then If Await VERAG_VARIABLES.VerifyhashAsync(dr("Password").ToString, salt, hashpw, intzahliterats, intzahl) = True Then
passw = dr("Password").ToString passw = tb3_M.Text
Else Else
passw = String.Empty passw = String.Empty
End If End If
@@ -375,7 +377,17 @@ Partial Class login_FLEX
VERAG_VARIABLES.seterrorcount(9) VERAG_VARIABLES.seterrorcount(9)
Login2.FailureText = VERAG_VARIABLES.geterrornumb + "Password is not in the Database!" Login2.FailureText = VERAG_VARIABLES.geterrornumb + "Password is not in the Database!"
End If End If
setDBLastLoggedIn_M(UserNaMe) If String.IsNullOrEmpty(tb2_M.Text) = True AndAlso String.IsNullOrEmpty(tb2.Text) = False And String.Equals(tb_M.Text, dr("KundenNr").ToString) = True AndAlso String.Equals(tb2_M.Text, dr("Username").ToString) = True AndAlso String.Equals(tb3_M.Text, dr("Password").ToString) = True Then
FormsAuthentication.SetAuthCookie(Login2.UserName, cb.Checked)
'If (String.IsNullOrEmpty(passw) = False And String.IsNullOrEmpty(UserNaMe) = False And String.IsNullOrEmpty(Customer_ID) = False) Then
'Dim str = gensaltToken(UserNaMe, passw, Customer_ID, Session.IsNewSession)
'MsgBox(str)
'End If
FormsAuthentication.RedirectFromLoginPage(UserNaMe, True)
End If
'setDBLastLoggedIn_M(UserNaMe)
'MsgBox("Erfolgreich validiert.") 'MsgBox("Erfolgreich validiert.")
Session.Add("test", UserNaMe) Session.Add("test", UserNaMe)
Session.Add("CustomerID", Customer_ID) Session.Add("CustomerID", Customer_ID)