Create single session for a User

Hello Everyone,
I am working on creating a single session for a user. For example: Let's say user "admin" is logged in, then no other device connected on LAN or wireless can log in again with any login details.
My findings and what I crawled on this forum:
I can see all sessions are stored in the session object so I can get rpc_session_id's for logged-in users from there and know if more than one session exists. Now what I want is if a user is already logged in, then any other who is trying to log in gets a prompt that a user is already logged in and he gets two buttons one is reboot and other is logout other user.
I successfully created a page in /usr/lib/lua/luci/view/test.htm where test.htm is my page which I am rendering from dispatcher.lua after user puts in username and password. My page is getting successfully rendered but I couldn't find a way to execute reboot from this page. I tried embedding Lua code in javascript with onclick function of button but strangely Lua code gets executed as soon as this custom page renders and my device gets rebooted. I also found LUCI Client side APIs where I can execute commands with fs.exec function but that gives me Access Denied in console. Also, I was unable to figure out how to provide permissions to my custom page in /usr/share/rpcd/acl.d .
Any help will be appreciated or if I need to change my approach? Maybe if I could figure out the reboot thing, then I can implement the other option as well with similar approach.

should be able to copy the content of ?

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.