There is now the NMB_OF_SESSIONS function that can be used to check how many sessions the currently logged in user has. There is also a LOGOUT action that can forcefully logout the current user.
So if you want to prevent a user with the same name to login twice you can write an Init process that would look like this:
IF NMB_OF_SESSIONS(LoggedInSystemUser) > 1 Then HandleMultipleLoggedInUsers
The HandleMultipleLoggedInUsers process could look like this:
DISPLAY QUESTION 'There is already a logged in user with this name. Do you want to cancel his session and proceed with the login?'
If Question.Reply = 'Yes' Then
LOGOUT LoggedInSystemUser
ELSE
REPORT ERROR 'Login aborted'
The Init process MUST be specified as the initialisation process for the appropriate visual perspective.
The above implementation of the HandleMultipleLoggedInUsers process checks if this is the second login with the same name and if it is it asks the user a question whether to kick out the current user or not. If you just want to disallow login you can REPORT ERROR straight away, but the problem with this implementation is that if the current user went for coffee, noone else will be able to login in the meantime. In our experience the above implementation is the best. But it's up to you. The flexibility is there. NMB_OF_SESSIONS, LOGOUT and REPORT ERROR should be enough.l