Sicherheitsmechnanismus zum nicht zu oft senden versuchen einer mail sowie einer Linkzufügung welche noch auf die Seite hinzeigen muss
This commit is contained in:
@@ -10,7 +10,7 @@ Partial Class login_ForgotPW
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs)
|
||||
If txt_Username.Text = "" Then
|
||||
Try
|
||||
txt_Username.Text = Request.QueryString.Item("Par1")
|
||||
txt_Username.Text = Request.QueryString.Item("urlofchangepwpage")
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
End Try
|
||||
@@ -74,7 +74,6 @@ Partial Class login_ForgotPW
|
||||
tokenname = genToken(username, password, email)
|
||||
If SendEmail(username, password, email) = True Then
|
||||
'password = RandomString(New Random, 10)
|
||||
|
||||
If (getDateoftoken(tokenname) = True) Then
|
||||
Dim msgboxstyle = vbDefaultButton1 + vbOK
|
||||
|
||||
@@ -106,20 +105,28 @@ Partial Class login_ForgotPW
|
||||
End Function
|
||||
|
||||
Function SendEmail(username As String, password As String, email As String) As Boolean
|
||||
Dim lkb As LinkButton = New LinkButton()
|
||||
lkb.PostBackUrl = "ChangePW.aspx"
|
||||
Dim mailto As String = email
|
||||
Dim Betreff As String = "Passwort reset"
|
||||
Dim htmlbody = String.Format("Sehr geehrte/r {0},<br /><br /> Der Link zum Zurücksetzen des Passwortes lautet:<br /><br /><br />.<br />" + Environment.NewLine + "<a href=" + "" + "/ChangePW.aspx" + ">This is default.aspx</a>" + Environment.NewLine + "<br />Mit freundlichen Grüßen,", username, password)
|
||||
Try
|
||||
Dim tokennametemp = genToken(username, password, email)
|
||||
'Dim Strtemp = Session.Keys.Item("urltochangepw")
|
||||
If getDateoftoken(tokennametemp) = True Then
|
||||
Dim mailto As String = email
|
||||
Dim Betreff As String = "Passwort reset"
|
||||
Dim htmlbody = String.Format("Sehr geehrte/r {0},<br /><br /> Der Link zum Zurücksetzen des Passwortes lautet:<br /><br /><br />.<br />" + Environment.NewLine + lkb.PostBackUrl + Environment.NewLine + "<br />Mit freundlichen Grüßen,", username, password)
|
||||
' Dim attachment As Attachment = New Attachment(File.OpenRead(excel), "Kundenliste.xlsx")
|
||||
' Msg.Attachments.Add(attachment)
|
||||
VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(mailto, Betreff, htmlbody)
|
||||
MsgBox("SENT")
|
||||
Dim count = 0
|
||||
Do
|
||||
VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(mailto, Betreff, htmlbody)
|
||||
Loop
|
||||
While count = 2
|
||||
End While
|
||||
|
||||
MsgBox("SENT")
|
||||
Return True
|
||||
Else
|
||||
|
||||
tokennametemp = genToken(username, password, email)
|
||||
VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(mailto, Betreff, htmlbody)
|
||||
Return False
|
||||
End If
|
||||
Catch ex As Exception
|
||||
|
||||
Reference in New Issue
Block a user