Changeset View
Changeset View
Standalone View
Standalone View
pykolab/auth/ldap/__init__.py
Show First 20 Lines • Show All 1,853 Lines • ▼ Show 20 Lines | def _change_moddn_user(self, entry, change): | ||||
# the same value. | # the same value. | ||||
if entry_changes.has_key(result_attribute): | if entry_changes.has_key(result_attribute): | ||||
if not old_canon_attr == None: | if not old_canon_attr == None: | ||||
self.imap.user_mailbox_create( | self.imap.user_mailbox_create( | ||||
entry_changes[result_attribute] | entry_changes[result_attribute] | ||||
) | ) | ||||
elif not entry_changes[result_attribute] == old_canon_attr: | elif not entry_changes[result_attribute] == old_canon_attr: | ||||
self.imap.user_mailbox_rename( | # do not rename an existing mailbox | ||||
old_canon_attr, | entry_changes[result_attribute] = old_canon_attr | ||||
entry_changes[result_attribute] | |||||
) | |||||
cache.get_entry(self.domain, entry) | cache.get_entry(self.domain, entry) | ||||
def _change_moddn_sharedfolder(self, entry, change): | def _change_moddn_sharedfolder(self, entry, change): | ||||
pass | pass | ||||
def _change_modify_None(self, entry, change): | def _change_modify_None(self, entry, change): | ||||
pass | pass | ||||
▲ Show 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | def _change_modify_user(self, entry, change): | ||||
if entry_changes.has_key(result_attribute): | if entry_changes.has_key(result_attribute): | ||||
if not entry_changes[result_attribute] == old_canon_attr: | if not entry_changes[result_attribute] == old_canon_attr: | ||||
if old_canon_attr == None: | if old_canon_attr == None: | ||||
self.imap.user_mailbox_create( | self.imap.user_mailbox_create( | ||||
entry_changes[result_attribute] | entry_changes[result_attribute] | ||||
) | ) | ||||
else: | else: | ||||
self.imap.user_mailbox_rename( | # do not rename an existing mailbox | ||||
old_canon_attr, | entry_changes[result_attribute] = old_canon_attr | ||||
entry_changes[result_attribute] | |||||
) | |||||
entry[result_attribute] = entry_changes[result_attribute] | entry[result_attribute] = entry_changes[result_attribute] | ||||
cache.get_entry(self.domain, entry) | cache.get_entry(self.domain, entry) | ||||
elif entry.has_key(result_attribute): | elif entry.has_key(result_attribute): | ||||
if not entry[result_attribute] == old_canon_attr: | if not entry[result_attribute] == old_canon_attr: | ||||
if old_canon_attr == None: | if old_canon_attr == None: | ||||
self.imap.user_mailbox_create( | self.imap.user_mailbox_create( | ||||
entry[result_attribute] | entry[result_attribute] | ||||
) | ) | ||||
else: | else: | ||||
self.imap.user_mailbox_rename( | # do not rename an existing mailbox | ||||
old_canon_attr, | entry[result_attribute] = old_canon_attr | ||||
entry[result_attribute] | |||||
) | |||||
cache.get_entry(self.domain, entry) | cache.get_entry(self.domain, entry) | ||||
else: | else: | ||||
imap_mailbox = "user%s%s" % ( | imap_mailbox = "user%s%s" % ( | ||||
self.imap.get_separator(), | self.imap.get_separator(), | ||||
entry[result_attribute] | entry[result_attribute] | ||||
) | ) | ||||
▲ Show 20 Lines • Show All 153 Lines • ▼ Show 20 Lines | def _change_none_user(self, entry, change): | ||||
log.debug( | log.debug( | ||||
_("Result from recipient policy: %r") % (entry_changes), | _("Result from recipient policy: %r") % (entry_changes), | ||||
level=8 | level=8 | ||||
) | ) | ||||
if entry_changes.has_key(result_attribute) and not old_canon_attr == None: | if entry_changes.has_key(result_attribute) and not old_canon_attr == None: | ||||
if not entry_changes[result_attribute] == old_canon_attr: | if not entry_changes[result_attribute] == old_canon_attr: | ||||
self.imap.user_mailbox_rename( | # do not rename an existing mailbox | ||||
old_canon_attr, | entry_changes[result_attribute] = old_canon_attr | ||||
entry_changes[result_attribute] | |||||
) | |||||
for key in entry_changes.keys(): | for key in entry_changes.keys(): | ||||
entry[key] = entry_changes[key] | entry[key] = entry_changes[key] | ||||
self.set_entry_attribute(entry, key, entry[key]) | self.set_entry_attribute(entry, key, entry[key]) | ||||
cache.get_entry(self.domain, entry) | cache.get_entry(self.domain, entry) | ||||
self.imap.connect(domain=self.domain) | self.imap.connect(domain=self.domain) | ||||
▲ Show 20 Lines • Show All 906 Lines • Show Last 20 Lines |