diff options
| author | Barry Warsaw | 2012-01-01 14:13:46 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2012-01-01 14:13:46 -0500 |
| commit | ea48a9360f0c0e0d1974fdcdce6b31821818ee76 (patch) | |
| tree | bc1b230b020d8954ccbafa57508f441b50c4f961 /src/mailman/rest/users.py | |
| parent | d1352a018ccc979303fee1d67dca8ee6a588ec69 (diff) | |
| download | mailman-ea48a9360f0c0e0d1974fdcdce6b31821818ee76.tar.gz mailman-ea48a9360f0c0e0d1974fdcdce6b31821818ee76.tar.zst mailman-ea48a9360f0c0e0d1974fdcdce6b31821818ee76.zip | |
Diffstat (limited to 'src/mailman/rest/users.py')
| -rw-r--r-- | src/mailman/rest/users.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mailman/rest/users.py b/src/mailman/rest/users.py index 857d29471..6423836f2 100644 --- a/src/mailman/rest/users.py +++ b/src/mailman/rest/users.py @@ -26,18 +26,18 @@ __all__ = [ ] +from flufl.password import lookup, make_secret, generate from restish import http, resource from uuid import UUID from zope.component import getUtility +from mailman.config import config from mailman.interfaces.address import ExistingAddressError from mailman.interfaces.usermanager import IUserManager from mailman.rest.addresses import UserAddresses from mailman.rest.helpers import CollectionMixin, etag, no_content, path_to from mailman.rest.preferences import Preferences from mailman.rest.validator import Validator -from mailman.utilities.passwords import ( - encrypt_password, make_user_friendly_password) @@ -101,8 +101,9 @@ class AllUsers(_UserBase): error.email)) if password is None: # This will have to be reset since it cannot be retrieved. - password = make_user_friendly_password() - user.password = encrypt_password(password) + password = generate(int(config.passwords.password_length)) + scheme = lookup(config.passwords.password_scheme.upper()) + user.password = make_secret(password, scheme) location = path_to('users/{0}'.format(user.user_id.int)) return http.created(location, [], None) |
