[Zope] easy question ? How to jump back to a previous page..

Terry Hancock hancock at anansispaceworks.com
Thu Jun 17 12:10:07 EDT 2004


On Thursday 17 June 2004 04:19 am, Martin Koekenberg wrote:
> I've a loginscreen (Session based User folder).
> 
> In my index_html template is the folowing code :
> 
> <dtml-if expr="AUTHENTICATED_USER.getUserName() == 'Anonymous User'">
> <dtml-call expr="RESPONSE.redirect('/login', lock=1)">
> </dtml-if>
> 
> /login is the login page. But how can I automaticaly jump back  (after a succesfull login) to de page that was requested before the loginscreen ?
> 
> Example:
> 
> I enter the site (http://beta.swol1894.nl). That page will forward me to the login. After a succesfull login I want a jump to the homepage.  (That page send me to the login).
> 
> Who know's a solution for this ?

IIRC, I did it by passing a HTTP GET argument to the login form:

> <dtml-call expr="RESPONSE.redirect('/login?origin=' + absolute_url(), lock=1)">

Or something like that (you'll need to deal with quoting problems, etc).

Then you just use that value in a redirect (you probably have to submit it again
when you actually login, and the "you are logged in" page will be a redirect to
your original page.

Cheers,
Terry


--
Terry Hancock ( hancock at anansispaceworks.com )
Anansi Spaceworks  http://www.anansispaceworks.com




More information about the Zope mailing list