Re: [web2py] Re: Can I simulate multiple user logins to web2py from a single computer?

2014-05-05 Thread 黄祥
web2py itself have an impersonate function, not sure is it suitable in your 
case or not.
e.g.
# user
db.auth_user.bulk_insert([{"first_name" : "Admin", "last_name" : "Admin", 
   "email" : "ad...@a.com", "username" : "admin", 
   "password" : 
db.auth_user.password.validate("password")[0] }, 
  {"first_name" : "User", "last_name" : "User", 
   "email" : "u...@a.com", "username" : "user", 
   "password" : 
db.auth_user.password.validate("password")[0] } ] )

# permission (admin impersonate user)
auth.add_permission(1, "impersonate", "auth_user", 2)

after that please access, default/user/impersonate

best regards,
stifan

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Can I simulate multiple user logins to web2py from a single computer?

2014-05-05 Thread Rufus Smith

Hi Robert,

I noticed that!  I fired up Chrome, and it started a different 
session.   Haven't tried with IE, and until now haven't worked with 
Safari on my desktop. (but on my iphone, yeah).  As the project gets 
closer to a beta stage,  I'll look at compatibility...


Rufus

On 5/5/2014 2:19 AM, Robert Kooij wrote:
Or if you want to keep it even simpler, just use multiple (different) 
browsers, each browser keep track of their own session.


I assume, as a web developer you have Chrome, Firefox and Safari 
installed anyway? Should be able to simulate 3 different user to start 
with. :)



On Monday, May 5, 2014 1:35:56 AM UTC+2, Rufus wrote:

Web2py'ers:

I am trying to create a back end for a multiple user game,
including, for instance, a chat room function.
However, when I try to do this locally, all windows change over to
the "most recent" login.

That is to say, I open up another window to the app, sign in with
a different user id, and type.into
the chat app, and get the new message.  But if I go to one of the
other "formerly signed in" windows
and try to chat, it submits as most recently logged in user.

Can I have multiple sessions/log ins from a single computer?

This may be a security issue, but would be useful for testing if
it could be overridden, even temporarily.

Rufus

--
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 a topic in the 
Google Groups "web2py-users" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/web2py/kT6TxT3XSzo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
web2py+unsubscr...@googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Can I simulate multiple user logins to web2py from a single computer?

2014-05-04 Thread Robert Kooij
Or if you want to keep it even simpler, just use multiple (different) 
browsers, each browser keep track of their own session. 

I assume, as a web developer you have Chrome, Firefox and Safari installed 
anyway? Should be able to simulate 3 different user to start with. :)


On Monday, May 5, 2014 1:35:56 AM UTC+2, Rufus wrote:
>
> Web2py'ers:
>
> I am trying to create a back end for a multiple user game, including, for 
> instance, a chat room function.
> However, when I try to do this locally, all windows change over to the 
> "most recent" login.
>
> That is to say, I open up another window to the app, sign in with a 
> different user id, and type.into
> the chat app, and get the new message.  But if I go to one of the other 
> "formerly signed in" windows
> and try to chat, it submits as most recently logged in user.
>
> Can I have multiple sessions/log ins from a single computer?
>
> This may be a security issue, but would be useful for testing if it could 
> be overridden, even temporarily.
>
> Rufus
>
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Can I simulate multiple user logins to web2py from a single computer?

2014-05-04 Thread Anthony
In Chrome, you can go to Settings, and in the Users section add multiple 
users to create different profiles. I think in that case each profile will 
get different browser session and therefore different session cookies, so 
you can maintain separate logins. For Firefox, there is 
https://addons.mozilla.org/en-US/firefox/addon/cookieswap/.

Anthony

On Sunday, May 4, 2014 7:35:56 PM UTC-4, Rufus wrote:

> Web2py'ers:
>
> I am trying to create a back end for a multiple user game, including, for 
> instance, a chat room function.
> However, when I try to do this locally, all windows change over to the 
> "most recent" login.
>
> That is to say, I open up another window to the app, sign in with a 
> different user id, and type.into
> the chat app, and get the new message.  But if I go to one of the other 
> "formerly signed in" windows
> and try to chat, it submits as most recently logged in user.
>
> Can I have multiple sessions/log ins from a single computer?
>
> This may be a security issue, but would be useful for testing if it could 
> be overridden, even temporarily.
>
> Rufus
>
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.