Limit number of concurrent session per client

484 views
Skip to first unread message

Nicolas Micoud

unread,
Mar 24, 2014, 11:34:09 AM3/24/14
to idem...@googlegroups.com
Hi,

I would like to limit the number of concurrent session per client (AD_Client).

An iDempiere instance has several clients.
And I would like that client 1 can use 5 sessions at a time ; client 2 10 sessions, ...

My idea is to add a field "set as Advanced" on AD_Client : "Number of concurrent session".
And if it is filled, on the login page, compare it with the active session and proceed or show a message ("you have reached the limit !").

Note that some users should be allowed to connect, whatever the number of session (System, SuperUser and ClientAdmin for instance). That would be done in a new table or via a new checkbox on AD_User.

Do you think that could be a common requirement ?


Regards,

Nicolas

Hiep Lq

unread,
Mar 24, 2014, 12:35:23 PM3/24/14
to idem...@googlegroups.com
With this, I think add more option. one account only active on one concurrent session.


--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/2dd68eca-2fb0-4a30-8de0-1d115717e191%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Lê Quý Hiệp
Email: hie...@hasuvimex.vn
Skype: admin.hasuvimex
Mobile: 0915277401

Company: Thanh Hoa Fishery Import - Export J.s.c  (HasuvimexDL 47
Add: Lot E, Le Mon Industrial Zone, Thanh Hoa, Vietnam

Marco Longo

unread,
Mar 24, 2014, 1:20:52 PM3/24/14
to idem...@googlegroups.com
also add if a ad_user is not allowed for more than 1 session ( like for production ) 

Carlos Antonio Ruiz Gomez

unread,
Mar 24, 2014, 2:18:09 PM3/24/14
to idem...@googlegroups.com
This sounds useful for a SaaS business, and also for performance reasons in some normal installations.

But I think the rules will tend to be very flexible - would it be better to create an extension like "MultiSessionControl"?

Regards,

Carlos Ruiz

Jan Thielemann

unread,
Mar 25, 2014, 3:38:28 AM3/25/14
to idem...@googlegroups.com
Hi Nicolas,
have you thought about using a model validator for this? There is the login(Client, Role, User) method where you could return an error if the maximum user count is reached. To keep count of logged in users, you could use the MSession po i think. I believe you could implement all this in your own plugin without modifying the core.

Pedro Rozo

unread,
Mar 25, 2014, 12:44:09 PM3/25/14
to idem...@googlegroups.com
That is a very common requirement .. hope you can publish the plug-in if it is not integrated to the core to test it. 

Regards

Pedro R.

Nicolas Micoud

unread,
Apr 2, 2014, 12:17:03 PM4/2/14
to idem...@googlegroups.com
Hi,


What is added :
 - AD_Client.IsLimitConcurrentSessions : to activate the functionnality
 - AD_Client.MaxConcurrentSessions : maximum sessions for the current client
 - AD_Client.ConcurrentSessionsMsg_ID : message displayed when user can't login
 - AD_User, AD_Role, AD_Org : IsDontCountMeInConcurrSessions : allow to set the record to be not taken in consideration for checking limit of concurrent sessions
 
How does it works ?
After the user is logged, the plugin checks if the maximum number of session is reached (using IEventTopics.AFTER_LOGIN).
If yes, a message is displayed and the user returns to the login page.

I haven't tested for a long time, but it seems to do the job.
Feel free to test it and give feedback.

Thanks

Nicolas

Pedro Rozo

unread,
Mar 10, 2015, 5:48:19 PM3/10/15
to idem...@googlegroups.com
Hi Nicolas....

A quick message to let you know that your plug-in is working good, just want to report that after the deployment (packin) .. it is required: 1. restart the server (otehrwise we get wird errors with postgres perhaps due to AD changes not processed)
2. To test the plug-in we need to go to all the organizations, roles and users  to disable the checkbox:  .Don't count me in concurrent sessions
3. Enable the feature within the client window:  


Thanks for your controibution, and receive our apologies for the delay with these tests but we did not check the progress if this thread since the last year.

Regards,

Pedro Rozo.

Nicolas Micoud

unread,
Mar 11, 2015, 3:51:33 AM3/11/15
to idem...@googlegroups.com
Hi Pedro,

Happy that the plugin is useful :)
Thanks for the feedback, i've updated the wiki.


Regards,

Nicolas

Alfredo Flores Aybar

unread,
Jun 15, 2016, 2:28:58 PM6/15/16
to iDempiere
Hi every One.

I tryed to run plug in, i compiled, exported and installed but when i go to client window i cant see the check Limit number of concurrent sessions.
Please maybe my way to export is bad, can help me with this.

Regards.

Sánchez Torres, Max

unread,
Jun 15, 2016, 6:23:17 PM6/15/16
to idem...@googlegroups.com
Hi Alfredo,

Maybe you can't imported  the pack out....or if you has made changes to yours windows, maybe you need to enable the new options.

Regards

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Max Sánchez Torres
Grupo Tecnológico Hardmax SAC
Calle Baltazar Caravedo 260 Urb. Luren - Ica - Perú.
Tel 056-215320
www.hardmax.com.pe // msan...@hardmax.com.pe

Por favor considere el medio ambiente antes de imprimir este mail.
--------------------------------------------------------------------------
"Este mensaje y sus anexos están dirigidos para uso exclusivo del destinatario y puede  contener información confidencial cuya divulgación o reproducción esté prohibida conforme a las normas peruanas. Asimismo, el contenido del presente mensaje no constituye una oferta ni aceptación de algún servicio o producto por parte de Grupo Tecnológico Hardmax SAC o sus asociados.

Alejandro Guerra

unread,
Sep 12, 2020, 10:38:10 AM9/12/20
to iDempiere
Hi Nicolas,

Can you update the repo ??

Thank in advance 

Regards, 

Nicolas Micoud

unread,
Sep 12, 2020, 12:23:52 PM9/12/20
to iDempiere
Hi Alejandro,

I'm not using it anymore, that's why I guess I did not migrate it to github.
Anyway, I've attached a zip file that contains sources.
As is just an event, it should work directly in newer iDempiere versions.
I'm quite busy ATM, but adding to the TODO list to upload it on github.
If you find things to improve, tell me.

Regards,

Nicolas
org.tgi.limit-concurrent-session.zip
Reply all
Reply to author
Forward
0 new messages