From 5d0966f2577633d984a61f76f2f17ec9d4651691 Mon Sep 17 00:00:00 2001 From: ja Date: Thu, 11 Nov 2021 08:31:16 +0100 Subject: [PATCH] Fix keine Email wurde gesendet --- Global.asax | 2 -- login/ForgotPW.aspx.vb | 31 ++++++++++++++++++++++--------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/Global.asax b/Global.asax index a7ce554..58b6820 100644 --- a/Global.asax +++ b/Global.asax @@ -40,8 +40,6 @@ // in der Datei "Web.config" auf "InProc" festgelegt ist. Wenn der Sitzungsmodus auf "StateServer" // oder "SQLServer" festgelegt ist, wird das Ereignis nicht ausgelöst. - - Session.Remove("TokenforEmail"); Session.Remove("SessID"); Session.Remove("CustomerID"); diff --git a/login/ForgotPW.aspx.vb b/login/ForgotPW.aspx.vb index fbfa8ed..7fbb1c1 100644 --- a/login/ForgotPW.aspx.vb +++ b/login/ForgotPW.aspx.vb @@ -44,7 +44,7 @@ Partial Class ForgotPW valreqtxtEmail.Validate() If valreqtxtEmail.IsValid = True Then regexval_txt_Email.Validate() - If regexval_txt_Email.IsValid = True Then + If regexval_txt_Email.IsValid = False Then regexval_txt_Email.ForeColor = Drawing.Color.OrangeRed regexval_txt_Email.ErrorMessage = "Annotation: The Domain does not match." regexval_txt_Email_2.Validate() @@ -122,10 +122,10 @@ Partial Class ForgotPW username = dr("Username").ToString() password = dr("Password").ToString() email = dr("Email").ToString() - customerID = dr("UserId").ToString() + customerID = dr("KundenNr").ToString() Try - If txt_Username.Text = dr("Username").ToString() AndAlso String.IsNullOrEmpty(txt_Username_M.Text) = True And String.IsNullOrEmpty(customerID) = True Then + If txt_Username.Text = dr("Username").ToString() AndAlso String.IsNullOrEmpty(txt_Username_M.Text) = True And String.IsNullOrEmpty(customerID) = False Then username = txt_Username.Text isusrnmright = True ElseIf String.IsNullOrEmpty(txt_Username.Text) = True Then @@ -138,12 +138,12 @@ Partial Class ForgotPW isusrnmright = False End Try End If - If (txtEmail.Text = dr("Email").ToString() AndAlso String.IsNullOrEmpty(txtEmail_M.Text) = True) And String.IsNullOrEmpty(VERAG_PROG_ALLGEMEIN.cCryptography2.Decrypt(customerID)) = True Then + If (txtEmail.Text = dr("Email").ToString() AndAlso String.IsNullOrEmpty(txtEmail_M.Text) = True) And String.IsNullOrEmpty(customerID) = False Then email = txtEmail.Text lblMessage.ForeColor = Color.Green isemailright = True lblMessage.Text = "The given e-mail exists in our database." - ElseIf String.IsNullOrEmpty(customerID) = True Then + ElseIf String.IsNullOrEmpty(email) = True Then lblMessage_M.ForeColor = Color.Red isemailright = False lblMessage_M.Text = "The given User does not exist in our database." @@ -152,7 +152,20 @@ Partial Class ForgotPW isemailright = False lblMessage_M.Text = "The given e-mail does not exist in our database." End If - + If (txt_CustomerID.Text = dr("KundenNr").ToString() AndAlso String.IsNullOrEmpty(txt_CustomerID_M.Text) = True) And String.IsNullOrEmpty(customerID) = False Then + email = txtEmail.Text + lblMessage.ForeColor = Color.Green + isCustomeridright = True + lblMessage.Text = "The given Customer-ID exists in our database." + ElseIf String.IsNullOrEmpty(customerID) = True Then + lblMessage_M.ForeColor = Color.Red + isCustomeridright = False + lblMessage_M.Text = "The given Customer-ID does not exist in our database." + Else + lblMessage_M.ForeColor = Color.Red + isCustomeridright = False + lblMessage_M.Text = "The given Customer-ID does not exist in our database." + End If Catch ex As Exception Dim Msg, Style, Title As String Msg = "E-Mail validation failed!" & vbCrLf + "Please try again!" @@ -334,7 +347,7 @@ Partial Class ForgotPW email = dr("Email").ToString() customerID = dr("UserId").ToString() Try - If (txt_CustomerID_M.Text = dr("userId").ToString() AndAlso String.IsNullOrEmpty(txt_CustomerID.Text) = True) And String.IsNullOrEmpty(VERAG_PROG_ALLGEMEIN.cCryptography2.Decrypt(customerID)) = True Then + If (txt_CustomerID_M.Text = dr("userId").ToString() AndAlso String.IsNullOrEmpty(txt_CustomerID.Text) = True) And String.IsNullOrEmpty(customerID) = True Then customerID = txt_CustomerID_M.Text lblMessage_M.ForeColor = Color.Green isuserIDright = True @@ -352,7 +365,7 @@ Partial Class ForgotPW Title = "Authentication error!" End Try Try - If (txtEmail_M.Text = dr("Email").ToString() AndAlso String.IsNullOrEmpty(txtEmail.Text) = True) And String.IsNullOrEmpty(VERAG_PROG_ALLGEMEIN.cCryptography2.Decrypt(customerID)) = True Then + If (txtEmail_M.Text = dr("Email").ToString() AndAlso String.IsNullOrEmpty(txtEmail.Text) = True) And String.IsNullOrEmpty(customerID) = False Then email = txtEmail_M.Text isuserEmailright = True lblMessage_M.ForeColor = Color.Green @@ -370,7 +383,7 @@ Partial Class ForgotPW Title = "Authentication error!" End Try Try - If (txt_Username_M.Text = dr("Username").ToString() AndAlso String.IsNullOrEmpty(txt_Username_M.Text) = True) And String.IsNullOrEmpty(VERAG_PROG_ALLGEMEIN.cCryptography2.Decrypt(customerID)) = True Then + If (txt_Username_M.Text = dr("Username").ToString() AndAlso String.IsNullOrEmpty(txt_Username_M.Text) = True) And String.IsNullOrEmpty(customerID) = True Then username = txt_Username_M.Text lblMessage_M.ForeColor = Color.Green isusernameright = True