diff options
Diffstat (limited to 'account.py')
-rw-r--r-- | account.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -84,7 +84,7 @@ class AccountService: dn = self._format_dn([('ou', 'services')]) filterstr = '(uid=%s)' % self._escape(uid) - data_service = self.connection.search_s(dn,ldap.SCOPE_SUBTREE,filterstr) + data_service = self.connection.search_s(dn, ldap.SCOPE_SUBTREE, filterstr) services = [] for entry in data_service: @@ -269,6 +269,11 @@ class AccountService: for service, passwords in account.new_password_services.items(): dn = self._format_dn([('uid',account.uid),('cn',service),('ou','services')]) + + if service not in account.services: + attr = [('objectClass', ['top', 'servicePassword']), ('uid', account.uid)] + self.connection.add_s(dn, attr) + old, new = passwords if as_admin: self.connection.passwd_s(dn, None, new) |