mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] also uses sha512 in user_update()
This commit is contained in:
parent
147b305e8a
commit
c5a44b8638
1 changed files with 1 additions and 4 deletions
|
@ -289,10 +289,7 @@ def user_update(auth, username, firstname=None, lastname=None, mail=None,
|
|||
new_attr_dict['cn'] = new_attr_dict['displayName'] = firstname + ' ' + lastname
|
||||
|
||||
if change_password:
|
||||
char_set = string.ascii_uppercase + string.digits
|
||||
salt = ''.join(random.sample(char_set, 8))
|
||||
salt = '$1$' + salt + '$'
|
||||
new_attr_dict['userPassword'] = '{CRYPT}' + crypt.crypt(str(change_password), salt)
|
||||
new_attr_dict['userPassword'] = _hash_user_password(change_password)
|
||||
|
||||
if mail:
|
||||
auth.validate_uniqueness({'mail': mail})
|
||||
|
|
Loading…
Add table
Reference in a new issue