cancel
Showing results for 
Search instead for 
Did you mean: 

How to have a 'unique or single session' by user

andrewriver
Champ in-the-making
Champ in-the-making
Here is the case:

There is any way that one user who logs in Share, with an active session, couldn't log in another browser or PC with the same user?

Regards, and thanks for your comments…
5 REPLIES 5

mrogers
Star Contributor
Star Contributor
You would need to code that yourself.     Intercept the login and store some sort of flag, that prevents a second login.    Reset the flag on log out.

kevinr
Star Contributor
Star Contributor
Assuming you are using 3.3 or 3.4 then you can override the LoginController SpringMVC controller bean in Share:

spring-surf-mvc-context.xml
<bean id="logoutController" class="org.springframework.extensions.surf.mvc.LogoutController">

This bean is responsible for authenticating users. You would override it and code up your own class that checked to see if the user was currently logged in and reject them if they were.

Kev

andrewriver
Champ in-the-making
Champ in-the-making
Thanks a lot for your help. I follow your instructions and code my own solution:

I modified the spring-surf-mvc-context.xml from spring with new classes Login and Logout controllers, each one with the same sign of the original (extends AbstractController).

Plus, I code a singleton that will be the listener of my application, so when any user's session were created/destroyed, singleton updates a list of current users.

If anyone needs more support about my solution post it…I will mark this forum as solved.

PS. kevir, I will give you a YES in the useful post rating Smiley Wink

Hi Andrew,

Can you please let me know how can I achieve the same in alfresco 5.1 ??

kevinr
Star Contributor
Star Contributor
Good stuff!

Cheers,

Kev