EMailProfiler: Config-Daten in zentraler Klasse. abfrage der GDPicture Lizenz über Config-Modul
This commit is contained in:
@@ -1,23 +1,21 @@
|
||||
Imports EmailProfiler.Common.ClassCurrent
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Messaging.Mail
|
||||
Imports EmailProfiler.Common.ClassCurrent
|
||||
Imports Limilabs.Mail
|
||||
Imports Limilabs.Mail.Headers
|
||||
Imports System.Reflection.Emit
|
||||
Imports GdPicture14
|
||||
|
||||
Public Class clsWorker
|
||||
Private ReadOnly Logger As Logger
|
||||
Private ReadOnly Fetcher As MailFetcher
|
||||
Private ReadOnly Database As MSSQLServer
|
||||
Private ReadOnly UseWindream As Boolean = False
|
||||
Private ReadOnly _UseWindream As Boolean = False
|
||||
Private ReadOnly ClassWindreamAllgemein As clsWindream_allgemein
|
||||
Private ReadOnly ClassWindreamIndex As clsWindream_Index
|
||||
Private ReadOnly ClassWorkMail As clsWorkEmail
|
||||
Private ReadOnly Encryption As clsEncryption
|
||||
Private ReadOnly ProfileId As Integer = 0D
|
||||
Private ReadOnly _ProfileId As Integer = 0D
|
||||
Private ReadOnly EmailLimitationSender As String = ""
|
||||
Private ReadOnly EmailLimitationEnabled As Boolean = False
|
||||
|
||||
@@ -25,30 +23,28 @@ Public Class clsWorker
|
||||
|
||||
Private ReadOnly LocalEmlFile As String = ""
|
||||
|
||||
Sub New(pLogConfig As LogConfig, pConnectionString As String, pWindreamConnectionString As String, pPollProfileId As Integer, pUseWindream As Boolean,
|
||||
pEmailAccountID As Integer, pEmailPrefix As String, pEmailLimitationSender As String, pRejectionTemplateId As Integer, pInfoTemplateId As Integer, Optional pLocalEML As String = "")
|
||||
Sub New(pLogConfig As LogConfig, pConnectionString As String, pWindreamConnectionString As String, pPollProfileId As Integer, pConfigData As ConfigData, Optional pLocalEML As String = "")
|
||||
Logger = pLogConfig.GetLogger
|
||||
'ClassEmailImap = New clsEmailIMAP(pLogConfig)
|
||||
Fetcher = New MailFetcher(pLogConfig)
|
||||
Database = New MSSQLServer(pLogConfig, pConnectionString)
|
||||
|
||||
UseWindream = pUseWindream
|
||||
EmailLimitationSender = pEmailLimitationSender
|
||||
_UseWindream = pConfigData.UseWindream
|
||||
EmailLimitationSender = pConfigData.EmailSenderLimitation
|
||||
If EmailLimitationSender.Contains("@") Then
|
||||
Logger.Info("Email Sender Limitation active for address: [{0}]", EmailLimitationSender)
|
||||
EmailLimitationEnabled = True
|
||||
End If
|
||||
|
||||
If UseWindream Then
|
||||
If _UseWindream Then
|
||||
ClassWindreamAllgemein = New clsWindream_allgemein(pLogConfig)
|
||||
ClassWindreamIndex = New clsWindream_Index(pLogConfig)
|
||||
End If
|
||||
|
||||
ClassWorkMail = New clsWorkEmail(pLogConfig, pConnectionString, pWindreamConnectionString, pUseWindream, pEmailAccountID, pEmailPrefix, pRejectionTemplateId, pInfoTemplateId)
|
||||
|
||||
ClassWorkMail = New clsWorkEmail(pLogConfig, pConnectionString, pWindreamConnectionString, pConfigData)
|
||||
|
||||
Encryption = New clsEncryption("!35452didalog=", pLogConfig)
|
||||
ProfileId = pPollProfileId
|
||||
_ProfileId = pPollProfileId
|
||||
LocalEmlFile = pLocalEML
|
||||
End Sub
|
||||
|
||||
@@ -68,7 +64,6 @@ Public Class clsWorker
|
||||
TEMP_FILES.Clear()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Function LoadEmailAccounts() As DataTable
|
||||
Return Database.GetDatatable("SELECT * FROM TBDD_EMAIL_ACCOUNT WHERE ACTIVE = 1")
|
||||
End Function
|
||||
@@ -76,7 +71,7 @@ Public Class clsWorker
|
||||
Private Function LoadPollingProfiles(pProfileId As Integer) As DataTable
|
||||
Dim oSQL = "SELECT * FROM TBEMLP_POLL_PROFILES WHERE ACTIVE = 1"
|
||||
|
||||
If ProfileId = 0 Then
|
||||
If _ProfileId = 0 Then
|
||||
oSQL &= " ORDER BY SEQUENCE"
|
||||
Else
|
||||
oSQL &= $" AND GUID = {pProfileId}"
|
||||
@@ -95,7 +90,7 @@ Public Class clsWorker
|
||||
End If
|
||||
|
||||
Logger.Debug("now windream_init... ")
|
||||
If UseWindream Then
|
||||
If _UseWindream Then
|
||||
If ClassWindreamAllgemein.Init = False Then
|
||||
Logger.Info("windream could not be initialized!!")
|
||||
Exit Sub
|
||||
@@ -105,14 +100,14 @@ Public Class clsWorker
|
||||
End If
|
||||
|
||||
Dim EmailAccountTable As DataTable = LoadEmailAccounts()
|
||||
Dim PollingProfileTable = LoadPollingProfiles(ProfileId)
|
||||
Dim PollingProfileTable = LoadPollingProfiles(_ProfileId)
|
||||
|
||||
Dim oSQLGDPicture = "SELECT LICENSE FROM TBDD_3RD_PARTY_MODULES WHERE ACTIVE = 1"
|
||||
If CallFromService = True Then
|
||||
oSQLGDPicture = "SELECT LICENSE FROM TBDD_3RD_PARTY_MODULES WHERE NAME = 'GDPICTURE EMAIL_PROFILER'"
|
||||
End If
|
||||
'Dim oSQLGDPicture = "SELECT LICENSE FROM TBDD_3RD_PARTY_MODULES WHERE ACTIVE = 1"
|
||||
'If CallFromService = True Then
|
||||
' oSQLGDPicture = "SELECT LICENSE FROM TBDD_3RD_PARTY_MODULES WHERE NAME = 'GDPICTURE EMAIL_PROFILER'"
|
||||
'End If
|
||||
|
||||
GDPictureLicense = Database.GetScalarValue(oSQLGDPicture)
|
||||
'GDPictureLicense = Database.GetScalarValue(oSQLGDPicture)
|
||||
|
||||
If IsNothing(PollingProfileTable) Then
|
||||
Logger.Warn("Error while fetching Polling Profiles. Exiting.")
|
||||
|
||||
Reference in New Issue
Block a user