What I have been trying to do is create a program which checks to see if a new user has logged in, and if a new user has logged in, force logout existing users. I am trying to do this by checking to see if VisuNativeControl.CurrentFullUserName does not equal the logged in user on record. When this condition is met, the program will call VisuElems.Visu_FctLogoutUser(pClient) where pClient is a pointer to VisuElems.VisuElemBase.VisuStructClientData. This method does not seem to actually log out the existing user. Is there some other method which can be used to log out the user? Please let me know
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
VisuElems.g_ClientManager.BeginIteration();IFisLoggedInTHENWHILE(pClient :=VisuElems.VisuElemBase.g_ClientManager.GetNextClient())<>0DOIFpClient^.GlobalData.CurrentUserName=loggedInUserTHENEXIT;END_IFEND_WHILEIFNOT(pClient=0)THENVisuElems.Visu_FctLogoutUser(pClient);loggedInUser :=VisuNativeControl.CurrentFullUserName; //record new logged in userEND_IFELSE//elsethere's no logged in user on recordLoggedInUser :=VisuNativeControl.CurrentFullUserName; //logged in user on record is set to the name newly enteredisLoggedIn :=TRUE; //logged in state is changed to trueEND_IF
What this should do (or at least what I hope it should do) is iterate through the list of active users until it finds a user with a username which matches the recorded logged in user's username. Once this is found it should logout the user then record the new user's username. If no user is logged in then it skips this and simply logs in whichever user decides to log in.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello all,
What I have been trying to do is create a program which checks to see if a new user has logged in, and if a new user has logged in, force logout existing users. I am trying to do this by checking to see if VisuNativeControl.CurrentFullUserName does not equal the logged in user on record. When this condition is met, the program will call VisuElems.Visu_FctLogoutUser(pClient) where pClient is a pointer to VisuElems.VisuElemBase.VisuStructClientData. This method does not seem to actually log out the existing user. Is there some other method which can be used to log out the user? Please let me know
Hello @jackcaissey,
you should be able to logout a user with this internal function.
Could you provide a example project?
Best regards,
Marcel
What this should do (or at least what I hope it should do) is iterate through the list of active users until it finds a user with a username which matches the recorded logged in user's username. Once this is found it should logout the user then record the new user's username. If no user is logged in then it skips this and simply logs in whichever user decides to log in.
Hello @jackcaissey,
attached you can find an example using the recommended way to look through all clients.
Best regards,
Marcel