This commit is contained in:
SchreiberM
2016-08-17 16:02:55 +02:00
parent fc9940031f
commit fd0e907262
4 changed files with 23 additions and 16 deletions

View File

@@ -142,19 +142,25 @@ Public Class frmConfiguration_Basic
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
Try
DD_Rights.ClassLogger.Init(Application.UserAppDataPath() & "\Log", Environment.UserName)
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
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
Catch ex As Exception
MsgBox("Error in Check windream login: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Private Sub txtDomäne_TextChanged(sender As Object, e As EventArgs) Handles txtDomäne.TextChanged