diff --git a/lilikusers.py b/lilikusers.py index 95fba2a..a242eaf 100644 --- a/lilikusers.py +++ b/lilikusers.py @@ -67,7 +67,9 @@ class LILiK_USER(object): diff = utils.DictDiffer(new_lilik_user, self.__dict__) modifiers = {user_cn: {}} if 'userPassword' in diff.added() and new_lilik_user['userPassword']: - modifiers[user_cn]['userPassword'] = [(ldap3.MODIFY_REPLACE, [new_lilik_user['userPassword']])] #TODO add hash encryption? + action = ldap3.MODIFY_REPLACE + hashed = ldap3.utils.hashed(HASHED_SALTED_SHA, new_lilik_user['userPassword']) + modifiers[user_cn]['userPassword'] = [(action, [hashed])] for changed in diff.changed(): if changed == 'services': services_diff = utils.DictDiffer(self.__dict__[changed], new_lilik_user[changed])