Browse Source

add password hashing to changes to user

master
Edoardo Putti 7 years ago
parent
commit
713ba216e9
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      lilikusers.py

+ 3
- 1
lilikusers.py View File

@ -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])


Loading…
Cancel
Save