EnvelopeGenerator/EnvelopeGenerator.Form/frm2Factor_Properties.vb
2025-05-08 17:01:12 +02:00

43 lines
1.6 KiB
VB.net

Imports DigitalData.Modules.Database
Imports EnvelopeGenerator.Common.My
Public Class frm2Factor_Properties
Private Sub SimpleButton1_Click(sender As Object, e As EventArgs) Handles SimpleButton1.Click
If MsgBox(Resources.Model.ResetTOTPUser, MsgBoxStyle.Question Or MsgBoxStyle.YesNo, Text) = MsgBoxResult.Yes Then
Dim oupdSQL = $"UPDATE TBSIG_RECEIVER SET TOTP_SECRET_KEY = NULL, TFA_REG_DEADLINE = NULL WHERE EMAIL_ADDRESS = '{txtMail.Text}'"
If DD_ECM.ExecuteNonQuery(oupdSQL) = True Then
MsgBox(Resources.Model.Success_FormClose, MsgBoxStyle.Information)
Me.Close()
Else
MsgBox("Something went wrong. Check the log", MsgBoxStyle.Exclamation)
End If
End If
End Sub
Dim TOTP As String
Dim mail As String
Dim Deadline As DateTime
Dim DD_ECM As MSSQLServer
Public Sub New(pmail As String, pTOTP As String, pDeadline As DateTime, pDD_ECM As MSSQLServer)
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
mail = pmail
TOTP = pTOTP
Deadline = pDeadline
DD_ECM = pDD_ECM
End Sub
Private Sub frm2Faktor_Load(sender As Object, e As EventArgs) Handles Me.Load
chkTOTP.Checked = False
If Not IsNothing(TOTP) Then
If TOTP.Length > 1 Then
chkTOTP.Checked = True
End If
End If
txtMail.Text = mail
txtValid.Text = Deadline.ToString
End Sub
End Class