Changeset 7:279473355e9b in OKFNAnnotator (for Zope)
- Timestamp:
- Nov 9, 2012, 5:05:11 PM (12 years ago)
- Branch:
- default
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
AuthTokenGenerator.py
r6 r7 4 4 from AccessControl import getSecurityManager 5 5 from zExceptions import Unauthorized 6 from Acquisition import aq_chain 6 7 7 8 import logging … … 78 79 self.REQUEST.RESPONSE.setStatus('Unauthorized') 79 80 return "Please Authenticate!" 80 81 81 82 82 def _user_allowed(self, user=None, password=None): … … 96 96 if password: 97 97 logging.debug("trying password") 98 # TODO: should we care about aquisition? 99 authuser = self.acl_users.authenticate(user, password, None) 100 return authuser 98 # try all user folders in aq_chain 99 authuser = None 100 userfolder = None 101 for ctx in aq_chain(self): 102 new_uf = getattr(ctx, 'acl_users', None) 103 if new_uf != userfolder: 104 userfolder = new_uf 105 authuser = userfolder.authenticate(user, password, None) 106 if authuser is not None: 107 return authuser 101 108 102 109 return None -
version.txt
r6 r7 1 0. 51 0.6
Note: See TracChangeset
for help on using the changeset viewer.