use new Encryption methods
This commit is contained in:
parent
3d30ab7309
commit
33cfb257b1
@ -74,7 +74,6 @@ Public Class frmMonitor
|
||||
Try
|
||||
LogConfig = New LogConfig(LogConfig.PathType.AppData, Nothing, Nothing, "Digital Data", "Monitor")
|
||||
ConfigManager = New ConfigManager(Of Config)(LogConfig, Application.UserAppDataPath, Application.UserAppDataPath, Application.StartupPath)
|
||||
ConfigManager.DecryptConnectionStrings()
|
||||
Init(LogConfig)
|
||||
|
||||
If ConfigManager.Config.ConnectionString = String.Empty Then
|
||||
@ -82,6 +81,7 @@ Public Class frmMonitor
|
||||
If oSQLConfig.ShowDialog() = DialogResult.OK Then
|
||||
ConfigManager.Config.ConnectionString = oSQLConfig.ConnectionString
|
||||
ConfigManager.Save()
|
||||
Application.Restart()
|
||||
Else
|
||||
ShowErrorMessage("No Database configured. Application will close!")
|
||||
Application.Exit()
|
||||
@ -89,7 +89,8 @@ Public Class frmMonitor
|
||||
End If
|
||||
End If
|
||||
|
||||
Database = New MSSQLServer(LogConfig, ConfigManager.Config.ConnectionString)
|
||||
Dim oConnectionString = MSSQLServer.DecryptConnectionString(ConfigManager.Config.ConnectionString)
|
||||
Database = New MSSQLServer(LogConfig, oConnectionString)
|
||||
GridBuilder = New GridBuilder(New List(Of GridView) From {GridView1, GridView2, GridView3, GridView4})
|
||||
GridBuilder.
|
||||
WithDefaults().
|
||||
@ -133,7 +134,7 @@ Public Class frmMonitor
|
||||
|
||||
Private Function LoadGDPicture() As String
|
||||
Dim oSQL = "SELECT LICENSE FROM TBDD_3RD_PARTY_MODULES WHERE NAME = 'GDPICTURE'"
|
||||
Return Database.GetScalarValue(oSQL).ToString()
|
||||
Return Database.GetScalarValue(oSQL)
|
||||
End Function
|
||||
|
||||
Private Sub buttonSearch_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles buttonSearch.ItemClick
|
||||
|
||||
@ -116,12 +116,8 @@ Public Class ClassInit
|
||||
End Sub
|
||||
|
||||
Private Sub CheckConnectivity(MyApplication As My.MyApplication)
|
||||
Dim oCrypt As New EncryptionLegacy()
|
||||
Dim oBuilder = My.SystemConfig.GetConnectionStringBuilder(My.SystemConfig.ConnectionString)
|
||||
oBuilder.Password = oCrypt.DecryptData(oBuilder.Password)
|
||||
Dim oDecryptedConnectionString = oBuilder.ToString
|
||||
|
||||
My.Database = New MSSQLServer(My.LogConfig, oDecryptedConnectionString)
|
||||
Dim oConnectionString = MSSQLServer.DecryptConnectionString(My.SystemConfig.ConnectionString)
|
||||
My.Database = New MSSQLServer(My.LogConfig, oConnectionString)
|
||||
|
||||
If My.Database.DBInitialized = False Then
|
||||
_Logger.Warn("Could not initialize DD_ECM-Database!")
|
||||
|
||||
@ -129,11 +129,8 @@ Public Class frmSQLConfig
|
||||
Dim oResult = MessageBox.Show(STRING_CONNECTION_SUCCESSFUL, Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
||||
|
||||
If oResult = DialogResult.Yes Then
|
||||
Dim oCrypt As New EncryptionLegacy()
|
||||
Dim oEncryptedPassword = oCrypt.EncryptData(txtPassword.Text)
|
||||
Dim oEncryptedConnectionString = $"Server={txtServerName.Text};Database={cmbDatabase.Text};User Id={txtUserName.Text};Password={oEncryptedPassword};"
|
||||
|
||||
ConnectionString = oEncryptedConnectionString
|
||||
Dim oPlainTextConnectionString = $"Server={txtServerName.Text};Database={cmbDatabase.Text};User Id={txtUserName.Text};Password={txtPassword.Text};"
|
||||
ConnectionString = MSSQLServer.EncryptConnectionString(oPlainTextConnectionString)
|
||||
Close()
|
||||
End If
|
||||
Catch ex As Exception
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user