summaryrefslogtreecommitdiffstats
path: root/pykolab/auth/ldap/__init__.py
diff options
context:
space:
mode:
authorPaul Boddie <paul@boddie.org.uk>2014-06-12 21:14:58 +0200
committerPaul Boddie <paul@boddie.org.uk>2014-06-12 21:14:58 +0200
commitf337f57fe6b0afe718efa426f89945720d456d94 (patch)
tree1e60dc67358f04ca798f03910f09aa4e784f04e0 /pykolab/auth/ldap/__init__.py
parent065e117b6f4d2a77c0b9034fb5d9ba1522428244 (diff)
parent4b1f0279d79478555d9d568a58199759296a7b2e (diff)
downloadpykolab-f337f57fe6b0afe718efa426f89945720d456d94.tar.gz
Merge branch 'master' of git://git.kolab.org/git/pykolab into dev/boddie
Conflicts: pykolab/auth/ldap/__init__.py pykolab/cli/cmd_remove_user_subscription.py
Diffstat (limited to 'pykolab/auth/ldap/__init__.py')
-rw-r--r--pykolab/auth/ldap/__init__.py32
1 files changed, 22 insertions, 10 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index b22c49a..1c4fdb3 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -1305,7 +1305,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)
@@ -1495,19 +1495,31 @@ class LDAP(pykolab.base.Base):
if entry_changes.has_key(result_attribute):
if entry_changes[result_attribute] != old_canon_attr:
- self.imap.user_mailbox_rename(
- old_canon_attr,
- entry_changes[result_attribute]
- )
+ if old_canon_attr is 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 entry[result_attribute] != old_canon_attr:
- self.imap.user_mailbox_rename(
- old_canon_attr,
- entry[result_attribute]
- )
+ if old_canon_attr is 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)
@@ -1651,7 +1663,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]
)