comparison roundup/cgi/actions.py @ 4484:52e13bf0bb40

Add new config-option 'migrate_passwords' in section 'web'... ...to auto-migrate passwords at web-login time. Default for the new option is "yes" so if you don't want that passwords are auto-migrated to a more secure password scheme on user login, set this to "no" before running your tracker(s) after the upgrade.
author Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
date Thu, 14 Apr 2011 18:10:58 +0000
parents 36d52125c9cf
children 693c75d56ebe
comparison
equal deleted inserted replaced
4483:22bc0426e348 4484:52e13bf0bb40
1003 # Base behaviour is to check the user has "Web Access". 1003 # Base behaviour is to check the user has "Web Access".
1004 if not self.hasPermission("Web Access"): 1004 if not self.hasPermission("Web Access"):
1005 raise exceptions.LoginError(self._( 1005 raise exceptions.LoginError(self._(
1006 "You do not have permission to login")) 1006 "You do not have permission to login"))
1007 1007
1008 def verifyPassword(self, userid, password): 1008 def verifyPassword(self, userid, givenpw):
1009 '''Verify the password that the user has supplied''' 1009 '''Verify the password that the user has supplied.
1010 stored = self.db.user.get(userid, 'password') 1010 Optionally migrate to new password scheme if configured
1011 if password == stored: 1011 '''
1012 db = self.db
1013 stored = db.user.get(userid, 'password')
1014 if givenpw == stored:
1015 if db.config.WEB_MIGRATE_PASSWORDS and stored.needs_migration():
1016 db.user.set(userid, password=password.Password(givenpw))
1017 db.commit()
1012 return 1 1018 return 1
1013 if not password and not stored: 1019 if not givenpw and not stored:
1014 return 1 1020 return 1
1015 return 0 1021 return 0
1016 1022
1017 class ExportCSVAction(Action): 1023 class ExportCSVAction(Action):
1018 name = 'export' 1024 name = 'export'

Roundup Issue Tracker: http://roundup-tracker.org/