summaryrefslogtreecommitdiff
path: root/src/mailman/rest/users.py
diff options
context:
space:
mode:
authorBarry Warsaw2012-01-07 13:47:51 -0500
committerBarry Warsaw2012-01-07 13:47:51 -0500
commit7a1c7652519841522246278daa3cbc121ded133c (patch)
tree6882f9182116c33c4bb09a18a72ac77ba519f316 /src/mailman/rest/users.py
parent7d8f1cab00e4bceeb567bc9825b01caf72164b5d (diff)
parent0ff2f2e1aee0945b50e9c76f462cd376b6985818 (diff)
downloadmailman-7a1c7652519841522246278daa3cbc121ded133c.tar.gz
mailman-7a1c7652519841522246278daa3cbc121ded133c.tar.zst
mailman-7a1c7652519841522246278daa3cbc121ded133c.zip
Diffstat (limited to 'src/mailman/rest/users.py')
-rw-r--r--src/mailman/rest/users.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mailman/rest/users.py b/src/mailman/rest/users.py
index 857d29471..0a1503930 100644
--- a/src/mailman/rest/users.py
+++ b/src/mailman/rest/users.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2011 by the Free Software Foundation, Inc.
+# Copyright (C) 2011-2012 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
@@ -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)