diff --git a/app/DD_Clipboard_Searcher/ClassInit.vb b/app/DD_Clipboard_Searcher/ClassInit.vb
index 7199b8b..5eee8a9 100644
--- a/app/DD_Clipboard_Searcher/ClassInit.vb
+++ b/app/DD_Clipboard_Searcher/ClassInit.vb
@@ -56,107 +56,117 @@ Public Class ClassInit
Else
USER_USERNAME = _User
End If
- Dim sql = String.Format("SELECT * FROM TBDD_USER WHERE (LOWER(USERNAME) = LOWER('{0}'))", USER_USERNAME)
- clsLogger.Add(">> Login Username: " & USER_USERNAME, False)
- clsLogger.Add(">> Login time: " & Now.ToString, False)
- Dim USER_DT As DataTable = clsDatabase.Return_Datatable(sql, True)
- If USER_DT.Rows.Count = 0 Then
+ Try
+ DT_CLIENT_USER = clsDatabase.Return_Datatable(String.Format("SELECT * FROM VWDD_USER_CLIENT WHERE UPPER(USERNAME) = UPPER('{0}')", Environment.UserName), False)
+ If DT_CLIENT_USER.Rows.Count > 1 Then
+ frmClientLogin.ShowDialog()
+ ElseIf DT_CLIENT_USER.Rows.Count = 1 Then
+ CLIENT_SELECTED = DT_CLIENT_USER.Rows(0).Item("CLIENT_ID")
+ Else
+ clsLogger.Add("User '" & USER_USERNAME & "' not related to a client", True)
+ ERROR_INIT = "NO CLIENT"
+ 'ERROR_STATE = "NO CLIENT"
+ Return False
+ End If
+ Catch ex As Exception
+ clsLogger.Add("Unexpected error in checking CLIENT: " & ex.Message)
+ CLIENT_SELECTED = 1
+ End Try
+
+ 'ClassLogger.Add(">> Username: " & USER_USERNAME, False)
+ Dim sql = String.Format("SELECT * FROM [dbo].[FNDD_CHECK_USER_MODULE] ('{0}','CW',{1})", USER_USERNAME, CLIENT_SELECTED)
+ Dim DT_CHECKUSER_MODULE As DataTable = clsDatabase.Return_Datatable(sql)
+ If DT_CHECKUSER_MODULE.Rows.Count = 0 Then
+ clsLogger.Add("DT_CHECKUSER_MODULE.Rows.Count = 0", True)
+ 'ERROR_STATE = "NO USER"
+ MsgBox("Sorry - Something went wrong in getting Your rights." & vbNewLine & "Please contact the system administrator!", MsgBoxStyle.Exclamation)
+ Return False
+ End If
+ If DT_CHECKUSER_MODULE.Rows.Count = 1 Then
+ clsLogger.Add(">> Login Username: " & USER_USERNAME, False)
+ clsLogger.Add(">> Login time: " & Now.ToString, False)
+ USER_ID = DT_CHECKUSER_MODULE.Rows(0).Item("USER_ID")
+ USER_SURNAME = IIf(IsDBNull(DT_CHECKUSER_MODULE.Rows(0).Item("USER_SURNAME")), "", DT_CHECKUSER_MODULE.Rows(0).Item("USER_SURNAME"))
+ USER_PRENAME = IIf(IsDBNull(DT_CHECKUSER_MODULE.Rows(0).Item("USER_PRENAME")), "", DT_CHECKUSER_MODULE.Rows(0).Item("USER_PRENAME"))
+ USER_SHORTNAME = IIf(IsDBNull(DT_CHECKUSER_MODULE.Rows(0).Item("USER_SHORTNAME")), "", DT_CHECKUSER_MODULE.Rows(0).Item("USER_SHORTNAME"))
+ USER_EMAIL = IIf(IsDBNull(DT_CHECKUSER_MODULE.Rows(0).Item("USER_EMAIL")), "", DT_CHECKUSER_MODULE.Rows(0).Item("USER_EMAIL"))
+ USER_LANGUAGE = DT_CHECKUSER_MODULE.Rows(0).Item("USER_LANGUAGE")
+
+ USER_IN_MODULE = DT_CHECKUSER_MODULE.Rows(0).Item("MODULE_ACCESS")
+ USER_IS_ADMIN = DT_CHECKUSER_MODULE.Rows(0).Item("IS_ADMIN")
+
+
+ USERCOUNT_LOGGED_IN = DT_CHECKUSER_MODULE.Rows(0).Item("USERCOUNT_LOGGED_IN")
+
+
+ Else
clsLogger.Add(" - User '" & USER_USERNAME & "' not listed in Useradministration!", False)
'MsgBox("Achtung: Sie sind nicht in der Userverwaltung hinterlegt." & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!", MsgBoxStyle.Critical, "Achtung:")
'Me.Close()
Dim msg = String.Format("You are not listed in the Useradministration." & vbNewLine & "Please contact the admin.")
MsgBox(msg, MsgBoxStyle.Exclamation)
Return False
- Else
- USER_GUID = USER_DT.Rows(0).Item("GUID")
- USER_LANGUAGE = USER_DT.Rows(0).Item("LANGUAGE")
- DT_CLIENT_USER = clsDatabase.Return_Datatable("SELECT T.*, T1.CLIENT_NAME FROM TBDD_CLIENT_USER T,TBDD_CLIENT T1 WHERE T.CLIENT_ID = T1.GUID AND T.USER_ID = " & USER_GUID, True)
+ End If
- Dim Access_right As Boolean = False
- sql = String.Format("SELECT * FROM TBDD_USER_MODULES T, TBDD_MODULES T1 WHERE T.MODULE_ID = T1.GUID AND UPPER(T1.SHORT_NAME) = UPPER('CW') AND T.USER_ID = {0}", USER_GUID)
- Dim DT_USER2MODULE As DataTable = clsDatabase.Return_Datatable(sql)
- If Not IsNothing(DT_USER2MODULE) Then
- If DT_USER2MODULE.Rows.Count = 1 Then
- Access_right = True
- USER_IS_ADMIN = DT_USER2MODULE.Rows(0).Item("IS_ADMIN")
- End If
- End If
-
- If Access_right = False Then
- clsLogger.Add(" - User: " & USER_USERNAME & " nicht für Modul freigegben!", False)
- 'MsgBox("Achtung: Sie sind nicht für die Nutzung dieses Moduls freigeschaltet." & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!", MsgBoxStyle.Critical, "Achtung:")
- Dim msg = String.Format("Sie sind nicht für die Nutzung dieses Moduls freigeschaltet." & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!")
+ If USER_IN_MODULE = False Then
+ If USER_IS_ADMIN = False Then
+ clsLogger.Add(" - User: " & USER_USERNAME & " not related to module!", False)
+ Dim msg = String.Format("Sie sind nicht für die Nutzung dieses Moduls freigeschaltet." & vbNewLine & "Bitte setzen Sie sich mit dem Systemadministrator in Verbindung!")
If USER_LANGUAGE <> "de-DE" Then
msg = String.Format("You are not authorized for using this module." & vbNewLine & "Please contact the admin.")
End If
MsgBox(msg, MsgBoxStyle.Exclamation, "Attention:")
Return False
- Else
- If DT_CLIENT_USER.Rows.Count = 0 Then
- Dim msg = String.Format("Keine Client-Modul Verknüpfung für Ihren User definiert." & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!")
- If USER_LANGUAGE <> "de-DE" Then
- msg = String.Format("Noc client-module link for Your user." & vbNewLine & "Please contact the admin.")
- End If
- MsgBox(msg, MsgBoxStyle.Exclamation, "Attention:")
- Return False
- End If
- 'Am System anmelden
- clsLicense.Refresh_Licence(DT_CLIENT_USER.Rows(0).Item("CLIENT_ID"))
- 'Am System anmelden
- ' sql = String.Format("UPDATE TBDD_USER SET LOGGED_IN = 1, LOGGED_WHERE = '{0}' WHERE GUID = {1}", Environment.MachineName, USER_GUID)
- 'clsDatabase.Execute_non_Query(sql)
- sql = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & USER_GUID & " AND MODULE = 'Clipboard-Watcher'"
- If clsDatabase.Execute_non_Query(sql, True) = True Then
-
- End If
-
- sql = 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_GUID, 0, My.Application.Info.Version.ToString, Environment.MachineName)
- clsDatabase.Execute_non_Query(sql)
-
- If USER_IS_ADMIN = True Then
- If ESC_Hidden = True Then
- 'frmLoginUserSelect.ShowDialog()
- ESC_Hidden = False
- If USER_USERNAME <> "" Then
- InitUserLogin(USER_USERNAME)
- End If
-
- End If
- ' 'Admin
- ' pageAdmin.Visible = True
- End If
-
- WD_UNICODE = clsDatabase.Execute_Scalar("SELECT WD_UNICODE FROM TBCW_CONFIGURATION WHERE GUID = 1")
-
-
- sql = String.Format("SELECT COUNT(*) AS Expr1 FROM TBDD_USER_MODULE_LOG_IN WHERE UPPER(MODULE) = UPPER('Clipboard-Watcher') AND CLIENT_ID = {0}", 0)
- Dim anzahl = clsDatabase.Execute_Scalar(sql)
- USERS_LOGGED_IN = CInt(anzahl)
- If LogErrorsOnly = False Then clsLogger.Add(" >> Count Users logged in: " & anzahl.ToString, False)
- '####
-
- If LICENSE_COUNT < USERS_LOGGED_IN And LICENSE_EXPIRED = False Then
- Dim msg = String.Format("Die Anzahl der aktuell angemeldeten User (" & USERS_LOGGED_IN.ToString & ") überschreitet die Anzahl der aktuellen Lizenzen!" & vbNewLine & "Anzahl der Lizenzen: " & LICENSE_COUNT.ToString & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!")
-
- If USER_LANGUAGE <> "de-DE" Then
- msg = String.Format("The number of logged Users (" & USERS_LOGGED_IN.ToString & ") exceeds the number of licenses." & vbNewLine & _
- "Number of licenses: " & LICENSE_COUNT.ToString & vbNewLine & "Please contact Your admin!")
- End If
- MsgBox(msg, MsgBoxStyle.Exclamation)
- clsLogger.Add(" >> The number of logged Users (" & USERS_LOGGED_IN.ToString & ") exceeds the number of licenses (" & LICENSE_COUNT & ") ", False)
- If USER_IS_ADMIN = False Then
- 'Anmeldung wieder herausnehmen
- sql = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & USER_GUID & " AND MODULE= 'Clipboard-Watcher'"
- clsDatabase.Execute_non_Query(sql, True)
- clsLogger.Add(" - logged out the user", False)
- Return False
- End If
- End If
- Return True
- 'LabelLoggedIn.Caption = "Anzahl Angemeldete User: " & anzahl.ToString
End If
End If
+ 'Am System anmelden
+ clsLicense.Refresh_Licence(DT_CLIENT_USER.Rows(0).Item("CLIENT_ID"))
+ 'Am System anmelden
+ ' sql = String.Format("UPDATE TBDD_USER SET LOGGED_IN = 1, LOGGED_WHERE = '{0}' WHERE GUID = {1}", Environment.MachineName, USER_ID)
+ 'clsDatabase.Execute_non_Query(sql)
+ sql = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & USER_ID & " AND MODULE = 'Clipboard-Watcher'"
+ clsDatabase.Execute_non_Query(sql, True)
+
+ sql = 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)
+ clsDatabase.Execute_non_Query(sql)
+
+ If USER_IS_ADMIN = True Then
+ If ESC_Hidden = True Then
+ 'frmLoginUserSelect.ShowDialog()
+ ESC_Hidden = False
+ If USER_USERNAME <> "" Then
+ InitUserLogin(USER_USERNAME)
+ End If
+
+ End If
+ ' 'Admin
+ ' pageAdmin.Visible = True
+ End If
+
+ WD_UNICODE = clsDatabase.Execute_Scalar("SELECT WD_UNICODE FROM TBCW_CONFIGURATION WHERE GUID = 1")
+
+ If LogErrorsOnly = False Then clsLogger.Add(" >> Count Users logged in: " & USERCOUNT_LOGGED_IN.ToString, False)
+ If LICENSE_COUNT < USERCOUNT_LOGGED_IN And LICENSE_EXPIRED = False Then
+ Dim msg = String.Format("Die Anzahl der aktuell angemeldeten User (" & USERCOUNT_LOGGED_IN.ToString & ") überschreitet die Anzahl der aktuellen Lizenzen!" & vbNewLine & "Anzahl der Lizenzen: " & LICENSE_COUNT.ToString & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!")
+
+ If USER_LANGUAGE <> "de-DE" Then
+ msg = String.Format("The number of logged Users (" & USERCOUNT_LOGGED_IN.ToString & ") exceeds the number of licenses." & vbNewLine &
+ "Number of licenses: " & LICENSE_COUNT.ToString & vbNewLine & "Please contact Your admin!")
+ End If
+ MsgBox(msg, MsgBoxStyle.Exclamation)
+ clsLogger.Add(" >> The number of logged Users (" & USERCOUNT_LOGGED_IN.ToString & ") exceeds the number of licenses (" & LICENSE_COUNT & ") ", False)
+ If USER_IS_ADMIN = False Then
+ 'Anmeldung wieder herausnehmen
+ sql = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & USER_ID & " AND MODULE= 'Clipboard-Watcher'"
+ clsDatabase.Execute_non_Query(sql, True)
+ clsLogger.Add(" - logged out the user", False)
+ Return False
+ End If
+ End If
+ Return True
+
+
Catch ex As Exception
clsLogger.Add("Unexpected Error in InitUserLogin: " & ex.Message, True)
MsgBox("Unexpected Error in InitUserLogin: " & ex.Message, MsgBoxStyle.Critical)
diff --git a/app/DD_Clipboard_Searcher/DD_Clipboard_Watcher.vbproj b/app/DD_Clipboard_Searcher/DD_Clipboard_Watcher.vbproj
index 6f332fb..093c28b 100644
--- a/app/DD_Clipboard_Searcher/DD_Clipboard_Watcher.vbproj
+++ b/app/DD_Clipboard_Searcher/DD_Clipboard_Watcher.vbproj
@@ -127,6 +127,12 @@
Form
+
+ frmClientLogin.vb
+
+
+ Form
+
frmLicense.vb
@@ -180,6 +186,12 @@
frmAdministration.vb
Designer
+
+ frmClientLogin.vb
+
+
+ frmClientLogin.vb
+
frmLicense.vb
diff --git a/app/DD_Clipboard_Searcher/clsHotkey.vb b/app/DD_Clipboard_Searcher/clsHotkey.vb
index e9ba35a..0362927 100644
--- a/app/DD_Clipboard_Searcher/clsHotkey.vb
+++ b/app/DD_Clipboard_Searcher/clsHotkey.vb
@@ -73,7 +73,7 @@ Public Class clsHotkey
End Class
Public Shared Sub Refresh_Profile_Links()
Try
- Dim sql = String.Format("SELECT T.*, T2.PROC_NAME FROM TBCW_PROFILES T, TBCW_USER_PROFILE T1, TBCW_PROFILE_PROCESS T2 WHERE T.GUID = T1.PROFILE_ID AND T.GUID = T2.PROFILE_ID AND T1.USER_ID = {0}", USER_GUID)
+ Dim sql = String.Format("SELECT T.*, T2.PROC_NAME FROM TBCW_PROFILES T, TBCW_USER_PROFILE T1, TBCW_PROFILE_PROCESS T2 WHERE T.GUID = T1.PROFILE_ID AND T.GUID = T2.PROFILE_ID AND T1.USER_ID = {0}", USER_ID)
DT_USER_PROFILES = clsDatabase.Return_Datatable(sql)
If DT_USER_PROFILES.Rows.Count = 0 Then
MsgBox("No profiles configured for this user so far!", MsgBoxStyle.Exclamation)
diff --git a/app/DD_Clipboard_Searcher/frmClientLogin.designer.vb b/app/DD_Clipboard_Searcher/frmClientLogin.designer.vb
new file mode 100644
index 0000000..8a24963
--- /dev/null
+++ b/app/DD_Clipboard_Searcher/frmClientLogin.designer.vb
@@ -0,0 +1,77 @@
+ _
+Partial Class frmClientLogin
+ Inherits System.Windows.Forms.Form
+
+ 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
+ _
+ Protected Overrides Sub Dispose(ByVal disposing As Boolean)
+ Try
+ If disposing AndAlso components IsNot Nothing Then
+ components.Dispose()
+ End If
+ Finally
+ MyBase.Dispose(disposing)
+ End Try
+ End Sub
+
+ 'Wird vom Windows Form-Designer benötigt.
+ Private components As System.ComponentModel.IContainer
+
+ 'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
+ 'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
+ 'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
+ _
+ Private Sub InitializeComponent()
+ Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmClientLogin))
+ Me.Label1 = New System.Windows.Forms.Label()
+ Me.cmbClients = New System.Windows.Forms.ComboBox()
+ Me.Label2 = New System.Windows.Forms.Label()
+ Me.btnLogin = New System.Windows.Forms.Button()
+ Me.SuspendLayout()
+ '
+ 'Label1
+ '
+ resources.ApplyResources(Me.Label1, "Label1")
+ Me.Label1.Name = "Label1"
+ '
+ 'cmbClients
+ '
+ resources.ApplyResources(Me.cmbClients, "cmbClients")
+ Me.cmbClients.FormattingEnabled = True
+ Me.cmbClients.Name = "cmbClients"
+ '
+ 'Label2
+ '
+ resources.ApplyResources(Me.Label2, "Label2")
+ Me.Label2.Name = "Label2"
+ '
+ 'btnLogin
+ '
+ resources.ApplyResources(Me.btnLogin, "btnLogin")
+ Me.btnLogin.Name = "btnLogin"
+ Me.btnLogin.UseVisualStyleBackColor = True
+ '
+ 'frmClientLogin
+ '
+ Me.AcceptButton = Me.btnLogin
+ resources.ApplyResources(Me, "$this")
+ Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
+ Me.BackColor = System.Drawing.SystemColors.ControlLight
+ Me.ControlBox = False
+ Me.Controls.Add(Me.btnLogin)
+ Me.Controls.Add(Me.Label2)
+ Me.Controls.Add(Me.cmbClients)
+ Me.Controls.Add(Me.Label1)
+ Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
+ Me.MaximizeBox = False
+ Me.MinimizeBox = False
+ Me.Name = "frmClientLogin"
+ Me.ResumeLayout(False)
+ Me.PerformLayout()
+
+ End Sub
+ Friend WithEvents Label1 As System.Windows.Forms.Label
+ Friend WithEvents cmbClients As System.Windows.Forms.ComboBox
+ Friend WithEvents Label2 As System.Windows.Forms.Label
+ Friend WithEvents btnLogin As System.Windows.Forms.Button
+End Class
diff --git a/app/DD_Clipboard_Searcher/frmClientLogin.en.resx b/app/DD_Clipboard_Searcher/frmClientLogin.en.resx
new file mode 100644
index 0000000..8e0571a
--- /dev/null
+++ b/app/DD_Clipboard_Searcher/frmClientLogin.en.resx
@@ -0,0 +1,136 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
+ 421, 16
+
+
+ Your User is configured for more than one cleint. Please choose a client.
+
+
+ 287, 14
+
+
+ Your license will be charged on the selected client.
+
+
+ Client Login
+
+
\ No newline at end of file
diff --git a/app/DD_Clipboard_Searcher/frmClientLogin.resx b/app/DD_Clipboard_Searcher/frmClientLogin.resx
new file mode 100644
index 0000000..8019f34
--- /dev/null
+++ b/app/DD_Clipboard_Searcher/frmClientLogin.resx
@@ -0,0 +1,274 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
+ True
+
+
+
+ Tahoma, 9.75pt
+
+
+ 12, 9
+
+
+ 486, 16
+
+
+ 0
+
+
+ Ihr User ist für mehrere Mandanten konfiguriert. Bitte wählen Sie einen Mandanten.
+
+
+ Label1
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ $this
+
+
+ 3
+
+
+ Tahoma, 9.75pt
+
+
+ 15, 56
+
+
+ 472, 24
+
+
+ 1
+
+
+ cmbClients
+
+
+ System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ $this
+
+
+ 2
+
+
+ True
+
+
+ Tahoma, 9pt, style=Italic
+
+
+ 12, 31
+
+
+ 440, 14
+
+
+ 2
+
+
+ Ihre Userlizenz wird vom Kontingent des ausgewählten Mandanten abgezogen.
+
+
+ Label2
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ $this
+
+
+ 1
+
+
+ Tahoma, 9.75pt
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGdSURBVFhH7ZM9boQwEIU5Qo6QI+QM9Ehp6VLQc4vt6ZFS
+ UuYG9FS5AkWShsKJxE9JeNYMMcYQbFixivKkT9r1zLw3XhZvr7quu2+a5rltWzHQEwJnqFHbdVTX9YMW
+ rCPQQ+3HCrdDAILyPO/DMOx935fgM854iav8EvSzyyAO1uEl0Etjxwk3g7l6cx3U0INeGjtOZGwMVuE+
+ GjtON7PAaY/g9D/hKa8hGe6G7OxlMnOB7OzFBupzBpfLZRaCM72Pa2RnLzbQjYG6hCkccJ3sljX8ax+H
+ xhce0DGZAwQvhQOep5i5hBB3/HqtEUWRMeA3eJ7i5uLwqqrkTYIgGIfxGWeooSeO44n5FlYXGN7VJxTL
+ spwE66CGHiyi972/fUjUM5XVBYbCK4rqzdI07YuikOAzn6MHvUmSjGfAeQE8exRwK27OsmwcYHCmmmEx
+ /r4F9qHYH/ECLpiCluAZip1KNbXBFLQEz1DkVLaG3O8CRU7FRVOYCdXQFoqciot60Kf4kujnq2Yu+l/g
+ ZhdY4u8uYAuN75fJfAs07ijP+wYj01KCKhcnhQAAAABJRU5ErkJggg==
+
+
+
+ MiddleLeft
+
+
+ 15, 86
+
+
+ 472, 42
+
+
+ 3
+
+
+ Login
+
+
+ btnLogin
+
+
+ System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ $this
+
+
+ 0
+
+
+ True
+
+
+ 6, 13
+
+
+ 499, 142
+
+
+ Tahoma, 8.25pt
+
+
+
+ CenterScreen
+
+
+ Mandanten Login
+
+
+ frmClientLogin
+
+
+ System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/app/DD_Clipboard_Searcher/frmClientLogin.vb b/app/DD_Clipboard_Searcher/frmClientLogin.vb
new file mode 100644
index 0000000..f84a695
--- /dev/null
+++ b/app/DD_Clipboard_Searcher/frmClientLogin.vb
@@ -0,0 +1,29 @@
+Public Class frmClientLogin
+
+ Private Sub frmClientLogin_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
+ If cmbClients.SelectedIndex = -1 Or CLIENT_SELECTED = 99 Then
+ MsgBox("Please select a client from the dropdown-list.", MsgBoxStyle.Exclamation)
+ e.Cancel = True
+ End If
+ End Sub
+
+ Private Sub frmClientLogin_Load(sender As Object, e As EventArgs) Handles Me.Load
+ Try
+ cmbClients.DataSource = DT_CLIENT_USER
+ cmbClients.DisplayMember = DT_CLIENT_USER.Columns("CLIENT_NAME").ColumnName
+ cmbClients.ValueMember = DT_CLIENT_USER.Columns("CLIENT_ID").ColumnName
+ Catch ex As Exception
+ MsgBox("Unexpected Error in Loading Data: " & ex.Message, MsgBoxStyle.Critical)
+ End Try
+ End Sub
+
+ Private Sub btnLogin_Click(sender As Object, e As EventArgs) Handles btnLogin.Click
+ If cmbClients.SelectedIndex <> -1 Then
+ CLIENT_SELECTED = cmbClients.SelectedValue
+ Me.Close()
+ Else
+ MsgBox("Please select a client from the dropdown-list.", MsgBoxStyle.Exclamation)
+ Exit Sub
+ End If
+ End Sub
+End Class
\ No newline at end of file
diff --git a/app/DD_Clipboard_Searcher/frmMain.vb b/app/DD_Clipboard_Searcher/frmMain.vb
index 300dfff..1fb5d9a 100644
--- a/app/DD_Clipboard_Searcher/frmMain.vb
+++ b/app/DD_Clipboard_Searcher/frmMain.vb
@@ -1,11 +1,12 @@
-Imports System.Threading
+Imports System.ComponentModel
+Imports System.Threading
Imports DD_LIB_Standards
Public Class frmMain
Dim WithEvents Hotkey As New clsHotkey(Me)
Private PID As Integer
Private WithEvents _Watcher As ClipboardWatcher = ClipboardWatcher.Singleton
- Private Sub frmClipboardWatch_Disposed(ByVal sender As Object, _
+ Private Sub frmClipboardWatch_Disposed(ByVal sender As Object,
ByVal e As EventArgs) Handles Me.Disposed
_Watcher.Dispose()
End Sub
@@ -94,13 +95,13 @@ Public Class frmMain
Private Sub frmMain_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
clsLogger.Add(">> Logout time: " & Now.ToString, False)
- If ERROR_INIT = "INVALID USER" Then
+ If ERROR_INIT = "INVALID USER" Or ERROR_INIT = "NO CLIENT" Then
Exit Sub
End If
Try
'Dim sql = String.Format("UPDATE TBDD_USER SET LOGGED_IN = 0, LOGGED_WHERE = '{0}' WHERE (LOWER(USERNAME) = LOWER('{1}'))", "", USER_USERNAME)
'clsDatabase.Execute_non_Query(sql, True)
- Dim sql = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & USER_GUID & " AND UPPER(MODULE) = UPPER('Clipboard-Watcher')"
+ Dim sql = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & USER_ID & " AND UPPER(MODULE) = UPPER('Clipboard-Watcher')"
clsDatabase.Execute_non_Query(sql, True)
ClassWindowLocation.SaveFormLocationSize(Me, "")
My.Settings.Save()
@@ -140,6 +141,15 @@ Public Class frmMain
End If
If clsDatabase.DB_DEFAULT_INITIALIZED = True Then
+ If ERROR_INIT <> "" Then
+ If ERROR_INIT = "NO CLIENT" Then
+ MsgBox("You are not related to a client!" & vbNewLine & "Please contact the system administrator!", MsgBoxStyle.Exclamation)
+ Else
+ MsgBox("Sorry Something went wrong in user configuration!" & vbNewLine & "Please contact the system administrator!", MsgBoxStyle.Exclamation)
+ End If
+
+ Exit Sub
+ End If
Me.NotifyIconMain.Visible = True
clsHotkey.Refresh_Profile_Links()
Hotkey.AddHotKey(Keys.T, clsHotkey.MODKEY.MOD_CONTROL, 354522017)
@@ -266,4 +276,7 @@ Public Class frmMain
Me.Hide()
End Sub
+ Private Sub frmMain_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
+
+ End Sub
End Class
diff --git a/app/DD_Clipboard_Searcher/frmSplash.vb b/app/DD_Clipboard_Searcher/frmSplash.vb
index 840694e..dae5b27 100644
--- a/app/DD_Clipboard_Searcher/frmSplash.vb
+++ b/app/DD_Clipboard_Searcher/frmSplash.vb
@@ -80,7 +80,10 @@ Public NotInheritable Class frmSplash
bw.ReportProgress(CalcProgress(4), "Initializing User-Configuration")
If ClassInit.InitUserLogin = False Then
- ERROR_INIT = "INVALID USER"
+ If ERROR_INIT = "" Then
+ ERROR_INIT = "INVALID USER"
+ End If
+
End If
diff --git a/app/DD_Clipboard_Searcher/modCurrent.vb b/app/DD_Clipboard_Searcher/modCurrent.vb
index 0e451af..7b9b404 100644
--- a/app/DD_Clipboard_Searcher/modCurrent.vb
+++ b/app/DD_Clipboard_Searcher/modCurrent.vb
@@ -4,23 +4,29 @@
Public HotkeyFunctionKey As String = "strg"
Public HotkeySearchKey As String = "f"
Public LogErrorsOnly As Boolean = True
- Public USER_LANGUAGE As String = "de-DE"
Public CURRENT_WINDOW_NAME As String
Public CURRENT_USER_SHORT As String
Public USER_USERNAME As String
- Public USER_GUID As Integer
Public USER_IS_ADMIN As Boolean = False
+ Public USER_ID
+ Public USER_PRENAME
+ Public USER_SURNAME
+ Public USER_SHORTNAME
+ Public USER_EMAIL
+ Public USER_LANGUAGE As String = "de-DE"
+ Public USER_EXISTS = False
+ Public USER_IN_MODULE = False
- Public USERS_LOGGED_IN As Integer
+ Public USERCOUNT_LOGGED_IN As Integer
Public LICENSE_COUNT As Integer
Public LICENSE_DATE As Date
Public LICENSE_EXPIRED As Boolean = False
Public DT_CLIENT_USER As DataTable
- Public ERROR_INIT As String
+ Public ERROR_INIT As String = ""
Public START_INCOMPLETE As Boolean = False
Public CONNECTION_CHANGED As Boolean = False
Public ESC_Hidden As Boolean = False
@@ -42,4 +48,6 @@
Public PROC_Name As String
Public PROC_WindowTitle As String
Public LOGGER_FILEPATH As String
+
+ Public CLIENT_SELECTED As Integer = 0
End Module