Changeset 9334 for main/waeup.kofa/trunk/src/waeup/kofa/browser
- Timestamp:
- 14 Oct 2012, 21:02:31 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
r9326 r9334 23 23 import re 24 24 import sys 25 from datetime import datetime, timedelta 25 26 from urllib import urlencode 26 27 from zope import schema … … 230 231 return 231 232 # Display appropriate flash message if credentials are correct 232 # but student has been deactivated. 233 # but student has been deactivated or a temporary password 234 # has been set. 233 235 login = self.request.form['form.login'] 234 236 if len(login) == 8 and grok.getSite()['students'].has_key(login): … … 238 240 if student.password is not None and \ 239 241 passwordmanager.checkPassword(student.password, password): 242 # The student entered valid credentials. 243 # First we check if a temporary password has been set. 244 delta = timedelta(minutes=10) 245 now = datetime.utcnow() 246 temp_password_dict = getattr(student, 'temp_password', None) 247 if temp_password_dict is not None and \ 248 now < temp_password_dict.get('timestamp', now) + delta: 249 self.flash( 250 _('Your account has been temporarily deactivated.')) 251 return 252 # Now we know that the student is suspended. 240 253 self.flash(_('Your account has been deactivated.')) 241 254 return 242 255 self.flash(_('You entered invalid credentials.')) 256 return 243 257 244 258 … … 919 933 ${e} 920 934 921 """, mapping = {'a':normalized_filename,935 Comment by Import Manager:""", mapping = {'a':normalized_filename, 922 936 'b':importer, 923 937 'c':import_mode,
Note: See TracChangeset for help on using the changeset viewer.