[Checkins] SVN: Products.PluggableAuthService/trunk/ Allow for a query string in CookieAuthHelper's login_path.

Laurence Rowe l at lrowe.co.uk
Tue Oct 12 11:23:39 EDT 2010


Log message for revision 117478:
  Allow for a query string in CookieAuthHelper's login_path.

Changed:
  U   Products.PluggableAuthService/trunk/CHANGES.txt
  U   Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/CookieAuthHelper.py

-=-
Modified: Products.PluggableAuthService/trunk/CHANGES.txt
===================================================================
--- Products.PluggableAuthService/trunk/CHANGES.txt	2010-10-12 15:21:51 UTC (rev 117477)
+++ Products.PluggableAuthService/trunk/CHANGES.txt	2010-10-12 15:23:38 UTC (rev 117478)
@@ -4,6 +4,8 @@
 1.7.2 (unreleased)
 ------------------
 
+- Allow for a query string in CookieAuthHelper's ``login_path``.
+
 - Trap "swallowable" exceptions from ``IRoles`` plugins.  Thanks to
   Willi Langenburger for the patch.  Fixes
   https://bugs.launchpad.net/zope-pas/+bug/615474 .

Modified: Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/CookieAuthHelper.py
===================================================================
--- Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/CookieAuthHelper.py	2010-10-12 15:21:51 UTC (rev 117477)
+++ Products.PluggableAuthService/trunk/Products/PluggableAuthService/plugins/CookieAuthHelper.py	2010-10-12 15:23:38 UTC (rev 117478)
@@ -210,7 +210,11 @@
                     # in an endless redirect loop.
                     return 0
 
-            url = url + '?came_from=%s' % quote(came_from)
+            if '?' in url:
+                sep = '&'
+            else:
+                sep = '?'
+            url = '%s%scame_from=%s' % (url, sep, quote(came_from))
             resp.redirect(url, lock=1)
             return 1
 



More information about the checkins mailing list