Changeset 1535
- Timestamp:
- 11/10/06 22:57:09 (2 years ago)
- Files:
-
- accountmanagerplugin/0.10/acct_mgr/web_ui.py (modified) (3 diffs)
- accountmanagerplugin/0.9/acct_mgr/web_ui.py (modified) (3 diffs)
- accountmanagerplugin/trunk/acct_mgr/web_ui.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
accountmanagerplugin/0.10/acct_mgr/web_ui.py
r1502 r1535 227 227 implements(INavigationContributor, IRequestHandler, ITemplateProvider) 228 228 229 def __init__(self): 230 self._enable_check(log=True) 231 232 def _enable_check(self, log=False): 233 ignore_case = auth.LoginModule(self.env).ignore_case 234 if log and ignore_case: 235 self.log.warn('RegistrationModule is disabled because ' 236 'ignore_auth_case is enabled in trac.ini. ' 237 'This setting needs disabled to support ' 238 'registration.') 239 return not ignore_case 240 229 241 #INavigationContributor methods 230 242 … … 233 245 234 246 def get_navigation_items(self, req): 247 if not self._enable_check(): 248 return 235 249 if req.authname == 'anonymous': 236 250 yield 'metanav', 'register', Markup('<a href="%s">Register</a>', … … 240 254 241 255 def match_request(self, req): 242 return req.path_info == '/register' 256 return req.path_info == '/register' and self._enable_check(log=True) 243 257 244 258 def process_request(self, req): accountmanagerplugin/0.9/acct_mgr/web_ui.py
r1064 r1535 95 95 implements(INavigationContributor, IRequestHandler, ITemplateProvider) 96 96 97 def __init__(self): 98 self._enable_check(log=True) 99 100 def _enable_check(self, log=False): 101 ignore_case = auth.LoginModule(self.env).ignore_case 102 if log and ignore_case: 103 self.log.warn('RegistrationModule is disabled because ' 104 'ignore_auth_case is enabled in trac.ini. ' 105 'This setting needs disabled to support ' 106 'registration.') 107 return not ignore_case 108 97 109 #INavigationContributor methods 98 110 … … 101 113 102 114 def get_navigation_items(self, req): 115 if not self._enable_check(): 116 return 103 117 if req.authname == 'anonymous': 104 118 yield 'metanav', 'register', Markup('<a href="%s">Register</a>', … … 108 122 109 123 def match_request(self, req): 110 return req.path_info == '/register' 124 return req.path_info == '/register' and self._enable_check(log=True) 111 125 112 126 def process_request(self, req): accountmanagerplugin/trunk/acct_mgr/web_ui.py
r1534 r1535 244 244 245 245 def __init__(self): 246 self._ write_check(log=True)247 248 def _ write_check(self, log=False):246 self._enable_check(log=True) 247 248 def _enable_check(self, log=False): 249 249 writable = AccountManager(self.env).supports('set_password') 250 if not writable and log: 251 self.log.warn('RegistrationModule is disabled because the password ' 252 'store does not support writing.') 253 return writable 250 ignore_case = auth.LoginModule(self.env).ignore_case 251 if log: 252 if not writable: 253 self.log.warn('RegistrationModule is disabled because the ' 254 'password store does not support writing.') 255 if ignore_case: 256 self.log.warn('RegistrationModule is disabled because ' 257 'ignore_auth_case is enabled in trac.ini. ' 258 'This setting needs disabled to support ' 259 'registration.') 260 return writable and not ignore_case 254 261 255 262 #INavigationContributor methods … … 259 266 260 267 def get_navigation_items(self, req): 261 if not self._ write_check():268 if not self._enable_check(): 262 269 return 263 270 if req.authname == 'anonymous': … … 268 275 269 276 def match_request(self, req): 270 return req.path_info == '/register' and self._ write_check(log=True)277 return req.path_info == '/register' and self._enable_check(log=True) 271 278 272 279 def process_request(self, req):
