changeset 3394:396d3434ab92

move some code under openid_server_enabled where it belongs
author Johannes Berg <johannes AT sipsolutions DOT net>
date Fri, 21 Mar 2008 18:25:03 +0100
parents 93aa3b53ddc9
children d5ad5578b2a5
files MoinMoin/Page.py
diffstat 1 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/Page.py	Fri Mar 21 17:09:51 2008 +0100
+++ b/MoinMoin/Page.py	Fri Mar 21 18:25:03 2008 +0100
@@ -1160,16 +1160,18 @@
                 title = self.split_title()
 
                 html_head = ''
-                openid_username = self.page_name
-                userid = user.getUserId(request, openid_username)
-                if userid is None and 'openid.user' in self.pi:
-                    openid_username = self.pi['openid.user']
+                if request.cfg.openid_server_enabled:
+                    openid_username = self.page_name
                     userid = user.getUserId(request, openid_username)
 
-                if request.cfg.openid_server_restricted_users_group:
-                    request.dicts.addgroup(request,
-                                           request.cfg.openid_server_restricted_users_group)
-                if request.cfg.openid_server_enabled:
+                    if userid is None and 'openid.user' in self.pi:
+                        openid_username = self.pi['openid.user']
+                        userid = user.getUserId(request, openid_username)
+
+                    if request.cfg.openid_server_restricted_users_group:
+                        request.dicts.addgroup(request,
+                                               request.cfg.openid_server_restricted_users_group)
+
                     if userid is not None and not request.cfg.openid_server_restricted_users_group or \
                       request.dicts.has_member(request.cfg.openid_server_restricted_users_group, openid_username):
                         html_head = '<link rel="openid2.provider" href="%s">' % \