kakwa / ldapcherry

Web UI for managing users and groups in multiple directory services.
MIT License
225 stars 70 forks source link

Modify user raises ldap.ALREADY_EXIST #61

Open polmic opened 4 years ago

polmic commented 4 years ago

Hi everyone,

I had an issue with the modify user feature (not self modify).

When updating a user, an error ldap.ALREADY_EXIST is raised, this is because in the function set_attrs (file backend_ldap.py l480) the test to see if we are trying to update the username is failing. So we try to update the uid, with the same uid, raising an error

I changed this test a bit from if attr.lower() == self.dn_user_attr.lower(): to : if attr.lower() == self.dn_user_attr.lower() and old_attrs[attr][0] != attrs[attr]:

I am not making a pr as i know that this can be improved. Im posting this as an issue to let you know about it and the way i solved it.

Cheers