Foros de discusión

Single logon

Anita Srivastava, modificado hace 15 años.

Single logon

New Member Mensajes: 23 Fecha de incorporación: 20/10/08 Mensajes recientes
Hello,
We have created some common logins, so that we developer can go on website and test our portlets. I want to know that how can I have a only single logon, means if some one is already logged on with common login and other person wants to logon with the same login he/she gets an error the login is already in use or somthing.

thanks,
anita
thumbnail
Christianto Sahat, modificado hace 15 años.

RE: Single logon

Regular Member Mensajes: 179 Fecha de incorporación: 25/09/07 Mensajes recientes
You can take a look at Enterprise Admin portlet -> Monitoring tab. The action is implemented in this jsp file :
portal-web/docroot/html/portlet/enterprise_admin/view.jsp
Find a line which consists of tabs1.equals("monitoring")
You can see that it use

com.liferay.portal.liveusers.LiveUsers class to retrieve all active user, along with their session id


Iterator itr = LiveUsers.getSessionUsers(company.getCompanyId()).entrySet().iterator();


Using this util class, you can check whether the user is already login. Information about logged in users is maintained in UserTracker table.