summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pykolab/auth/ldap/__init__.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index 98acb0c..5f9bab5 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -654,10 +654,25 @@ class LDAP(pykolab.base.Base):
entry_dn = self.entry_dn(entry_id)
+ entry = self.get_entry_attributes(entry_dn, ['*'])
+
attrs = {}
for attribute in attributes.keys():
attrs[attribute.lower()] = attributes[attribute]
+ modlist = []
+
+ for attribute in attrs.keys():
+ if not entry.has_key(attribute):
+ entry[attribute] = self.get_entry_attribute(entry_id, attribute)
+
+ for attribute in attrs.keys():
+ if entry.has_key(attribute) and entry[attribute] == None:
+ modlist.append((ldap.MOD_ADD, attribute, attrs[attribute]))
+
+ dn = entry_dn
+ self.ldap.modify_s(dn, modlist)
+
def synchronize(self):
"""
Synchronize with LDAP