comparison MoinMoin/security/textcha.py @ 4822:d44a9c23438c

Groups2009: script.migration.wikiutil160a and security.textcha work with the new groups code.
author Dmitrijs Milajevs <dimazest@gmail.com>
date Thu, 25 Jun 2009 14:50:45 +0200
parents 5ad5753ae311
children 9d510417add0
comparison
equal deleted inserted replaced
4821:fe472a24fbcc 4822:d44a9c23438c
44 self._init_qa(question) 44 self._init_qa(question)
45 45
46 def _get_textchas(self): 46 def _get_textchas(self):
47 """ get textchas from the wiki config for the user's language (or default_language or en) """ 47 """ get textchas from the wiki config for the user's language (or default_language or en) """
48 request = self.request 48 request = self.request
49 groups = request.groups
49 cfg = request.cfg 50 cfg = request.cfg
50 user = request.user 51 user = request.user
51 disabled_group = cfg.textchas_disabled_group 52 disabled_group = cfg.textchas_disabled_group
52 if disabled_group and user.name and request.dicts.has_member(disabled_group, user.name): 53 if disabled_group and user.name and disabled_group in groups and user.name in groups[disabled_group]:
53 return None 54 return None
54 textchas = cfg.textchas 55 textchas = cfg.textchas
55 if textchas: 56 if textchas:
56 lang = user.language or request.lang 57 lang = user.language or request.lang
57 logging.debug(u"TextCha: user.language == '%s'." % lang) 58 logging.debug(u"TextCha: user.language == '%s'." % lang)