diff --git a/login/ForgotPW.aspx.vb b/login/ForgotPW.aspx.vb index 79e3fd9..0cfa70d 100644 --- a/login/ForgotPW.aspx.vb +++ b/login/ForgotPW.aspx.vb @@ -7,7 +7,15 @@ Imports System.Data Partial Class login_ForgotPW Inherits System.Web.UI.Page - + Protected Sub Page_Load(sender As Object, e As EventArgs) + If txt_Username.Text = "" Then + Try + txt_Username.Text = Request.QueryString.Item("Par1") + Catch ex As Exception + MsgBox(ex.Message) + End Try + End If + End Sub Protected Sub btn_Back_Click(sender As Object, e As EventArgs) Response.Redirect("login/login_FLEX.aspx") End Sub @@ -30,7 +38,7 @@ Partial Class login_ForgotPW ' 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 COUNT(*) FROM [VERAG_HOMEPAGE].[dbo].[Users] WHERE Username=@Username") + Using cmd As New SqlCommand("SELECT Username,Password FROM [VERAG_HOMEPAGE].[dbo].[Users] WHERE Username=@Username") ' cmd.CommandType = CommandType.StoredProcedure cmd.Parameters.AddWithValue("@Username", username) cmd.Connection = con @@ -38,16 +46,17 @@ Partial Class login_ForgotPW 'userId = Convert.ToInt32(cmd.ExecuteScalar()) Dim dr As SqlDataReader = cmd.ExecuteReader() If dr.Read() Then - username = dr("@Username").ToString() + username = dr("Username").ToString() + password = dr("Password").ToString() End If End Using con.Close() End Using If Not String.IsNullOrEmpty(username) Then - password = RandomString(New Random, 10) + 'password = RandomString(New Random, 10) 'SendEmail(username, password, email) - MsgBox("Mail would be sent successfully!" + Environment.NewLine + "new PW: \t" + password) + MsgBox("Mail would be sent successfully!") lblMessage.ForeColor = Color.Green lblMessage.Text = "Passwort wurde erfolgreich an die angegebene E-Mail Adresse gesendet." Else diff --git a/login/login_FLEX.aspx b/login/login_FLEX.aspx index 63f55cb..a1c87b4 100644 --- a/login/login_FLEX.aspx +++ b/login/login_FLEX.aspx @@ -144,7 +144,7 @@