Cut and pasted the wrong code there...
def logon(request):
referer = "/"
if request.get_environ('HTTP_REFERER'):
referer = request.get_environ('HTTP_REFERER')
if referer.find('/logon') == -1:
redirect_url = referer
else:
redirect_url = "/"
return DoLogin(redirect_url).handle(request)
At 08:50 AM 5/17/2002 -0700, Michael Watkins wrote:
>At 11:30 AM 5/17/2002 -0400, you wrote:
> >>>. We originally put the "return URL"
>in the session object, but for reasons that I cannot remember it didn't
>work. I'm pretty sure the !#^%@#^! "Back" button was involved. We now
>put it in the URL, so if you try to access /private/, you are redirected
>to /user/login?/private/, which takes care of sending you to /private/
>once you've logged in. Ugly, but it seems to work most of the time.
><<<
>
>This is what I do... I add a 'return url' to the Form's init...
>
>def logon(request):
> if request.get_environ('HTTP_REFERER'):
> referer = request.get_environ('HTTP_REFERER')
> else:
> referer = "/"
> if referer.find('/logon') == -1:
> redirect_url = referer
>
> return DoLogin(redirect_url).handle(request)
>
>and in DoLogin.__init__() I store redirect_url as a hidden form field, and
>test it yet again in action(). Its a little clunky but works, the user
>doesn't see the clunky-ness, and I don't have to remember to do anything
>to the calling URL...
>
>Mike
>
>
>_______________________________________________
>Quixote-users mailing list
>Quixote-users@mems-exchange.org
>http://www.mems-exchange.org/mailman/listinfo/quixote-users
>