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 username As String = txt_Username.Text
|
||||||
Dim password As String = String.Empty
|
Dim password As String = String.Empty
|
||||||
Dim email As String = txtEmail.Text
|
Dim email As String = txtEmail.Text
|
||||||
|
Dim tokenname As String = ""
|
||||||
' cDBFunctions.GetNewOpenConnection()
|
' cDBFunctions.GetNewOpenConnection()
|
||||||
Dim ConnectionString = ""
|
Dim ConnectionString = ""
|
||||||
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
||||||
@@ -75,7 +75,15 @@ Partial Class login_ForgotPW
|
|||||||
|
|
||||||
If Not String.IsNullOrEmpty(username) Then
|
If Not String.IsNullOrEmpty(username) Then
|
||||||
'password = RandomString(New Random, 10)
|
'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)
|
'SendEmail(username, password, email)
|
||||||
MsgBox("Mail would be sent successfully!")
|
MsgBox("Mail would be sent successfully!")
|
||||||
lblMessage.ForeColor = Color.Green
|
lblMessage.ForeColor = Color.Green
|
||||||
@@ -113,6 +121,7 @@ Partial Class login_ForgotPW
|
|||||||
mySmtpsvr.Credentials = myCredentials
|
mySmtpsvr.Credentials = myCredentials
|
||||||
|
|
||||||
Try
|
Try
|
||||||
|
'genToken(username, password, email)
|
||||||
Msg.From = New MailAddress("al@verag.ag")
|
Msg.From = New MailAddress("al@verag.ag")
|
||||||
Msg.To.Add(email)
|
Msg.To.Add(email)
|
||||||
Msg.Subject = "Passwort reset"
|
Msg.Subject = "Passwort reset"
|
||||||
@@ -132,7 +141,8 @@ Partial Class login_ForgotPW
|
|||||||
Dim time() As Byte = BitConverter.GetBytes(DateTime.UtcNow.ToBinary())
|
Dim time() As Byte = BitConverter.GetBytes(DateTime.UtcNow.ToBinary())
|
||||||
Dim Key() As Byte = Guid.NewGuid().ToByteArray()
|
Dim Key() As Byte = Guid.NewGuid().ToByteArray()
|
||||||
Try
|
Try
|
||||||
Dim token As String = Convert.ToBase64String(time.Concat(Key).ToArray())
|
Dim token As String
|
||||||
|
token = Convert.ToBase64String(time.Concat(Key).ToArray())
|
||||||
Return token
|
Return token
|
||||||
Catch Ex As Exception
|
Catch Ex As Exception
|
||||||
Dim Msg, Style, Title As String
|
Dim Msg, Style, Title As String
|
||||||
|
|||||||
Reference in New Issue
Block a user