What about...

auth.settings.login_url = URL(r=request, c='admin/user', f='login')
auth.settings.logged_url = URL(r=request, c='admin/user', f='profile')
auth.settings.login_next = URL(r=request, c='admin', f='index')
auth.settings.logout_next = URL(r=request, c='admin', f='index')
auth.settings.register_next = URL(r=request, c='admin', f='index')
auth.settings.verify_email_next = URL(r=request, c='admin', f='index')
auth.settings.profile_next = URL(r=request, c='admin', f='index')
auth.settings.retrieve_username_next = URL(r=request, c='admin', f='index')
auth.settings.retrieve_password_next = URL(r=request, c='admin', f='index')
auth.settings.change_password_next = URL(r=request, c='admin', f='index')


-Thadeus





On Mon, Dec 28, 2009 at 9:01 AM, mdipierro <mdipie...@cs.depaul.edu> wrote:
> This should work unless you found a bug, but the way you are doing may
> be the problem since variables need to be urlencoded.
>
> Instead of
>
>   URL(request.application,'default','user/logout')+"?
> _next="+request.env.request_uri],# redirect does not work!
>
> try:
>
>   URL(request.application,'default','user/logout',vars=dict
> (_next=request.env.request_uri))
>
> Every time you find yourself concatenating strings in web2py think
> twice for a better solution. ;-)
>
> Massimo
>
>
> On Dec 28, 7:12 am, selecta <gr...@delarue-berlin.de> wrote:
>> Hi there,
>> it would be nice to have the _next variable working for user/logout
>> like it works for user/login
>>
>> In my case i always show a menu on top, whenever a user wants to log
>> in I open the login page an after a sucessfull login I redirect them
>> to wherever they have been before, doing the same for a logout is not
>> possible
>>
>> here is what my menu looks like
>>
>> if 'auth' in globals():
>>     if not auth.is_logged_in():
>>        response.menu_auth = [
>>            [T('Login'), False, auth.settings.login_url+"?
>> _next="+request.env.request_uri,# redirect works
>>             [
>>                    [T('Register'), False,
>>                     URL(request.application,'default','user/
>> register')],
>>                    [T('Lost Password'), False,
>>                     URL(request.application,'default','user/
>> retrieve_password')]]
>>             ],
>>            ]
>>     else:
>>         response.menu_auth = [
>>             ['User: '+auth.user.first_name,False,None,
>>              [
>>                     [T('Logout'), False,
>>                      URL(request.application,'default','user/logout')
>> +"?_next="+request.env.request_uri],# redirect does not work!
>>                     [T('Edit Profile'), False,
>>                      URL(request.application,'default','user/
>> profile')],
>>                     [T('Change Password'), False,
>>                      URL(request.application,'default','user/
>> change_password')]]
>>              ],
>>             ]
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to