diff --git a/login/ChangePW.aspx.vb b/login/ChangePW.aspx.vb index 0040047..65b63a2 100644 --- a/login/ChangePW.aspx.vb +++ b/login/ChangePW.aspx.vb @@ -8,6 +8,7 @@ Partial Class login_ChangePW If VERAG_PROG_ALLGEMEIN.cCryptography.Decrypt(Session.Item("TokenforEmail").ToString()) = VERAG_PROG_ALLGEMEIN.cCryptography.Decrypt(Request.QueryString("Par1")) AndAlso VERAG_PROG_ALLGEMEIN.cCryptography.Decrypt(Session.Item("TokenforEmail").ToString()) = Not Nothing AndAlso VERAG_PROG_ALLGEMEIN.cCryptography.Decrypt(Request.QueryString("Par1")) = Not Nothing Then If getDateoftoken(VERAG_PROG_ALLGEMEIN.cCryptography.Decrypt(Request.QueryString("Par1"))) = True Then txt_Pw_WH.Enabled = False + txt_Pw.Enabled = False regexval_txt_Pw_WH.Enabled = False If IsPostBack Then reqPasswtxt.Validate() diff --git a/login/ForgotPW.aspx b/login/ForgotPW.aspx index b436bf3..9f49bcc 100644 --- a/login/ForgotPW.aspx +++ b/login/ForgotPW.aspx @@ -109,7 +109,7 @@ - + diff --git a/login/ForgotPW.aspx.vb b/login/ForgotPW.aspx.vb index cdf3f74..9fbd191 100644 --- a/login/ForgotPW.aspx.vb +++ b/login/ForgotPW.aspx.vb @@ -13,7 +13,7 @@ Partial Class login_ForgotPW End Sub Protected Sub btn_Send_Click(sender As Object, e As EventArgs) - Dim username As String = String.Empty + Dim username As String = txt_Username.Text Dim password As String = String.Empty Dim email As String = String.Empty Dim tokenname As String = String.Empty @@ -26,13 +26,8 @@ Partial Class login_ForgotPW regexval_txt_Email.Validate() valreqtxtEmail.IsValid = True End If - If check_UserName_regex.IsValid = True Then - username = txt_Username.Text - Else - check_UserName_regex.ErrorMessage = "No valid Username found!" - End If + If String.IsNullOrEmpty(email) = False AndAlso String.IsNullOrEmpty(tokenname) = True AndAlso String.IsNullOrEmpty(password) = True AndAlso String.IsNullOrEmpty(username) = False Then - 'cDBFunctions.GetNewOpenConnection() Dim ConnectionString = String.Empty If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then 'ConnectionString = "Server=DEVELOPER\DEVSQL;Database=VERAG_HOMEPAGE;Uid=sa;Pwd=BmWr501956" @@ -41,7 +36,7 @@ Partial Class login_ForgotPW 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 - ' Dim constr As String = ConfigurationManager.ConnectionStrings("constr").ConnectionString + Using con As New SqlConnection(ConnectionString) ' Using cmd As New SqlCommand("Validate_User") Using cmd As New SqlCommand("SELECT Username,Password FROM [VERAG_HOMEPAGE].[dbo].[Users] WHERE Username=@Username") @@ -55,6 +50,13 @@ Partial Class login_ForgotPW username = dr("Username").ToString() password = dr("Password").ToString() Try + If txt_Username.Text = dr("Username").ToString() Then + + check_UserName_regex.IsValid = True + Else + check_UserName_regex.ErrorMessage = "No valid Username found!" + check_UserName_regex.IsValid = False + End If regexval_txt_Email.Validate() Catch ex As Exception Dim Msg, Style, Title As String @@ -147,7 +149,9 @@ Partial Class login_ForgotPW Betreff = "Passwort reset" htmlbody = String.Format("Dear, {0},

Please follow the Link to reset your password:

" + Environment.NewLine + "Link" + Environment.NewLine + "
Kind regards,
VERAG | EDV Support
support@verag.ag,", username, password) ElseIf String.IsNullOrWhiteSpace(HttpContext.Current.Request.ServerVariables("SERVER_NAME")) = True Then - MsgBox("Error09:" + Environment.NewLine + " The Domain could not be vaildated. Check Link please or contact the Administrator of the program.") + 'MsgBox("Error09:" + Environment.NewLine + "The Domain could not be vaildated. Check Link please or contact the Administrator of the program.") + lblMessage.ForeColor = Color.OrangeRed + lblMessage.Text = "Error09:" + Environment.NewLine + "The Domain could not be vaildated. Check the Link please or contact the Administrator of the program." End If 'Dim pg As String = Request.ServerVariables("URL") 'MsgBox("/" + ServPort + Request.ServerVariables("URL")) @@ -165,7 +169,9 @@ Partial Class login_ForgotPW lblMessage.ForeColor = Color.OrangeRed lblMessage.Text = "Error07: Die Paramter wurden nicht alle gesetzt. Bitte Felder überprüfen!" End If - MsgBox("SENT") + lblMessage.ForeColor = Color.OrangeRed + lblMessage.Text = "Success" + Environment.NewLine + " Mail sent. Please check your inbox." + 'MsgBox("SENT") Return True Else lblMessage.ForeColor = Color.Red