MS_1708
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
Public Class frmConfiguration_Basic
|
||||
Imports DD_Rights
|
||||
Public Class frmConfiguration_Basic
|
||||
Dim loaded As Boolean = False
|
||||
Dim changes_ModuleKonfig As Boolean = False
|
||||
Dim changes_Konfig As Boolean = False
|
||||
@@ -26,6 +27,19 @@
|
||||
If Not dt Is Nothing Then
|
||||
If dt.Rows.Count = 1 Then
|
||||
Me.chkUnicode.Checked = dt.Rows(0).Item("WD_UNICODE")
|
||||
Me.txtDomäne.Text = dt.Rows(0).Item("AD_DOMAIN")
|
||||
Me.txtUser.Text = dt.Rows(0).Item("AD_USER")
|
||||
Dim PWplainText As String
|
||||
Dim wrapper As New ClassEncryption("!35452didalog=")
|
||||
' DecryptData throws if the wrong password is used.
|
||||
Try
|
||||
PWplainText = wrapper.DecryptData(dt.Rows(0).Item("AD_USER_PW"))
|
||||
Me.txtPW.Text = PWplainText
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("- the Password '" & dt.Rows(0).Item("AD_USER_PW") & "' could not be decrypted", False)
|
||||
Me.txtPW.Text = ""
|
||||
End Try
|
||||
Me.txtServername.Text = dt.Rows(0).Item("AD_SERVER")
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
@@ -40,7 +54,7 @@
|
||||
btnsave.Enabled = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub chkUnicode_CheckedChanged(sender As Object, e As EventArgs) Handles chkUnicode.CheckedChanged
|
||||
If loaded = True Then
|
||||
changes_Konfig = True
|
||||
@@ -88,8 +102,9 @@
|
||||
If chkUnicode.Checked Then
|
||||
wduni = 1
|
||||
End If
|
||||
Dim sql As String = "UPDATE TBPMO_KONFIGURATION SET WD_UNICODE = " & wduni & ",CHANGED_WHO = '" & Environment.UserName & "' where GUID = 1"
|
||||
If ClassDatabase.Execute_non_Query(sql, True) = True Then
|
||||
Dim upd = String.Format("UPDATE TBPMO_KONFIGURATION SET AD_DOMAIN = '{0}', AD_USER = '{1}', AD_USER_PW = '{2}', AD_SERVER = '{3}', CHANGED_WHO = '{4}',WD_UNICODE = {5} WHERE GUID = 1", Me.txtDomäne.Text, Me.txtUser.Text, Me.txtPW.Text, Me.txtServername.Text, Environment.UserName, wduni)
|
||||
|
||||
If ClassDatabase.Execute_non_Query(upd, True) = True Then
|
||||
lblSaveresult.Visible = True
|
||||
Else
|
||||
lblSaveresult.Visible = False
|
||||
@@ -125,4 +140,48 @@
|
||||
pbBackground.ImageLocation = Nothing
|
||||
pbBackground.Image = Nothing
|
||||
End Sub
|
||||
|
||||
Private Sub btnTest_Anmeldung_Click(sender As Object, e As EventArgs) Handles btnTest_Anmeldung.Click
|
||||
Dim session = DD_Rights.ClassRights.GetWMSessionAsUser(Me.txtDomäne.Text, Me.txtServername.Text, Me.txtUser.Text, Me.txtPW.Text)
|
||||
If Not IsNothing(session) Then
|
||||
MsgBox("The persionalized connection to windream was created successfully!", MsgBoxStyle.Information)
|
||||
Dim wrapper As New ClassEncryption("!35452didalog=")
|
||||
Dim cipherText As String = wrapper.EncryptData(Me.txtPW.Text)
|
||||
Dim pw As String = cipherText
|
||||
|
||||
Dim upd = String.Format("UPDATE TBPMO_KONFIGURATION SET AD_DOMAIN = '{0}', AD_USER = '{1}', AD_USER_PW = '{2}', AD_SERVER = '{3}', CHANGED_WHO = '{4}' WHERE GUID = 1", Me.txtDomäne.Text, Me.txtUser.Text, pw, Me.txtServername.Text, Environment.UserName)
|
||||
ClassDatabase.Execute_non_Query(upd)
|
||||
btnsave.Enabled = False
|
||||
Else
|
||||
MsgBox("The persionalized connection to windream could NOT be created." & vbNewLine & "Please check the User-Data!", MsgBoxStyle.Critical)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub txtDomäne_TextChanged(sender As Object, e As EventArgs) Handles txtDomäne.TextChanged
|
||||
If loaded = True Then
|
||||
changes_Konfig = True
|
||||
btnsave.Enabled = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub txtUser_TextChanged(sender As Object, e As EventArgs) Handles txtUser.TextChanged
|
||||
If loaded = True Then
|
||||
changes_Konfig = True
|
||||
btnsave.Enabled = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub txtPW_TextChanged(sender As Object, e As EventArgs) Handles txtPW.TextChanged
|
||||
If loaded = True Then
|
||||
changes_Konfig = True
|
||||
btnsave.Enabled = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub txtServername_TextChanged(sender As Object, e As EventArgs) Handles txtServername.TextChanged
|
||||
If loaded = True Then
|
||||
changes_Konfig = True
|
||||
btnsave.Enabled = True
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user