Clean up UI, add Security NONE

This commit is contained in:
Jonathan Jenne
2023-08-16 16:11:57 +02:00
parent c8dbbd6381
commit 660921b50b
9 changed files with 887 additions and 730 deletions

View File

@@ -6,15 +6,15 @@ Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Messaging
Imports DigitalData.Modules.Config
Imports DigitalData.Modules.Messaging.Mail
Public Class frmMain
Private Logger As Logger
Private LogConfig As LogConfig
Private ConfigManager As Configmanager(Of Config)
Private ConfigManager As ConfigManager(Of Config)
Private _database As MSSQLServer
Private _Encryption As clsEncryption
Private _windream As clsWindream_allgemein
Private _emailIMAP As clsEmailIMAP
Private _LoadInProgress As Boolean = True
Private _RunwithLocalemail As Boolean = False
Private _SQLServerConString As String
@@ -41,9 +41,6 @@ Public Class frmMain
If ConfigManager.Config.UseWindream Then
_windream = New clsWindream_allgemein(LogConfig)
End If
'_email = New clsEmail(MyLogger)
_emailIMAP = New clsEmailIMAP(LogConfig)
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error in FormLoad")
End Try
@@ -53,7 +50,11 @@ Public Class frmMain
If Set_ConnectionStrings() Then
Load_AllData()
Check_Steps()
Active_Color()
Active_Color(ACTIVECheckBox)
Active_Color(ACTIVECheckBox1)
Active_Color(ACTIVECheckBox2)
Active_Color(ACTIVECheckBox3)
Active_Color(ACTIVECheckBox4)
End If
If ConfigManager.Config.UseWindream Then
ObjektTypenEintragen()
@@ -61,6 +62,13 @@ Public Class frmMain
_Encryption = New clsEncryption("!35452didalog=", LogConfig)
End Sub
Private Sub frmMain_Shown(sender As Object, e As EventArgs) Handles Me.Shown
If ConfigManager.Config.UseWindream Then
Load_Indexdata()
End If
End Sub
Private Function Set_ConnectionStrings()
Try
@@ -574,11 +582,7 @@ Public Class frmMain
End Select
End Sub
Private Sub frmMain_Shown(sender As Object, e As EventArgs) Handles Me.Shown
If ConfigManager.Config.UseWindream Then
Load_Indexdata()
End If
End Sub
Private Sub TabControl1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles TabControl1.SelectedIndexChanged
tslblRefresh.BackColor = Color.Transparent
@@ -588,15 +592,12 @@ Public Class frmMain
End If
End Sub
Private Sub ACTIVECheckBox_CheckedChanged(sender As Object, e As EventArgs) Handles ACTIVECheckBox.CheckedChanged
Active_Color()
End Sub
Sub Active_Color()
If ACTIVECheckBox.Checked Then
ACTIVECheckBox.BackColor = Color.LimeGreen
Sub Active_Color(pCheckBox As CheckBox)
If pCheckBox.Checked Then
pCheckBox.BackColor = Color.LimeGreen
Else
ACTIVECheckBox.BackColor = Color.IndianRed
pCheckBox.BackColor = Color.IndianRed
End If
End Sub
@@ -722,16 +723,35 @@ Public Class frmMain
If oDT.Rows.Count = 1 Then
Dim PWPlain = _Encryption.DecryptData(oDT.Rows(0).Item("EMAIL_PW"))
'Logger.Debug($"PWis !{PWPlain}35452dd=")
_limilab.InitIMAP(True, oDT.Rows(0).Item("EMAIL_SMTP"), oDT.Rows(0).Item("PORT_IN"), oDT.Rows(0).Item("EMAIL_USER"), PWPlain, oDT.Rows(0).Item("AUTH_TYPE"))
Dim oResult = _limilab.IMAPTestLogin()
If oResult = False Then
MsgBox("Access Imap NOT successfull", MsgBoxStyle.Critical)
Dim oFetcher As New MailFetcher(LogConfig)
Dim oSession = oFetcher.Connect(oDT.Rows(0).Item("EMAIL_SMTP"), oDT.Rows(0).Item("PORT_IN"), oDT.Rows(0).Item("EMAIL_USER"), PWPlain, oDT.Rows(0).Item("AUTH_TYPE"))
If oSession.Connected = True Then
' Unseen check will be done automatically
'btnCheckIMAPObjects.Visible = True
Dim oMailIds = oFetcher.ListUnseenMails()
If oMailIds Is Nothing Then
MsgBox("Could not get unseen Objects from IMAP-Folder!", MsgBoxStyle.Critical, Text)
Else
MsgBox($"IMAP-Folder contained [{oMailIds.Count}] unseen Objects!", MsgBoxStyle.Information, Text)
End If
oFetcher.Disconnect()
Else
MsgBox("IMAP-Test Successful!", MsgBoxStyle.Information)
btnCheckIMAPObjects.Visible = True
MsgBox($"Imap Login NOT successful: {vbNewLine}{oSession.Error?.Message}", MsgBoxStyle.Critical, Text)
End If
'_limilab.InitIMAP(True, oDT.Rows(0).Item("EMAIL_SMTP"), oDT.Rows(0).Item("PORT_IN"), oDT.Rows(0).Item("EMAIL_USER"), PWPlain, oDT.Rows(0).Item("AUTH_TYPE"))
'Dim oResult = _limilab.IMAPTestLogin()
'If oResult = False Then
' MsgBox("Access Imap NOT successfull", MsgBoxStyle.Critical)
'Else
' MsgBox("IMAP-Test Successful!", MsgBoxStyle.Information)
' btnCheckIMAPObjects.Visible = True
'End If
End If
End If
End Sub
@@ -859,7 +879,12 @@ Public Class frmMain
End Try
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs)
Private Sub btnAktualisieren_Click(sender As Object, e As EventArgs) Handles btnAktualisieren.Click
Me.TBDD_EMAIL_ACCOUNTTableAdapter.Fill(Me.MyDataset.TBDD_EMAIL_ACCOUNT)
End Sub
Private Sub ACTIVECheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles ACTIVECheckBox.CheckedChanged, ACTIVECheckBox1.CheckedChanged, ACTIVECheckBox2.CheckedChanged, ACTIVECheckBox3.CheckedChanged, ACTIVECheckBox4.CheckedChanged
Dim oCheckBox As CheckBox = sender
Active_Color(oCheckBox)
End Sub
End Class