Re: [Zope] RESPONSE.redirect not working
Am 24.05.2006, 00:24 Uhr schriebte Andrew Hedges <andrew@clearwired.com>:
I'm at my wit's end. Any help is appreciated. Yes, I have worn Google out trying to figure this out.
In my (yeah, yeah, I know) DTML method, I have structured things like so:
<dtml-call pyCheckSession> <-- a Python script that checks
Hi there! Given your code in pyCheckSession try the following (not tested): <dtml-unless pyCheckSession> <dtml-return ""> </dtml-unless> and change pyCheckSession to:
if url <> '': "If we have need to, bump the user out" RESPONSE.redirect(url) return 0 .... else: .... return 1
The call to "redirect" doesn't magically stop processing of everything else you programmed. Hope it helps, Jo. -- internetmanufaktur jo----------------------------- Berlin, Germany |||||||||||||||meder------------------- fon: ++49-30-44 04 27 82 http://www.meder.de/ -------------------- fax: ++49-30-44 04 30 95 Kollwitzstr. 66 ------------------------ mob: ++49-170- 2 98 89 97 10435 Berlin ---------------http://www.meder.de/keys/jo-pubkey.txt
Jo, THANK YOU! This worked (with a slight change to the dtml-return): <dtml-unless pyCheckSession> <dtml-return login_html> </dtml-unless> I *thought* I had seen redirect work as I had had it before, but maybe I misunderstood what was happening. In any case, many thanks! -Andrew On May 23, 2006, at 5/23/2006 4:46 PMMDT, Jo Meder wrote:
Hi there!
Given your code in pyCheckSession try the following (not tested):
<dtml-unless pyCheckSession> <dtml-return ""> </dtml-unless>
and change pyCheckSession to:
if url <> '': "If we have need to, bump the user out" RESPONSE.redirect(url) return 0 .... else: .... return 1
The call to "redirect" doesn't magically stop processing of everything else you programmed.
participants (2)
-
Andrew Hedges -
Jo Meder