On Sunday, July 19, 2015 at 5:27:50 PM UTC-4, Alex wrote:
>
> Is there a way to get the session filename for a user? I don't think going 
> through all session files will be an option - is it even possible to get 
> the user who belongs to a session file?
>

The session filename is not stored anywhere, so you would have to scan 
through all the session files and look for auth.user.id in each file. It is 
certainly possible, though you may want to do it via an asynchronous task 
rather than within a single HTTP request (though if this is just an 
occassional admin operation, you might not mind waiting).
 

> Checking the blockage on every request also doesn't sound that good. I 
> guess I'll probably check if the user is blocked only on certain 
> operations, e.g. saving certain entries.
>

You could also keep a list of currently blocked users in cache.ram, and 
when a request comes from a user in that list, (a) log out the user and (b) 
remove the ID from the cache.

Anthony  

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to