summaryrefslogtreecommitdiffstats
path: root/account.py
diff options
context:
space:
mode:
Diffstat (limited to 'account.py')
-rw-r--r--account.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/account.py b/account.py
index 1361669..f25e170 100644
--- a/account.py
+++ b/account.py
@@ -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)