diff options
Diffstat (limited to 'pykolab/auth/ldap')
-rw-r--r-- | pykolab/auth/ldap/__init__.py | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py index c0c3297..1714705 100644 --- a/pykolab/auth/ldap/__init__.py +++ b/pykolab/auth/ldap/__init__.py @@ -1346,7 +1346,7 @@ class LDAP(pykolab.base.Base): ) else: - folder = "user%s%s" % (self.imap.separator,entry[result_attribute].lower()) + folder = "user%s%s" % (self.imap.get_separator(),entry[result_attribute].lower()) server = self.imap.user_mailbox_server(folder) @@ -1676,19 +1676,31 @@ class LDAP(pykolab.base.Base): if entry_changes.has_key(result_attribute): if not entry_changes[result_attribute] == old_canon_attr: - self.imap.user_mailbox_rename( - old_canon_attr, - entry_changes[result_attribute] - ) + if old_canon_attr == None: + self.imap.user_mailbox_create( + entry_changes[result_attribute] + ) + + else: + self.imap.user_mailbox_rename( + old_canon_attr, + entry_changes[result_attribute] + ) entry[result_attribute] = entry_changes[result_attribute] cache.get_entry(self.domain, entry) elif entry.has_key(result_attribute): if not entry[result_attribute] == old_canon_attr: - self.imap.user_mailbox_rename( - old_canon_attr, - entry[result_attribute] - ) + if old_canon_attr == None: + self.imap.user_mailbox_create( + entry[result_attribute] + ) + + else: + self.imap.user_mailbox_rename( + old_canon_attr, + entry[result_attribute] + ) cache.get_entry(self.domain, entry) @@ -1864,7 +1876,7 @@ class LDAP(pykolab.base.Base): server = self.imap.user_mailbox_server(folder) else: folder = "user%s%s" % ( - self.imap.separator, + self.imap.get_separator(), entry[result_attribute] ) |