- Timestamp:
- 14 Oct 2012, 21:02:31 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/authentication.py
r8983 r9334 101 101 102 102 def checkPassword(self, password): 103 """Check whether the given `password` matches the one stored. 103 """Check whether the given `password` matches the one stored by 104 students or the temporary password set by officers. 104 105 105 106 We additionally check if student account has been suspended. … … 107 108 if not isinstance(password, basestring): 108 109 return False 110 passwordmanager = getUtility(IPasswordManager, 'SSHA') 111 temp_password = self.context.getTempPassword() 112 if temp_password: 113 return passwordmanager.checkPassword(temp_password, password) 109 114 if not getattr(self.context, 'password', None): 110 115 # unset/empty passwords do never match … … 112 117 if self.context.suspended == True: 113 118 return False 114 passwordmanager = getUtility(IPasswordManager, 'SSHA') 115 return passwordmanager.checkPassword( 116 self.context.password, password) 119 return passwordmanager.checkPassword(self.context.password, password) 117 120 118 121 class StudentsAuthenticatorPlugin(grok.GlobalUtility):
Note: See TracChangeset for help on using the changeset viewer.