07-31-2018, 04:50 AM
Hi,
I just started using UserSpice and its exactly what I wanted. One thing I needed was to make a user login only one device at a time ? User shouldn't be allowed to login from multiple places simultaneously. Is there a setting to achieve this. I couldn't find it in the documentation.
Thanks in advance.
Hi rockfight,
With the currently released UserSpice, there is a Session Manager built into the application that would (for the most part) allow you to accomplish this. However, a portion of the code causes the script to break so I will have to find the resolution for that before you continue. It would be resolved in 4.4 which is to hopefully be released soon.
What you would do, is be sure to have the session administration enabled, and upon login, in the during login script, forcefully "kill" all existing sessions for that user. This would force an almost immediate logout as long as the users browser supports Javascript. Please poke me later on or tomorrow so I can try to find that code for you.
Thank you,
Brandin.
Hi rockfight,
The only realistic way that currently exists in UserSpice to handle this is to use the Session Manager which is currently broken and will not be fixed until UserSpice 4.4.
The only way you could do it currently is create some sort of token that you store in the session variables and if it is not equal to the one you store in the DB (on login), log the user out. But the user would only see the logout on their next page load. My recommendation is to wait until 4.4 for the solution for Session Tracking and you would be able to do this easily.
Brandin.
Thanks Brandin,
I will wait till 4.4. Hppefully it will be released soon.
At the mean time I was trying to implement one more feature but still not sure it is possible or not.
I have a website that use paid yearly subscription. I have permission levels "Paid" and "Free". If user subscribes to some paid package upgrade him to "Paid" and when his subscription ends downgrade him to "Free" automatically (or via some custom programming logic). Basically What I was looking for is change permission of user based on an event. Is it possible in current version ?
Thank you
You would probably want to write a cron job to do this, and you would just write code that checks the users subscription, and if no longer valid, change to free and remove a permission level and add a different one. You can see examples of adding and removing permission levels on admin_user.php.
You have to trigger the cron job automatically your control panel or server.