[luci] how to delete a session file in luci-sessions based on user name
Paul dubliner
paul.dubliner at gmail.com
Fri Sep 11 17:24:52 CEST 2009
Hi again -
with regard to the earlier mail, where I have 2 users, 'user1' and 'user2',
who can log-in - 'user1' can access only mini and 'user2' can only access
'admin' - I am now looking at how when 'user2' log-in they can end 'user1's
session if one is in progress.
That is, if user1 has an active session and user2 logs-in - user2 'kicks
out' user1.
To do this, I was thinking if I can match an existing session file in
luci-sessions on the running target against a specific user name?
If so, I am going to read each session file in the sessionpath, to find the
right file and delete it.
Is there a more sensible approach?
Summary In pseudocode:
if user2 logged in
local username = "user1"
for each file in sessionpath
local sdat = sauth.read(filename)
if username == sdat.user then
remove filename
end
end
end
Thanks again
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.subsignal.org/pipermail/luci/attachments/20090911/5541fa0d/attachment.htm
More information about the luci
mailing list