Take uid as parameter for change_password instead of user_dn
This commit is contained in:
parent
7d09819ccb
commit
3bc2e0a7e5
2 changed files with 5 additions and 5 deletions
|
|
@ -121,17 +121,17 @@ class LdapManager:
|
|||
conn.unbind()
|
||||
|
||||
|
||||
def change_password(self, user_dn, new_password):
|
||||
def change_password(self, uid, new_password):
|
||||
"""
|
||||
Changes the password of the user identified by user_dn
|
||||
|
||||
:param user_dn: str The distinguished name for identifying the user
|
||||
:param uid: str The uid that identifies the user
|
||||
:param new_password: str The new password string
|
||||
:return: True if password was changed successfully False otherwise
|
||||
"""
|
||||
conn = self.get_admin_conn()
|
||||
return_val = conn.modify(
|
||||
user_dn,
|
||||
("uid={uid}," + settings.LDAP_CUSTOMER_DN).format(uid=uid),
|
||||
{
|
||||
"userpassword": (
|
||||
ldap3.MODIFY_REPLACE,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue