You need to add two field to db.auth_user
Field
('last_login','datetime',default=request.now,writable=False,readable=False)
Field
('last_ip',default=request.env.remote_addr,writable=False,readable=False)
that stores the time of last login, update it at every request in
model
if auth.user and request.now-auth_user.last_login<3600 and
auth.user.last_ip!=request.env.remote_addr:
raise HTTP(400,"not allowed!")
if auth.user: db.auth_user[auth.user.id]=dict
(last_login=request.now,last_ip=request.env.remote_addr)
but you also need
On Sep 30, 1:50 pm, drayco <[email protected]> wrote:
> I have many users with differents roles.
> Those users gave their passwords and username to others.
> I use auth and it allows to the
> people login in to the application with the same user at the same time
> with different pc with different ip.
>
> And I don't want that happen.
>
> Please, Can anybody help me? What can i do?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---