Question

" How can I prevent users to login twice from different machines? The Users should only be allowed to login once on the machine. Once he or she login into different machine, the previous machine will logout automatically. How can be implement in magento. is there any plugin that will do this task ???

Was it helpful?

Solution

There is a section "Online Customers" under Customers in Admin.

Here magento shows name, email, ip address, session start time, last activity and last url accessed.

you can call 'log/visitor_online' model and get list of all currently online customers/ visitors.

Now whenever a customer logs in, you can make a custom observer and call its function to match email of that customer with all this data you got from model.

and logout cutomer from previous device if you find a record same.

Hope you understand my point.

OTHER TIPS

I wrote a small extension to enforce the rule you're looking for - allow an admin user to have only one active session. It's a beta release, so test thoroughly.

https://github.com/siliconrockstar/magento-admin-single-session

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top