summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-05-22 13:15:15 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-05-22 13:15:15 +0200
commita0857553dad6fa89bbbacf52484c3f15060fd762 (patch)
treef63818c6500ff3951a14748d4511918f3ddef463
parent91c5c14bd09c7778403227ff4dacaebc4ae222c8 (diff)
downloadpykolab-a0857553dad6fa89bbbacf52484c3f15060fd762.tar.gz
Upon deletion of an entry, see if we can get to the value of the result attribute using our cache
-rw-r--r--pykolab/auth/ldap/__init__.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index 441153a..b8afa9c 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -2021,6 +2021,14 @@ class LDAP(pykolab.base.Base):
else:
change = change_dict['change_type']
+ # See if we can find the cache entry - this way we can get to
+ # the value of a (former, on a deleted entry) result_attribute
+ cache_entry = cache.get_entry(self.domain, entry, update=False)
+ result_attribute = conf.get('cyrus-sasl', 'result_attribute')
+
+ if hasattr(cache_entry, 'result_attribute') and change == 'delete':
+ entry[result_attribute] = cache_entry.result_attribute
+
eval(
"self._change_%s_%s(entry, change_dict)" % (
change,