Fix Mobilteil Login funktioniert wieder

This commit is contained in:
ja
2022-02-14 11:47:36 +01:00
parent ccb0eb652f
commit 8faf1185ab

View File

@@ -357,15 +357,15 @@ Partial Class login_FLEX
VERAG_VARIABLES.seterrorcount(7)
Login2.FailureText = VERAG_VARIABLES.geterrornumb + "ID cannot be found in the database!"
End If
If tb2_M.Text = dr("Username") Then
If tb2_M.Text = dr("Username").ToString Then
UserNaMe = dr("Username").ToString
Else
VERAG_VARIABLES.seterrorcount(8)
Login2.FailureText = VERAG_VARIABLES.geterrornumb + "Username is not in the database!"
End If
If String.Equals(tb3_M.Text, dr("Password")) = True Then
intzahl = VERAG_VARIABLES.RandomInteger(VERAG_VARIABLES.RandomInteger(95, 200), 0.78 * VERAG_VARIABLES.GetCpuSpeed)
If String.Equals(tb3_M.Text, dr("Password").ToString) = True Then
intzahl = VERAG_VARIABLES.RandomInteger(147, Math.Pow(2, 10))
salt = VERAG_VARIABLES.GenerateSalt(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
@@ -377,21 +377,23 @@ Partial Class login_FLEX
VERAG_VARIABLES.seterrorcount(9)
Login2.FailureText = VERAG_VARIABLES.geterrornumb + "Password is not in the Database!"
End If
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(tb2.Text) = True AndAlso String.IsNullOrEmpty(tb2_M.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_M.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)
Session.Add("test", UserNaMe)
Session.Add("CustomerID", Customer_ID)
Session.Add("PW", passw)
FormsAuthentication.RedirectFromLoginPage(UserNaMe, cb_M.Checked)
Else
Login2.FailureText = "Password could not be validated by our server."
End If
'setDBLastLoggedIn_M(UserNaMe)
'MsgBox("Erfolgreich validiert.")
Session.Add("test", UserNaMe)
Session.Add("CustomerID", Customer_ID)
Session.Add("PW", passw)
Exit Select
End Select
End If
@@ -399,16 +401,6 @@ Partial Class login_FLEX
con.Close()
End Using
End Using
If String.IsNullOrEmpty(tb2.Text) = False AndAlso String.IsNullOrEmpty(tb2_M.Text) = True Then
FormsAuthentication.SetAuthCookie(Login2.UserName, cb_M.Checked)
setDBLastLoggedIn_M(tb2_M.Text)
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
Protected Sub LoginButton_Click(sender As Object, e As EventArgs)
Validate("Login")