diff MoinMoin/theme/__init__.py @ 2009:1b14cc05a54a

refactor authentication and split out session handling
author Johannes Berg <johannes AT sipsolutions DOT net>
date Fri, 20 Apr 2007 15:35:14 +0200
parents dbf2b7426385
children 9b404a43e59c
line wrap: on
line diff
--- a/MoinMoin/theme/__init__.py	Fri Apr 20 15:34:50 2007 +0200
+++ b/MoinMoin/theme/__init__.py	Fri Apr 20 15:35:14 2007 +0200
@@ -277,11 +277,12 @@
             userlinks.append(d['page'].link_to(request, text=_('Preferences'),
                                                querystr={'action': 'userprefs'}, id='userprefs', rel='nofollow'))
 
-        if request.cfg.show_login:
-            if request.user.valid:
+        if request.user.valid:
+            if request.user.auth_method in request.cfg.auth_can_logout:
                 userlinks.append(d['page'].link_to(request, text=_('Logout', formatted=False),
                                                    querystr={'action': 'logout', 'logout': 'logout'}, id='logout', rel='nofollow'))
-            else:
+        else:
+            if request.cfg.auth_have_login:
                 userlinks.append(d['page'].link_to(request, text=_("Login", formatted=False),
                                                    querystr={'action': 'login'}, id='login', rel='nofollow'))