Changeset 9335 for main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Timestamp:
- 15 Oct 2012, 05:08:01 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/authentication.py
r7811 r9335 20 20 """ 21 21 import grok 22 from zope.component import getUtility 23 from zope.password.interfaces import IPasswordManager 22 24 from zope.pluggableauth.interfaces import IAuthenticatorPlugin 23 25 from waeup.kofa.interfaces import IAuthPluginUtility, IUserAccount … … 43 45 def user_type(self): 44 46 return u'applicant' 47 48 def checkPassword(self, password): 49 """Check whether the given `password` matches the one stored by 50 students. 51 52 We additionally check if student account has been suspended. 53 """ 54 if not isinstance(password, basestring): 55 return False 56 passwordmanager = getUtility(IPasswordManager, 'SSHA') 57 if not getattr(self.context, 'password', None): 58 # unset/empty passwords do never match 59 return False 60 if self.context.suspended == True: 61 return False 62 return passwordmanager.checkPassword(self.context.password, password) 45 63 46 64 class ApplicantsAuthenticatorPlugin(StudentsAuthenticatorPlugin):
Note: See TracChangeset for help on using the changeset viewer.