Changeset 11975 for main/waeup.ikoba/trunk/src/waeup/ikoba/browser/pages.py
- Timestamp:
- 16 Nov 2014, 23:05:04 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/browser/pages.py
r11954 r11975 271 271 self.request.principal.id] 272 272 rel_link = '/customers/%s' % self.request.principal.id 273 if customer.personal_data_expired:274 rel_link = '/customerss/%s/edit_personal' % (275 self.request.principal.id)276 self.flash(277 _('Your personal data record is outdated. Please update.'),278 type='warning')273 #if customer.personal_data_expired: 274 # rel_link = '/customers/%s/edit_personal' % ( 275 # self.request.principal.id) 276 # self.flash( 277 # _('Your personal data record is outdated. Please update.'), 278 # type='warning') 279 279 self.redirect(self.application_url() + rel_link) 280 280 return … … 284 284 self.redirect(self.camefrom) 285 285 return 286 # Display appropriate flash message if credentials are correct 287 # but customer has been deactivated or a temporary password 288 # has been set. 289 login = self.request.form['form.login'] 290 if len(login) == 8 and login in grok.getSite()['customers']: 291 customer = grok.getSite()['customers'][login] 292 password = self.request.form['form.password'] 293 passwordmanager = getUtility(IPasswordManager, 'SSHA') 294 if customer.password is not None and \ 295 passwordmanager.checkPassword(customer.password, password): 296 # The customer entered valid credentials. 297 # First we check if a temporary password has been set. 298 delta = timedelta(minutes=10) 299 now = datetime.utcnow() 300 temp_password_dict = getattr(customer, 'temp_password', None) 301 if temp_password_dict is not None and \ 302 now < temp_password_dict.get('timestamp', now) + delta: 303 self.flash( 304 _('Your account has been temporarily deactivated.'), 305 type='warning') 306 return 307 # Now we know that the customer is suspended. 308 comment = self._comment(customer) 309 if comment: 310 self.flash(comment, type='warning') 311 else: 312 self.flash(_('Your account has been deactivated.'), 313 type='warning') 314 return 286 315 self.flash(_('You entered invalid credentials.'), type='danger') 287 316 return
Note: See TracChangeset for help on using the changeset viewer.