changeset 4191:5fdb6f984a54

Property for session and dummy user object
author Florian Krupicka <florian.krupicka@googlemail.com>
date Wed, 25 Jun 2008 01:03:44 +0200
parents a030da8b2ec9
children 105c5469ac05
files MoinMoin/web/contexts.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/web/contexts.py	Wed Jun 25 01:02:45 2008 +0200
+++ b/MoinMoin/web/contexts.py	Wed Jun 25 01:03:44 2008 +0200
@@ -13,7 +13,7 @@
 from werkzeug.utils import Headers, http_date
 from werkzeug.exceptions import Unauthorized, NotFound
 
-from MoinMoin import i18n, error
+from MoinMoin import i18n, error, user
 from MoinMoin.config import multiconfig
 from MoinMoin.formatter import text_html
 from MoinMoin.theme import load_theme_fallback
@@ -106,7 +106,9 @@
 
 class UserMixin(object):
     """ Mixin for user attributes and methods. """
-    user = EnvironProxy('user')
+    def user(self):
+        return user.User(self, auth_method='request:invalid')
+    user = EnvironProxy(user)
 
 class LanguageMixin(object):
     """ Mixin for language attributes and methods. """
@@ -164,6 +166,7 @@
 class HTTPMixin(object):
     """ Mixin for HTTP attributes and methods. """
     forbidden = EnvironProxy('old.forbidden', 0)
+    session = EnvironProxy('session')
     
     _auth_redirected = EnvironProxy('old._auth_redirected', 0)
     _cache_disabled = EnvironProxy('old._cache_disabled', 0)