Table of Contents

Class UserManagement

Namespace
PHCLibrary
Assembly
PHCLibrary.dll
public class UserManagement
Inheritance
UserManagement

Fields

_lockUserLogins

protected readonly object _lockUserLogins

Field Value

object

_usersLogins

protected List<UserLogin> _usersLogins

Field Value

List<UserLogin>

Methods

AddUserLogin(UserLogin)

public void AddUserLogin(UserLogin login)

Parameters

Nome Tipo Descrição
login UserLogin

DisableUserLogin(IEnumerable<UserLogin>, string, string[])

public void DisableUserLogin(IEnumerable<UserLogin> userLogins, string notifyMsg, string[] msgParas = null)

Parameters

Nome Tipo Descrição
userLogins IEnumerable<UserLogin>
notifyMsg string
msgParas string[]

GetLogin()

The login primaryKey is (applicationID, sessionID, userCode, companyName)

-> applicationID, it's a login type (GO, ENGINE, SupportUser, ContabUser, PHCPublicApps)

-> sessionID, is a unique id that represents a session within an applicationID type, all different windows of the same browser or all tabs within a window share the same ID

-> userCode, is the user code that was used to login

-> companyName, in case the installation has more than one database, it is the name of the database selected at login

public UserLogin GetLogin()

Returns

UserLogin

The algorithm tries to return the active login first: LoginStatus.LogIn

Examples

Login - applicationID - sessionID - User - Company -> Consumer user licenses

01 - GO - Desktop 01/Crome (tab1) - João - MainCompany -> 1 02 - GO - Desktop 01/Crome (tab2) - João - MainCompany -> 1 sessionID is shared by different browser tabs 03 - GO - Desktop 01/Crome (window2) - João - MainCompany -> 1 sessionID is shared by different windows of the same browser type 04 - GO - Desktop 01/Crome - João - SecondaryCompany -> 2 sessionID is the same but as the database is different, so it assumes a unique value

05 - GO - Desktop 02/Crome - João - MainCompany -> 2 login 01 is kickoff (logout automatically, we assume that 01's logout has been forgotten) 06 - GO - Desktop 02/Firefox - João - MainCompany -> 2 login 05 is kickoff (logout automatically) 07 - GO - Desktop 02/Firefox - João - SecondaryCompany -> 2 login 04 is kickoff (logout automatically)

08 - Engine - External 01 - João - MainCompany -> 3 09 - Engine - External 01 - João - SecondaryCompany -> 4 sessionID is the same but as the database is different, so it assumes a unique value

10 - Engine - External 02 - João - MainCompany -> 4 login 08 is logout not kickoff because we do not control the software on the corresponding device. 11 - Engine - External 01 - João - MainCompany -> automatic login is refused, it is necessary to perform a new login process

12 - Support/Contab - External 01 - sys - MainCompany -> 4 does not consume users 13 - Support/Contab - External 01 - sys - SecondaryCompany -> 4

14 - Support/Contab - External 02 - sys - MainCompany -> login is refused until login 12 logout, only one login per database is allowed, user 14 is alerted that it is occupied by user 12

GetLogins()

public List<UserLogin> GetLogins()

Returns

List<UserLogin>

RemoveUserLogin(UserLogin)

public void RemoveUserLogin(UserLogin login)

Parameters

Nome Tipo Descrição
login UserLogin

Events

RemovingUserLogin

public static event UserManagement.RemovingUserLoginEventHandler RemovingUserLogin

Event Type

UserManagement.RemovingUserLoginEventHandler