summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-06-11 14:12:40 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-06-11 14:12:40 +0100
commit3df45ed444e38853e683334b4a5cbdd7e3d17d2a (patch)
tree435dfff94940e144d2b2ae011fa36401e81427c0
parent30a82aebf2cabbd8842bd5b4da2c0a91b971e7bf (diff)
downloadpykolab-3df45ed444e38853e683334b4a5cbdd7e3d17d2a.tar.gz
Sort functions alphabetically
-rw-r--r--pykolab/auth/ldap/__init__.py89
1 files changed, 49 insertions, 40 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index c075742..32f43ff 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -818,50 +818,18 @@ class LDAP(pykolab.base.Base):
except ldap.INVALID_CREDENTIALS:
log.error(_("Invalid bind credentials"))
- def _change_add_user(self, entry, change):
- """
- An entry of type user was added.
+ def _change_add_group(self, entry, change):
"""
- mailserver_attribute = self.config_get('mailserver_attribute')
- if mailserver_attribute == None:
- mailserver_attribute = 'mailhost'
-
- result_attribute = conf.get('cyrus-sasl', 'result_attribute')
-
- if not entry.has_key(mailserver_attribute):
- entry[mailserver_attribute] = \
- self.get_entry_attribute(entry, mailserver_attribute)
-
- rcpt_addrs = self.recipient_policy(entry)
- for key in rcpt_addrs:
- entry[key] = rcpt_addrs[key]
-
- if not entry.has_key(result_attribute):
- return
-
- if entry[result_attribute] == None:
- return
-
- cache.get_entry(self.domain, entry)
-
- self.imap.connect(domain=self.domain)
-
- if not self.imap.user_mailbox_exists(entry[result_attribute]):
- folder = self.imap.user_mailbox_create(
- entry[result_attribute],
- entry[mailserver_attribute]
- )
- else:
- folder = "user%s%s" % (self.imap.separator,entry[result_attribute])
-
- server = self.imap.user_mailbox_server(folder)
+ An entry of type group was added.
- if not entry[mailserver_attribute] == server:
- self.set_entry_attribute(entry, mailserver_attribute, server)
+ The Kolab daemon has little to do for this type of action on this
+ type of entry.
+ """
+ pass
- def _change_add_group(self, entry, change):
+ def _change_add_resource(self, entry, change):
"""
- An entry of type group was added.
+ An entry of type resource was added.
The Kolab daemon has little to do for this type of action on this
type of entry.
@@ -933,6 +901,47 @@ class LDAP(pykolab.base.Base):
#if server == None:
#self.entry_set_attribute(mailserver_attribute, server)
+ def _change_add_user(self, entry, change):
+ """
+ An entry of type user was added.
+ """
+ mailserver_attribute = self.config_get('mailserver_attribute')
+ if mailserver_attribute == None:
+ mailserver_attribute = 'mailhost'
+
+ result_attribute = conf.get('cyrus-sasl', 'result_attribute')
+
+ if not entry.has_key(mailserver_attribute):
+ entry[mailserver_attribute] = \
+ self.get_entry_attribute(entry, mailserver_attribute)
+
+ rcpt_addrs = self.recipient_policy(entry)
+ for key in rcpt_addrs:
+ entry[key] = rcpt_addrs[key]
+
+ if not entry.has_key(result_attribute):
+ return
+
+ if entry[result_attribute] == None:
+ return
+
+ cache.get_entry(self.domain, entry)
+
+ self.imap.connect(domain=self.domain)
+
+ if not self.imap.user_mailbox_exists(entry[result_attribute]):
+ folder = self.imap.user_mailbox_create(
+ entry[result_attribute],
+ entry[mailserver_attribute]
+ )
+ else:
+ folder = "user%s%s" % (self.imap.separator,entry[result_attribute])
+
+ server = self.imap.user_mailbox_server(folder)
+
+ if not entry[mailserver_attribute] == server:
+ self.set_entry_attribute(entry, mailserver_attribute, server)
+
def _change_delete_group(self, entry, change):
"""
An entry of type group was deleted.