changeset 1990:9051a3a23124

some session bugfixes
author Johannes Berg <johannes AT sipsolutions DOT net>
date Sat, 14 Apr 2007 14:02:14 +0200
parents 6d6379c9a1c9
children a51db06be0bd 1c8edc5706b7
files MoinMoin/auth/__init__.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/auth/__init__.py	Thu Apr 12 23:45:48 2007 +0200
+++ b/MoinMoin/auth/__init__.py	Sat Apr 14 14:02:14 2007 +0200
@@ -205,7 +205,7 @@
         else:
             self.ce.update(self._data)
 
-    def get(self, name, default):
+    def get(self, name, default=None):
         return self._data.get(name, default)
 
     def delete(self):
@@ -418,6 +418,9 @@
             # No other method succeeded, so allow continuation...
             # XXX Cookie clear here???
             if verbose: request.log("moin_session did not get valid user from previous auth method, doing nothing")
+            if len(cookieitems) == 1:
+                # keep non-logged in session
+                setAnonCookie(request, cookieitems[0])
             return user_obj, True
 
     if cookievalue is None:
@@ -494,7 +497,7 @@
     """
     user_obj = kw.get('user_obj')
 
-    if request.session or not hasattr(request.cfg, 'anonymous_cookie_lifetime'):
+    if request.session != {} or not hasattr(request.cfg, 'anonymous_cookie_lifetime'):
         return user_obj, True
 
     # moin_session can handle this cookie and migrate