Redirection and Request Variables
Hi, I've got a page template that display a file using the id given in the request. I also got login/logout functionality on the site using exUserFolder, now I want that If the user looks at the file display he can click the login and after that gets back to the file display page. But this doesn't work, After clicking on the login Button I get a KeyError about the variable which holds the id - after a reload everything is fine. The variable is encoded within the URL using the QUERY_STRING. Is it somehow possible to get rid of this error? If you need more information feel free to ask. Andreas -- Beware of low-flying butterflies.
Andreas Pakulat wrote:
I've got a page template that display a file using the id given in the request. I also got login/logout functionality on the site using exUserFolder, now I want that If the user looks at the file display he can click the login and after that gets back to the file display page. But this doesn't work, After clicking on the login Button I get a KeyError about the variable which holds the id - after a reload everything is fine. The variable is encoded within the URL using the QUERY_STRING. Is it somehow possible to get rid of this error?
I've just checked a fix for this into the CVS trunk, and it's an easy patch to apply if you're not a CVS user: --- CMFCore/CookieCrumbler.py 6 Dec 2001 21:58:18 -0000 1.12 +++ CMFCore/CookieCrumbler.py 13 Jun 2003 18:16:04 -0000 @@ -233,6 +233,9 @@ came_from = req.get('came_from', None) if came_from is None: came_from = req['URL'] + if req.get('QUERY_STRING'): + came_from = '%s?%s' % (came_from, + req['QUERY_STRING']) url = '%s?came_from=%s&retry=%s' % ( page.absolute_url(), quote(came_from), retry) return url
On 13.Jun 2003 - 13:17:00, Evan Simpson wrote:
Andreas Pakulat wrote:
I've got a page template that display a file using the id given in the request. I also got login/logout functionality on the site using exUserFolder, now I want that If the user looks at the file display he can click the login and after that gets back to the file display page. But this doesn't work, After clicking on the login Button I get a KeyError about the variable which holds the id - after a reload everything is fine. The variable is encoded within the URL using the QUERY_STRING. Is it somehow possible to get rid of this error?
I've just checked a fix for this into the CVS trunk, and it's an easy patch to apply if you're not a CVS user:
--- CMFCore/CookieCrumbler.py 6 Dec 2001 21:58:18 -0000 1.12 +++ CMFCore/CookieCrumbler.py 13 Jun 2003 18:16:04 -0000
That one doesn't help me, as this for CookieCrumbler, but I use exUserFolder as I said. I got a workaround redefining the variable I had in the QUERY_STRING within the docLogin DTML-Method. For now It works, but as soon as another variable comes in I have to rewrite the docLogin again, so I would be thankful for a better solution. Andreas -- You are sick, twisted and perverted. I like that in a person.
Hi, Andreas Pakulat wrote:
Hi,
I've got a page template that display a file using the id given in the request. I also got login/logout functionality on the site using exUserFolder, now I want that If the user looks at the file display he can click the login and after that gets back to the file display page. But this doesn't work, After clicking on the login Button I get a KeyError about the variable which holds the id - after a reload everything is fine. The variable is encoded within the URL using the QUERY_STRING. Is it somehow possible to get rid of this error?
If you need more information feel free to ask.
I'd might be that the form coming from the login uses "POST" when this happens, QUERY-variables (such as with GET - the ones after the URL) get never read by zope (or more precisely the cgi.py) for no good reason. I would propose to patch this away to join QUERY and request body variables when POST is used. As a quick solution for you just include a hidden variable for the id in the login form. Regards Tino
participants (3)
-
Andreas Pakulat -
Evan Simpson -
Tino Wildenhain