Änderungen

This commit is contained in:
ja
2021-10-19 11:56:31 +02:00
parent 32a4c6e633
commit 443a2fdc1c

View File

@@ -21,6 +21,18 @@ Partial Class ForgotPW
Dim tokenname As String = String.Empty
Dim userID As String = String.Empty
Dim Booluser_desktop_notempty As Boolean = False
Dim Booluser_desktop_regex As Boolean = False
Dim Booluser_mobile_notempty As Boolean = False
Dim Booluser_mobile_regex As Boolean = False
Dim Boolemail_desktop_notempty As Boolean = False
Dim Boolemail_desktop_regexdomain As Boolean = False
Dim Boolemail_desktop_regex As Boolean = False
Dim Boolemail_mobile_notempty As Boolean = False
Dim Boolemail_mobile_regexdomain As Boolean = False
Dim Boolemail_mobile_regex As Boolean = False
If String.IsNullOrEmpty(txtEmail_M.Text) = True And String.IsNullOrEmpty(txt_Username_M.Text) = True And String.IsNullOrEmpty(txtEmail.Text) = False And String.IsNullOrEmpty(txt_Username.Text) = False Then
regexval_2_txt_Email_M.Enabled = False
valreqtxtEmail_M.Enabled = False
@@ -31,21 +43,50 @@ Partial Class ForgotPW
regexval_txt_Email.Enabled = True
valreqtxtEmail.Validate()
If valreqtxtEmail.IsValid = True Then
email = txtEmail.Text
ElseIf valreqtxtEmail.IsValid = False Then
valreqtxtEmail.ErrorMessage = "Annotation: The given Domain is not the company domain."
regexval_txt_Email.Validate()
regexval_txt_Email_2.IsValid = True
End If
If valreqtxtEmail.IsValid = True Then
Boolemail_desktop_notempty = True
Boolemail_mobile_notempty = False
If Boolemail_desktop_notempty = True Then
regexval_txt_Email_2.Validate()
If regexval_txt_Email_2.IsValid = True Then
Boolemail_desktop_regex = True
Boolemail_mobile_regex = False
End If
If Boolemail_desktop_notempty = True AndAlso Boolemail_desktop_regexdomain = True AndAlso Boolemail_desktop_regex = True Then
email = txtEmail.Text
Else
regexval_txt_Email_2.IsValid = True
Boolemail_desktop_regex = True
Boolemail_mobile_regex = False
If Boolemail_desktop_regexdomain = True Then
email = txtEmail.Text
End If
End If
ElseIf valreqtxtEmail.IsValid = False Then
Boolemail_desktop_regexdomain = False
valreqtxtEmail.ErrorMessage = "Annotation: The given Domain is not the company domain."
regexval_txt_Email.Validate()
Boolemail_desktop_regex = True
If Boolemail_desktop_regex = True AndAlso Boolemail_desktop_regexdomain = False Then
regexval_txt_Email_2.IsValid = True
email = txtEmail.Text
End If
End If
End If
valreqtxtusername.Validate()
If valreqtxtusername.IsValid = True Then
Booluser_desktop_notempty = True
Booluser_mobile_notempty = False
check_UserName_regex.Validate()
If check_UserName_regex.IsValid = False Then
check_UserName_regex.ErrorMessage = "Annotation: The Username does not match the requirements."
Else
If check_UserName_regex.IsValid = True Then
Booluser_desktop_regex = True
Booluser_mobile_regex = False
check_UserName_regex.Validate()
If check_UserName_regex.IsValid = True AndAlso Boolemail_desktop_notempty = True AndAlso Booluser_desktop_regex = True And Booluser_desktop_notempty = True AndAlso Booluser_mobile_regex = False Then
username = txt_Username.Text
End If
End If
@@ -63,31 +104,56 @@ Partial Class ForgotPW
valreqtxtEmail_M.Validate()
If valreqtxtEmail_M.IsValid = True Then
email = txtEmail_M.Text
ElseIf valreqtxtEmail_M.IsValid = False Then
valreqtxtEmail_M.ErrorMessage = "Annotation: The given Domain is not the company domain."
regexval_txt_Email_M.Validate()
regexval_txt_Email_2.IsValid = True
Boolemail_mobile_notempty = True
Boolemail_desktop_notempty = False
If Boolemail_mobile_regexdomain = True Then
regexval_2_txt_Email_M.Validate()
If regexval_2_txt_Email_M.IsValid = True Then
Boolemail_mobile_regex = True
Boolemail_desktop_regex = False
End If
If Boolemail_mobile_notempty = True AndAlso Boolemail_mobile_regexdomain = True AndAlso Boolemail_mobile_regex = True Then
email = txtEmail.Text
Else
regexval_txt_Email_2.IsValid = True
Boolemail_mobile_regex = True
Boolemail_desktop_regex = False
If Boolemail_mobile_regexdomain = True Then
email = txtEmail_M.Text
End If
End If
ElseIf valreqtxtEmail_M.IsValid = False Then
Boolemail_mobile_regexdomain = False
valreqtxtEmail.ErrorMessage = "Annotation: The given Domain is not the company domain."
regexval_txt_Email.Validate()
Boolemail_mobile_regex = True
If Boolemail_mobile_regex = True AndAlso Boolemail_mobile_regexdomain = False Then
regexval_txt_Email_2.IsValid = True
email = txtEmail.Text
End If
End If
End If
valreqtxtusername_M.Validate()
If valreqtxtusername_M.IsValid = True Then
check_UserName_regex_M.Validate()
If check_UserName_regex_M.IsValid = False Then
check_UserName_regex_M.ErrorMessage = "Annotation: The Username does not match the requirements."
Else
check_UserName_regex_M.IsValid = True
End If
If check_UserName_regex_M.IsValid = True Then
username = txt_Username_M.Text
If valreqtxtusername_M.IsValid = True Then
Booluser_mobile_notempty = True
Booluser_desktop_notempty = False
check_UserName_regex_M.Validate()
If check_UserName_regex_M.IsValid = False Then
check_UserName_regex_M.ErrorMessage = "Annotation: The Username does not match the requirements."
Else
Booluser_desktop_regex = False
Booluser_mobile_regex = True
check_UserName_regex_M.Validate()
If check_UserName_regex_M.IsValid = True AndAlso Booluser_mobile_regex = True AndAlso Booluser_desktop_regex = False Then
username = txt_Username_M.Text
End If
End If
End If
End If
End If
'Erweiterte Degub Msg-Box
'MsgBox("Userdaten in App" + Environment.NewLine + email + Environment.NewLine + username + Environment.NewLine + "Userdaten desktop" + txt_Username.Text + Environment.NewLine + txtEmail.Text + Environment.NewLine + "Userdaten Mobil:" + Environment.NewLine + txtEmail_M.Text + Environment.NewLine + txt_Username_M.Text)
If String.IsNullOrEmpty(email) = False And String.IsNullOrEmpty(tokenname) = True And String.IsNullOrEmpty(password) = True And String.IsNullOrEmpty(username) = False And String.IsNullOrEmpty(userID) = True Then
'Erweiterte Degub Msg-Box
'MsgBox("Userdaten in App" + Environment.NewLine + email + Environment.NewLine + username + Environment.NewLine + "Userdaten desktop" + txt_Username.Text + Environment.NewLine + txtEmail.Text + Environment.NewLine + "Userdaten Mobil:" + Environment.NewLine + txtEmail_M.Text + Environment.NewLine + txt_Username_M.Text)
If String.IsNullOrEmpty(email) = False And String.IsNullOrEmpty(tokenname) = True And String.IsNullOrEmpty(password) = True And String.IsNullOrEmpty(username) = False And String.IsNullOrEmpty(userID) = True Then
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
'ConnectionString = "Server=DEVELOPER\DEVSQL;Database=VERAG_HOMEPAGE;Uid=sa;Pwd=BmWr501956"
@@ -121,14 +187,15 @@ Partial Class ForgotPW
ElseIf txt_Username_M.Text = dr("Username").ToString() AndAlso txt_Username.Text = String.Empty And String.IsNullOrEmpty(VERAG_PROG_ALLGEMEIN.cCryptography2.Decrypt(userID)) = False Then
check_UserName_regex.Enabled = False
check_UserName_regex_M.Enabled = True
check_UserName_regex_M.IsValid = True
username = txt_Username_M.Text
If check_UserName_regex_M.IsValid = True Then
username = txt_Username_M.Text
End If
ElseIf String.IsNullOrEmpty(txt_Username_M.Text) = True AndAlso String.IsNullOrEmpty(txtEmail.Text) = True And String.IsNullOrEmpty(VERAG_PROG_ALLGEMEIN.cCryptography2.Decrypt(userID)) = False Then
check_UserName_regex_M.MatchTimeout = 3000
check_UserName_regex_M.ErrorMessage = "No valid Username found in out database!"
check_UserName_regex_M.IsValid = False
ElseIf String.IsNullOrEmpty(txt_Username.Text) = False Then
check_UserName_regex.MatchTimeout = 3000
check_UserName_regex_M.MatchTimeout = 3000
check_UserName_regex_M.ErrorMessage = "No valid Username found in out database!"
check_UserName_regex_M.IsValid = False
ElseIf String.IsNullOrEmpty(txt_Username.Text) = False Then
check_UserName_regex.MatchTimeout = 3000
check_UserName_regex.ErrorMessage = "No valid Username found in out database!"
check_UserName_regex.IsValid = False
End If
@@ -139,7 +206,7 @@ Partial Class ForgotPW
email = txtEmail.Text
lblMessage.ForeColor = Color.Green
lblMessage.Text = "The given e-mail exists in our database."
ElseIf (txtEmail_M.Text = dr("Email").ToString() And txtEmail.Attributes.Item("Placeholder") = "E-mail") Then
ElseIf (txtEmail_M.Text = dr("Email").ToString() AndAlso String.IsNullOrEmpty(txtEmail.Text) = True) And String.IsNullOrEmpty(VERAG_PROG_ALLGEMEIN.cCryptography2.Decrypt(userID)) = False Then
regexval_txt_Email_M.Validate()
email = txtEmail_M.Text
lblMessage_M.ForeColor = Color.Green