Tokengenerierungsmsg box wurde zwecks Debugging eingebaut aber auskommentiert.
This commit is contained in:
@@ -24,7 +24,7 @@ Partial Class login_ForgotPW
|
||||
Dim username As String = txt_Username.Text
|
||||
Dim password As String = String.Empty
|
||||
Dim email As String = txtEmail.Text
|
||||
|
||||
Dim tokenname As String = ""
|
||||
' cDBFunctions.GetNewOpenConnection()
|
||||
Dim ConnectionString = ""
|
||||
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
||||
@@ -75,13 +75,21 @@ Partial Class login_ForgotPW
|
||||
|
||||
If Not String.IsNullOrEmpty(username) Then
|
||||
'password = RandomString(New Random, 10)
|
||||
genToken(username, password, email)
|
||||
tokenname = genToken(username, password, email)
|
||||
'If (getDateoftoken(tokenname) = True) Then
|
||||
'Dim msgboxstyle = vbDefaultButton1 + vbOK
|
||||
|
||||
' MsgBox(tokenname, msgboxstyle)
|
||||
'Else
|
||||
' MsgBox("token nicht mehr Gültig! Neuer wird generiert!")
|
||||
'tokenname = genToken(username, password, email)
|
||||
'End If
|
||||
'SendEmail(username, password, email)
|
||||
MsgBox("Mail would be sent successfully!")
|
||||
lblMessage.ForeColor = Color.Green
|
||||
lblMessage.Text = "Passwort wurde erfolgreich an die angegebene E-Mail Adresse gesendet."
|
||||
Else
|
||||
MsgBox("Mail would not be sent successfully!")
|
||||
lblMessage.ForeColor = Color.Green
|
||||
lblMessage.Text = "Passwort wurde erfolgreich an die angegebene E-Mail Adresse gesendet."
|
||||
Else
|
||||
MsgBox("Mail would not be sent successfully!")
|
||||
lblMessage.ForeColor = Color.Red
|
||||
lblMessage.Text = "Diese E-Mail ist nicht in unserer Datenbank vorhanden."
|
||||
End If
|
||||
@@ -113,6 +121,7 @@ Partial Class login_ForgotPW
|
||||
mySmtpsvr.Credentials = myCredentials
|
||||
|
||||
Try
|
||||
'genToken(username, password, email)
|
||||
Msg.From = New MailAddress("al@verag.ag")
|
||||
Msg.To.Add(email)
|
||||
Msg.Subject = "Passwort reset"
|
||||
@@ -132,7 +141,8 @@ Partial Class login_ForgotPW
|
||||
Dim time() As Byte = BitConverter.GetBytes(DateTime.UtcNow.ToBinary())
|
||||
Dim Key() As Byte = Guid.NewGuid().ToByteArray()
|
||||
Try
|
||||
Dim token As String = Convert.ToBase64String(time.Concat(Key).ToArray())
|
||||
Dim token As String
|
||||
token = Convert.ToBase64String(time.Concat(Key).ToArray())
|
||||
Return token
|
||||
Catch Ex As Exception
|
||||
Dim Msg, Style, Title As String
|
||||
|
||||
Reference in New Issue
Block a user