comparison MoinMoin/user.py @ 6027:8618232296b5

optimized notification of superusers on user account creation new user.superusers function that efficiently yields superuser User objects without listing / reading ALL user profiles as the previous code did. reduced code duplication.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Wed, 12 Feb 2014 12:53:41 +0100
parents 28a3951fc9f6
children 1893da1d5213
comparison
equal deleted inserted replaced
6026:28a3951fc9f6 6027:8618232296b5
147 @return: the corresponding user ID or None 147 @return: the corresponding user ID or None
148 """ 148 """
149 return _getUserIdByKey(request, 'openids', openid) 149 return _getUserIdByKey(request, 'openids', openid)
150 150
151 151
152 def superusers(request):
153 """
154 yields superuser User objects
155 """
156 for name in request.cfg.superuser:
157 u = User(request, auth_username=name)
158 if u.isSuperUser(): # this checks for addtl. criteria
159 yield u
160
161
152 def getUserIdentification(request, username=None): 162 def getUserIdentification(request, username=None):
153 """ Return user name or IP or '<unknown>' indicator. 163 """ Return user name or IP or '<unknown>' indicator.
154 164
155 @param request: the request object 165 @param request: the request object
156 @param username: (optional) user name 166 @param username: (optional) user name