Token-Generierung Verbesserungen und Message Box Antworten-Evalition.
This commit is contained in:
@@ -24,7 +24,7 @@ Partial Class login_ChangePW
|
|||||||
|
|
||||||
Protected Sub btn_submitpw_Click(sender As Object, e As EventArgs)
|
Protected Sub btn_submitpw_Click(sender As Object, e As EventArgs)
|
||||||
Dim tempstr As String = ""
|
Dim tempstr As String = ""
|
||||||
Dim Msg, Style, Title, Help, Ctxt, MsgResponse, MyString
|
Dim Msg, Style, Title As String
|
||||||
reqPasswtxt.Validate()
|
reqPasswtxt.Validate()
|
||||||
reqPassw1txt.Validate()
|
reqPassw1txt.Validate()
|
||||||
If confirmPasswordReq.IsValid = True Then
|
If confirmPasswordReq.IsValid = True Then
|
||||||
@@ -63,16 +63,12 @@ Partial Class login_ChangePW
|
|||||||
|
|
||||||
Protected Sub txt_Pw_TextChanged(sender As Object, e As EventArgs)
|
Protected Sub txt_Pw_TextChanged(sender As Object, e As EventArgs)
|
||||||
regexval_txt_Pw.Validate()
|
regexval_txt_Pw.Validate()
|
||||||
|
|
||||||
If regexval_txt_Pw.IsValid Then
|
If regexval_txt_Pw.IsValid Then
|
||||||
txt_Pw_WH.ReadOnly = False
|
txt_Pw_WH.ReadOnly = False
|
||||||
regexval_txt_Pw_WH.Enabled = True
|
regexval_txt_Pw_WH.Enabled = True
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
txt_Pw_WH.ReadOnly = True
|
txt_Pw_WH.ReadOnly = True
|
||||||
regexval_txt_Pw_WH.Enabled = False
|
regexval_txt_Pw_WH.Enabled = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -109,11 +109,23 @@ Partial Class login_ForgotPW
|
|||||||
Return False
|
Return False
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Function genToken() As String
|
Function genToken(username As String, password As String, email As String) As String
|
||||||
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
|
||||||
Dim token As String = Convert.ToBase64String(time.Concat(Key).ToArray())
|
Dim token As String = Convert.ToBase64String(time.Concat(Key).ToArray())
|
||||||
Return token
|
Return token
|
||||||
|
Catch Ex As Exception
|
||||||
|
Dim Msg, Style, Title As String
|
||||||
|
Msg = "Tokengenerierung fehlgeschlagen!" & vbCrLf & "Eine E-Mail wurde erneut an " + email + " zugesedet."
|
||||||
|
Style = vbRetry + vbExclamation + vbDefaultButton1
|
||||||
|
Title = "Fehler bei Token-Generierung"
|
||||||
|
MsgBox(Msg, Style, Title)
|
||||||
|
|
||||||
|
If MsgBox(Msg, Style, Title).Retry Then
|
||||||
|
SendEmail(username, password, email)
|
||||||
|
End If
|
||||||
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Function getDateoftoken(tokenname As String) As Boolean
|
Function getDateoftoken(tokenname As String) As Boolean
|
||||||
|
|||||||
Reference in New Issue
Block a user