Änderungen Css und login logiken
This commit is contained in:
@@ -51,11 +51,14 @@ Partial Class ForgotPW
|
||||
If Boolemail_desktop_notempty = True Then
|
||||
regexval_txt_Email.Validate()
|
||||
If regexval_txt_Email.IsValid = True Then
|
||||
Boolemail_desktop_regex = True
|
||||
Boolemail_desktop_regexdomain = True
|
||||
Boolemail_mobile_regex = False
|
||||
Boolemail_mobile_regexdomain = False
|
||||
End If
|
||||
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
|
||||
@@ -76,7 +79,7 @@ Partial Class ForgotPW
|
||||
email = txtEmail.Text
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
valreqtxtusername.Validate()
|
||||
If valreqtxtusername.IsValid = True Then
|
||||
Booluser_desktop_notempty = True
|
||||
@@ -99,43 +102,49 @@ Partial Class ForgotPW
|
||||
If String.IsNullOrEmpty(txtEmail_M.Text) = False And String.IsNullOrEmpty(txt_Username_M.Text) = False And String.IsNullOrEmpty(txtEmail.Text) = True And String.IsNullOrEmpty(txt_Username.Text) = True Then
|
||||
valreqtxtEmail_M.Enabled = True
|
||||
regexval_2_txt_Email_M.Enabled = True
|
||||
valreqtxtusername_M.Enabled = True
|
||||
regexval_txt_Email.Enabled = False
|
||||
regexval_txt_Email_2.Enabled = False
|
||||
valreqtxtusername.Enabled = False
|
||||
valreqtxtusername_M.Enabled = True
|
||||
|
||||
valreqtxtEmail_M.Validate()
|
||||
|
||||
If valreqtxtEmail_M.IsValid = True Then
|
||||
Boolemail_mobile_notempty = True
|
||||
Boolemail_desktop_notempty = False
|
||||
If Boolemail_mobile_regexdomain = True Then
|
||||
If Boolemail_mobile_notempty = True Then
|
||||
regexval_2_txt_Email_M.Validate()
|
||||
If regexval_2_txt_Email_M.IsValid = True Then
|
||||
Boolemail_mobile_regexdomain = True
|
||||
Boolemail_desktop_regexdomain = 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
|
||||
If Boolemail_mobile_notempty = True AndAlso Boolemail_mobile_regexdomain = True AndAlso Boolemail_mobile_regex = True Then
|
||||
email = txtEmail_M.Text
|
||||
Else
|
||||
regexval_txt_Email_M.IsValid = True
|
||||
Boolemail_mobile_regex = True
|
||||
Boolemail_desktop_regex = False
|
||||
If Boolemail_mobile_regexdomain = True Then
|
||||
email = txtEmail_M.Text
|
||||
End If
|
||||
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
|
||||
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
|
||||
If Boolemail_mobile_regex = True AndAlso Boolemail_mobile_regexdomain = False Then
|
||||
regexval_txt_Email_2.IsValid = True
|
||||
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()
|
||||
valreqtxtusername_M.Validate()
|
||||
If valreqtxtusername_M.IsValid = True Then
|
||||
Booluser_mobile_notempty = True
|
||||
Booluser_desktop_notempty = False
|
||||
@@ -151,24 +160,24 @@ Partial Class ForgotPW
|
||||
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
|
||||
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"
|
||||
ConnectionString = "Server=DEVELOPER\DEVSQL;Database=VERAG_HOMEPAGE;Uid=AppUser;Pwd=yp/THDd?xM+pZ$;"
|
||||
Else
|
||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
||||
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)
|
||||
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"
|
||||
ConnectionString = "Server=DEVELOPER\DEVSQL;Database=VERAG_HOMEPAGE;Uid=AppUser;Pwd=yp/THDd?xM+pZ$;"
|
||||
Else
|
||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
||||
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
|
||||
End If
|
||||
Using con As New SqlConnection(ConnectionString)
|
||||
' Using cmd As New SqlCommand("Validate_User")
|
||||
Using cmd As New SqlCommand("SELECT Username,Password,Email,KundenNr FROM [VERAG_HOMEPAGE].[dbo].[Users] WHERE Username=@Username")
|
||||
Using cmd As New SqlCommand("SELECT Username,Password,Email,KundenNr FROM [VERAG_HOMEPAGE].[dbo].[Users] WHERE Username=@Username AND Email=@Email")
|
||||
' cmd.CommandType = CommandType.StoredProcedure
|
||||
cmd.Parameters.AddWithValue("@Username", username)
|
||||
cmd.Connection = con
|
||||
@@ -182,34 +191,24 @@ Partial Class ForgotPW
|
||||
userID = VERAG_PROG_ALLGEMEIN.cCryptography2.Encrypt(dr("KundenNr").ToString())
|
||||
Try
|
||||
If txt_Username.Text = dr("Username").ToString() AndAlso String.IsNullOrEmpty(txt_Username_M.Text) = True And String.IsNullOrEmpty(VERAG_PROG_ALLGEMEIN.cCryptography2.Decrypt(userID)) = False Then
|
||||
check_UserName_regex_M.Enabled = False
|
||||
check_UserName_regex.Enabled = True
|
||||
check_UserName_regex.IsValid = True
|
||||
username = txt_Username.Text
|
||||
|
||||
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
|
||||
If check_UserName_regex_M.IsValid = True Then
|
||||
username = txt_Username_M.Text
|
||||
End If
|
||||
username = txt_Username_M.Text
|
||||
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
|
||||
If (txtEmail.Text = dr("Email").ToString() AndAlso String.IsNullOrEmpty(txtEmail_M.Text) = True) And String.IsNullOrEmpty(VERAG_PROG_ALLGEMEIN.cCryptography2.Decrypt(userID)) = False Then
|
||||
regexval_txt_Email_M.Enabled = False
|
||||
regexval_txt_Email.Enabled = True
|
||||
regexval_txt_Email.Validate()
|
||||
email = txtEmail.Text
|
||||
lblMessage.ForeColor = Color.Green
|
||||
lblMessage.Text = "The given e-mail exists in our database."
|
||||
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
|
||||
lblMessage_M.Text = "The given e-mail exists in our database."
|
||||
@@ -286,7 +285,7 @@ Partial Class ForgotPW
|
||||
lblMessage.Text = "The form has not been filled completeley."
|
||||
End If
|
||||
Catch Exc As Exception
|
||||
lblMessage.Text = "Error08: No iput found."
|
||||
lblMessage.Text = "Error08: No input found."
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user