PW vergessen wird korrekt ausgeführt.
This commit is contained in:
@@ -7,7 +7,15 @@ Imports System.Data
|
|||||||
|
|
||||||
Partial Class login_ForgotPW
|
Partial Class login_ForgotPW
|
||||||
Inherits System.Web.UI.Page
|
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)
|
Protected Sub btn_Back_Click(sender As Object, e As EventArgs)
|
||||||
Response.Redirect("login/login_FLEX.aspx")
|
Response.Redirect("login/login_FLEX.aspx")
|
||||||
End Sub
|
End Sub
|
||||||
@@ -30,7 +38,7 @@ Partial Class login_ForgotPW
|
|||||||
' Dim constr As String = ConfigurationManager.ConnectionStrings("constr").ConnectionString
|
' Dim constr As String = ConfigurationManager.ConnectionStrings("constr").ConnectionString
|
||||||
Using con As New SqlConnection(ConnectionString)
|
Using con As New SqlConnection(ConnectionString)
|
||||||
' Using cmd As New SqlCommand("Validate_User")
|
' 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.CommandType = CommandType.StoredProcedure
|
||||||
cmd.Parameters.AddWithValue("@Username", username)
|
cmd.Parameters.AddWithValue("@Username", username)
|
||||||
cmd.Connection = con
|
cmd.Connection = con
|
||||||
@@ -38,16 +46,17 @@ Partial Class login_ForgotPW
|
|||||||
'userId = Convert.ToInt32(cmd.ExecuteScalar())
|
'userId = Convert.ToInt32(cmd.ExecuteScalar())
|
||||||
Dim dr As SqlDataReader = cmd.ExecuteReader()
|
Dim dr As SqlDataReader = cmd.ExecuteReader()
|
||||||
If dr.Read() Then
|
If dr.Read() Then
|
||||||
username = dr("@Username").ToString()
|
username = dr("Username").ToString()
|
||||||
|
password = dr("Password").ToString()
|
||||||
End If
|
End If
|
||||||
End Using
|
End Using
|
||||||
con.Close()
|
con.Close()
|
||||||
End Using
|
End Using
|
||||||
|
|
||||||
If Not String.IsNullOrEmpty(username) Then
|
If Not String.IsNullOrEmpty(username) Then
|
||||||
password = RandomString(New Random, 10)
|
'password = RandomString(New Random, 10)
|
||||||
'SendEmail(username, password, email)
|
'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.ForeColor = Color.Green
|
||||||
lblMessage.Text = "Passwort wurde erfolgreich an die angegebene E-Mail Adresse gesendet."
|
lblMessage.Text = "Passwort wurde erfolgreich an die angegebene E-Mail Adresse gesendet."
|
||||||
Else
|
Else
|
||||||
|
|||||||
@@ -144,7 +144,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left" colspan="2">
|
<td align="left" colspan="2">
|
||||||
<asp:LinkButton ID="LinkButton2" runat="server" target="_top" href="ForgotPW.aspx">Passwort Vergessen</asp:LinkButton>
|
<a ID="LinkButton2" runat="server" target="_top" href="ForgotPW.aspx">Passwort Vergessen</a>
|
||||||
</td>
|
</td>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -152,21 +152,7 @@
|
|||||||
</LayoutTemplate>
|
</LayoutTemplate>
|
||||||
</asp:Login>
|
</asp:Login>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
|
||||||
function bust3() {
|
|
||||||
if (top.location == self) {
|
|
||||||
var zipphone2_1 = getElementById("#CustomerID").val();
|
|
||||||
var zipphone2_2 = getElementById("#UserName").val();
|
|
||||||
var zipphone2_3 = getElementById("#Password").val();
|
|
||||||
alert("send:" + zipphone2_1)
|
|
||||||
alert("send:" + zipphone2_2)
|
|
||||||
alert("send:" + zipphone2_3)
|
|
||||||
//parent.location.replace('../Customers/Welcome.aspx');
|
|
||||||
top.location = 'ForgotPW.aspx';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function bust2() {
|
function bust2() {
|
||||||
if (top.location == self) {
|
if (top.location == self) {
|
||||||
|
|||||||
Reference in New Issue
Block a user