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:16:20 +0200
commit70d9da4a57441a752fa0a8098aca345f91e6d3c6 (patch)
treee6d1596cac5e57ab4ae56a905567f3fd813f5352
parent2ea1d290988ca83ff9947ea942a8a4e033e51020 (diff)
downloadpykolab-70d9da4a57441a752fa0a8098aca345f91e6d3c6.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 413ebf8..118a6d8 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -1771,6 +1771,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,