MS Override
This commit is contained in:
@@ -124,33 +124,33 @@ Public Class ClassInit
|
||||
oCommonAppDataPath = oStartupPath
|
||||
End If
|
||||
|
||||
ConfigManager = New ConfigManager(Of ClassConfig)(LogConfig, oUserAppDataPath, oCommonAppDataPath, oStartupPath)
|
||||
CONFIG = New ConfigManager(Of ClassConfig)(LogConfig, oUserAppDataPath, oCommonAppDataPath, oStartupPath)
|
||||
|
||||
With ConfigManager.Config
|
||||
With CONFIG.Config
|
||||
MyConnectionString = DecryptConnectionString(.ConnectionString)
|
||||
LogErrorsOnly = .LogErrorsOnly
|
||||
HotkeySearchKey = .HotkeySearchKey
|
||||
LogConfig.Debug = Not .LogErrorsOnly
|
||||
End With
|
||||
If HotkeySearchKey_via_Server = False Then
|
||||
HotkeyFunctionKey = ConfigManager.Config.HotkeyFunctionKey
|
||||
HotkeyFunctionKey = CONFIG.Config.HotkeyFunctionKey
|
||||
End If
|
||||
If ConfigManager.Config.ConnectionStringAppServer <> String.Empty Then
|
||||
MyConStringAppserv = DecryptConnectionString(ConfigManager.Config.ConnectionStringAppServer)
|
||||
If CONFIG.Config.ConnectionStringAppServer <> String.Empty Then
|
||||
MyConStringAppserv = DecryptConnectionString(CONFIG.Config.ConnectionStringAppServer)
|
||||
If InitAppDatabase() Then
|
||||
Logger.Debug("ConnectionStringAppServer will be used")
|
||||
End If
|
||||
End If
|
||||
|
||||
If ConfigManager.Config.AppServerConfig <> String.Empty Then
|
||||
If CONFIG.Config.AppServerConfig <> String.Empty Then
|
||||
Try
|
||||
Dim oDynSplitCharacter As String
|
||||
If ConfigManager.Config.AppServerConfig.Contains(":") Then
|
||||
If CONFIG.Config.AppServerConfig.Contains(":") Then
|
||||
oDynSplitCharacter = ":"
|
||||
ElseIf ConfigManager.Config.AppServerConfig.Contains(";") Then
|
||||
ElseIf CONFIG.Config.AppServerConfig.Contains(";") Then
|
||||
oDynSplitCharacter = ";"
|
||||
End If
|
||||
Dim oSplit() As String = ConfigManager.Config.AppServerConfig.ToString.Split(oDynSplitCharacter)
|
||||
Dim oSplit() As String = CONFIG.Config.AppServerConfig.ToString.Split(oDynSplitCharacter)
|
||||
Dim oAppServerAddress As String = oSplit(0)
|
||||
Dim oAppServerPort As Integer = 9000
|
||||
If oSplit.Length = 2 Then
|
||||
@@ -161,7 +161,7 @@ Public Class ClassInit
|
||||
If _Client.Connect() Then
|
||||
APPSERVER_ACTIVE = True
|
||||
Else
|
||||
Logger.Warn($"###!!!APPServer [{ConfigManager.Config.AppServerConfig.ToString}] could not be initialized ")
|
||||
Logger.Warn($"###!!!APPServer [{CONFIG.Config.AppServerConfig.ToString}] could not be initialized ")
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
@@ -199,12 +199,6 @@ Public Class ClassInit
|
||||
Dim DT_CHECKUSER_MODULE As DataTable
|
||||
DT_CHECKUSER_MODULE = _DataASorDB.GetDatatable(oSql, "TBDD_USER_MODULE", $"USERNAME = '{USER_USERNAME.ToLower}' AND MODULE_SHORT = 'CW'", "", "")
|
||||
|
||||
'If APPSERVER_ACTIVE = True Then
|
||||
' Dim oTableResult As TableResult = _Client.GetDatatableByName("TBDD_USER_MODULE", $"USERNAME = '{USER_USERNAME.ToLower}' AND MODULE_SHORT = 'CW'")
|
||||
' DT_CHECKUSER_MODULE = oTableResult.Table
|
||||
'Else
|
||||
' DT_CHECKUSER_MODULE = Database.GetDatatable(oSql)
|
||||
'End If
|
||||
If DT_CHECKUSER_MODULE.Rows.Count = 0 Then
|
||||
Logger.Info("DT_CHECKUSER_MODULE.Rows.Count = 0", True)
|
||||
'ERROR_STATE = "NO USER"
|
||||
@@ -220,7 +214,14 @@ Public Class ClassInit
|
||||
USER_PRENAME = NotNull(DT_CHECKUSER_MODULE.Rows(0).Item("USER_PRENAME"), "")
|
||||
USER_SHORTNAME = NotNull(DT_CHECKUSER_MODULE.Rows(0).Item("USER_SHORTNAME"), "")
|
||||
USER_EMAIL = NotNull(DT_CHECKUSER_MODULE.Rows(0).Item("USER_EMAIL"), "")
|
||||
USER_LANGUAGE = NotNull(DT_CHECKUSER_MODULE.Rows(0).Item("USER_LANGUAGE"), "de-DE")
|
||||
|
||||
If My.Settings.SYS_Override_Language <> String.Empty Then
|
||||
USER_LANGUAGE = My.Settings.SYS_Override_Language
|
||||
Logger.Info("Override Language [{0}] from Config will be used!", USER_LANGUAGE)
|
||||
Else
|
||||
USER_LANGUAGE = NotNull(DT_CHECKUSER_MODULE.Rows(0).Item("USER_LANGUAGE"), "de-DE")
|
||||
End If
|
||||
|
||||
USER_DATE_FORMAT = NotNull(DT_CHECKUSER_MODULE.Rows(0).Item("USER_DATE_FORMAT"), "dd.MM.yyyy")
|
||||
USER_IN_MODULE = NotNull(DT_CHECKUSER_MODULE.Rows(0).Item("MODULE_ACCESS"), False)
|
||||
USER_IS_ADMIN = NotNull(DT_CHECKUSER_MODULE.Rows(0).Item("IS_ADMIN"), False)
|
||||
@@ -361,7 +362,8 @@ Public Class ClassInit
|
||||
oSQL = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & USER_ID & " AND MODULE = 'Clipboard-Watcher'"
|
||||
Database.ExecuteNonQuery(oSQL)
|
||||
|
||||
oSQL = String.Format("INSERT INTO TBDD_USER_MODULE_LOG_IN (USER_ID,CLIENT_ID,MODULE,VERSION_CLIENT,MACHINE_NAME) VALUES ({0},{1},'Clipboard-Watcher','{2}','{3}')", USER_ID, 0, My.Application.Info.Version.ToString, Environment.MachineName)
|
||||
oSQL = String.Format("INSERT INTO TBDD_USER_MODULE_LOG_IN (USER_ID,CLIENT_ID,MODULE,VERSION_CLIENT,MACHINE_NAME,LANGUAGE_OVERRIDE) VALUES
|
||||
({0},{1},'Clipboard-Watcher','{2}','{3}','{4}')", USER_ID, 0, My.Application.Info.Version.ToString, Environment.MachineName, My.Settings.SYS_Override_Language)
|
||||
Database.ExecuteNonQuery(oSQL)
|
||||
|
||||
If USER_IS_ADMIN = True Then
|
||||
|
||||
Reference in New Issue
Block a user