[Zope-CVS] CVS: Products/CookieCrumbler - CHANGES.txt:1.8 CookieCrumbler.py:1.17

Shane Hathaway shane@zope.com
Tue, 10 Jun 2003 13:45:17 -0400


Update of /cvs-repository/Products/CookieCrumbler
In directory cvs.zope.org:/tmp/cvs-serv17489

Modified Files:
	CHANGES.txt CookieCrumbler.py 
Log Message:
Login redirection now restores the query string.

=== Products/CookieCrumbler/CHANGES.txt 1.7 => 1.8 ===
--- Products/CookieCrumbler/CHANGES.txt:1.7	Fri Jun  6 11:15:36 2003
+++ Products/CookieCrumbler/CHANGES.txt	Tue Jun 10 13:44:46 2003
@@ -1,6 +1,8 @@
 
 Next release
 
+- Login redirection now restores the query string.
+
 - Reformatted CookieCrumbler.py to match the version in CMFCore.  This
   will make it easier to keep the two copies in sync.
 


=== Products/CookieCrumbler/CookieCrumbler.py 1.16 => 1.17 ===
--- Products/CookieCrumbler/CookieCrumbler.py:1.16	Fri Jun  6 16:40:44 2003
+++ Products/CookieCrumbler/CookieCrumbler.py	Tue Jun 10 13:44:46 2003
@@ -291,7 +291,13 @@
             if page is not None:
                 came_from = req.get('came_from', None)
                 if came_from is None:
-                    came_from = req['URL']
+                    came_from = req.get('URL', '')
+                    query = req.get('QUERY_STRING')
+                    if query:
+                        # Include the query string in came_from
+                        if not query.startswith('?'):
+                            query = '?' + query
+                        came_from = came_from + query
                 url = '%s?came_from=%s&retry=%s&disable_cookie_login__=1' % (
                     page.absolute_url(), quote(came_from), retry)
                 return url