changeset 2040:68e302934c77

add cookie back to auth keyword arguments the php_session auth requires the cookie and parsing it again would be stupid since in request we have parsed it already, so pass a reference to it in keywords
author Johannes Berg <johannes AT sipsolutions DOT net>
date Tue, 22 May 2007 11:11:09 +0200
parents ca376b20b122
children fa0bec111fdf
files MoinMoin/auth/__init__.py MoinMoin/auth/php_session.py MoinMoin/request/__init__.py
diffstat 3 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/auth/__init__.py	Sun May 20 22:23:41 2007 +0200
+++ b/MoinMoin/auth/__init__.py	Tue May 22 11:11:09 2007 +0200
@@ -16,6 +16,8 @@
                  [login only]
        password: the value of the 'password' form field (or None)
                  [login only]
+       cookie: a Cookie.SimpleCookie instance containing the cookie
+               that the browser sent
        multistage: boolean indicating multistage login continuation
                    [may not be present, login only]
 
--- a/MoinMoin/auth/php_session.py	Sun May 20 22:23:41 2007 +0200
+++ b/MoinMoin/auth/php_session.py	Tue May 22 11:11:09 2007 +0200
@@ -49,6 +49,7 @@
 
             return dec(username), dec(email), dec(name)
 
+        cookie = kw.get('cookie')
         if not cookie is None:
             for cookiename in cookie:
                 cookievalue = urllib.unquote(cookie[cookiename].value).decode('iso-8859-1')
--- a/MoinMoin/request/__init__.py	Sun May 20 22:23:41 2007 +0200
+++ b/MoinMoin/request/__init__.py	Tue May 22 11:11:09 2007 +0200
@@ -611,7 +611,9 @@
         login = kw.get('login')
         logout = kw.get('logout')
         stage = kw.get('stage')
-        extra = {}
+        extra = {
+            'cookie': self._cookie,
+        }
         if login:
             extra['attended'] = attended
             extra['username'] = username