Changeset 7147 for main/waeup.sirp/trunk/src/waeup/sirp/authentication.py
- Timestamp:
- 19 Nov 2011, 23:03:49 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/authentication.py
r7137 r7147 9 9 from zope.securitypolicy.interfaces import IPrincipalRoleManager 10 10 from zope.securitypolicy.principalrole import principalRoleManager 11 from waeup.sirp.interfaces import IUserAccount, IAuthPluginUtility 11 from waeup.sirp.interfaces import ( 12 IUserAccount, IAuthPluginUtility, IPasswordValidator) 12 13 13 14 def setup_authentication(pau): … … 170 171 site = grok.getSite() 171 172 return site['users'] 173 174 class PasswordValidator(grok.GlobalUtility): 175 176 grok.implements(IPasswordValidator) 177 178 def validate_password(self, pw, pw_repeat): 179 errors = [] 180 if len(pw) < 3: 181 errors.append('Password must have at least 3 chars.') 182 if pw != pw_repeat: 183 errors.append('Passwords do not match.') 184 return errors 172 185 173 186 @grok.subscribe(IUserAccount, grok.IObjectRemovedEvent)
Note: See TracChangeset for help on using the changeset viewer.