MS Änderungen login

This commit is contained in:
Digital Data - Marlon Schreiber
2018-06-20 12:50:55 +02:00
parent bb412d1141
commit e38b5366a7
10 changed files with 658 additions and 96 deletions

View File

@@ -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)

View File

@@ -127,6 +127,12 @@
<Compile Include="frmAdministration.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmClientLogin.designer.vb">
<DependentUpon>frmClientLogin.vb</DependentUpon>
</Compile>
<Compile Include="frmClientLogin.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmLicense.Designer.vb">
<DependentUpon>frmLicense.vb</DependentUpon>
</Compile>
@@ -180,6 +186,12 @@
<DependentUpon>frmAdministration.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="frmClientLogin.en.resx">
<DependentUpon>frmClientLogin.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmClientLogin.resx">
<DependentUpon>frmClientLogin.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmLicense.resx">
<DependentUpon>frmLicense.vb</DependentUpon>
</EmbeddedResource>

View File

@@ -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)

View File

@@ -0,0 +1,77 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmClientLogin
Inherits System.Windows.Forms.Form
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
<System.Diagnostics.DebuggerNonUserCode()> _
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.
<System.Diagnostics.DebuggerStepThrough()> _
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

View File

@@ -0,0 +1,136 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="Label1.Size" type="System.Drawing.Size, System.Drawing">
<value>421, 16</value>
</data>
<data name="Label1.Text" xml:space="preserve">
<value>Your User is configured for more than one cleint. Please choose a client.</value>
</data>
<data name="Label2.Size" type="System.Drawing.Size, System.Drawing">
<value>287, 14</value>
</data>
<data name="Label2.Text" xml:space="preserve">
<value>Your license will be charged on the selected client.</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Client Login</value>
</data>
</root>

View File

@@ -0,0 +1,274 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="Label1.Font" type="System.Drawing.Font, System.Drawing">
<value>Tahoma, 9.75pt</value>
</data>
<data name="Label1.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 9</value>
</data>
<data name="Label1.Size" type="System.Drawing.Size, System.Drawing">
<value>486, 16</value>
</data>
<data name="Label1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="Label1.Text" xml:space="preserve">
<value>Ihr User ist für mehrere Mandanten konfiguriert. Bitte wählen Sie einen Mandanten.</value>
</data>
<data name="&gt;&gt;Label1.Name" xml:space="preserve">
<value>Label1</value>
</data>
<data name="&gt;&gt;Label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;Label1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;Label1.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="cmbClients.Font" type="System.Drawing.Font, System.Drawing">
<value>Tahoma, 9.75pt</value>
</data>
<data name="cmbClients.Location" type="System.Drawing.Point, System.Drawing">
<value>15, 56</value>
</data>
<data name="cmbClients.Size" type="System.Drawing.Size, System.Drawing">
<value>472, 24</value>
</data>
<data name="cmbClients.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="&gt;&gt;cmbClients.Name" xml:space="preserve">
<value>cmbClients</value>
</data>
<data name="&gt;&gt;cmbClients.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cmbClients.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;cmbClients.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="Label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="Label2.Font" type="System.Drawing.Font, System.Drawing">
<value>Tahoma, 9pt, style=Italic</value>
</data>
<data name="Label2.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 31</value>
</data>
<data name="Label2.Size" type="System.Drawing.Size, System.Drawing">
<value>440, 14</value>
</data>
<data name="Label2.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="Label2.Text" xml:space="preserve">
<value>Ihre Userlizenz wird vom Kontingent des ausgewählten Mandanten abgezogen.</value>
</data>
<data name="&gt;&gt;Label2.Name" xml:space="preserve">
<value>Label2</value>
</data>
<data name="&gt;&gt;Label2.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;Label2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;Label2.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="btnLogin.Font" type="System.Drawing.Font, System.Drawing">
<value>Tahoma, 9.75pt</value>
</data>
<data name="btnLogin.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGdSURBVFhH7ZM9boQwEIU5Qo6QI+QM9Ehp6VLQc4vt6ZFS
UuYG9FS5AkWShsKJxE9JeNYMMcYQbFixivKkT9r1zLw3XhZvr7quu2+a5rltWzHQEwJnqFHbdVTX9YMW
rCPQQ+3HCrdDAILyPO/DMOx935fgM854iav8EvSzyyAO1uEl0Etjxwk3g7l6cx3U0INeGjtOZGwMVuE+
GjtON7PAaY/g9D/hKa8hGe6G7OxlMnOB7OzFBupzBpfLZRaCM72Pa2RnLzbQjYG6hCkccJ3sljX8ax+H
xhce0DGZAwQvhQOep5i5hBB3/HqtEUWRMeA3eJ7i5uLwqqrkTYIgGIfxGWeooSeO44n5FlYXGN7VJxTL
spwE66CGHiyi972/fUjUM5XVBYbCK4rqzdI07YuikOAzn6MHvUmSjGfAeQE8exRwK27OsmwcYHCmmmEx
/r4F9qHYH/ECLpiCluAZip1KNbXBFLQEz1DkVLaG3O8CRU7FRVOYCdXQFoqciot60Kf4kujnq2Yu+l/g
ZhdY4u8uYAuN75fJfAs07ijP+wYj01KCKhcnhQAAAABJRU5ErkJggg==
</value>
</data>
<data name="btnLogin.ImageAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleLeft</value>
</data>
<data name="btnLogin.Location" type="System.Drawing.Point, System.Drawing">
<value>15, 86</value>
</data>
<data name="btnLogin.Size" type="System.Drawing.Size, System.Drawing">
<value>472, 42</value>
</data>
<data name="btnLogin.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="btnLogin.Text" xml:space="preserve">
<value>Login</value>
</data>
<data name="&gt;&gt;btnLogin.Name" xml:space="preserve">
<value>btnLogin</value>
</data>
<data name="&gt;&gt;btnLogin.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnLogin.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;btnLogin.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 13</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>499, 142</value>
</data>
<data name="$this.Font" type="System.Drawing.Font, System.Drawing">
<value>Tahoma, 8.25pt</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
<value>CenterScreen</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Mandanten Login</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>frmClientLogin</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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