summaryrefslogtreecommitdiffstats
path: root/pykolab/auth/__init__.py
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-05-11 16:05:45 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-05-11 16:06:52 +0100
commit40956adf14080053250465dede49436dad13e5ce (patch)
tree5023688a8cf537f3b5996f36e05c93f29afd4dae /pykolab/auth/__init__.py
parent68c91575fca88dbb198ec2c32ef1dc7974c51014 (diff)
downloadpykolab-40956adf14080053250465dede49436dad13e5ce.tar.gz
Initialize Auth() after the configuration has been finalized.
Fix the kolab smtp access policy using legacy API calls
Diffstat (limited to 'pykolab/auth/__init__.py')
-rw-r--r--pykolab/auth/__init__.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/pykolab/auth/__init__.py b/pykolab/auth/__init__.py
index 47f2322..6eaee64 100644
--- a/pykolab/auth/__init__.py
+++ b/pykolab/auth/__init__.py
@@ -149,11 +149,19 @@ class Auth(pykolab.base.Base):
self._auth._disconnect()
- def find_recipient(self, address):
+ def find_recipient(self, address, domain=None):
"""
Find one or more entries corresponding to the recipient address.
"""
- return self._auth.find_recipient(address)
+ if not domain == None:
+ self.connect(domain=domain)
+
+ result = self._auth.find_recipient(address)
+
+ if isinstance(result, list) and len(result) == 1:
+ return result[0]
+ else:
+ return result
def find_user(self, attr, value, **kw):
return self._auth._find_user(attr, value, domain=domain, **kw)
@@ -197,11 +205,14 @@ class Auth(pykolab.base.Base):
def domain_default_quota(self, domain):
return self._auth._domain_default_quota(domain)
+ def get_entry_attribute(self, domain, entry, attribute):
+ return self._auth.get_entry_attribute(entry, attribute)
+
def get_user_attribute(self, domain, user, attribute):
- return self._auth._get_user_attribute(user, attribute)
+ return self._auth.get_entry_attribute(user, attribute)
def get_user_attributes(self, domain, user, attributes):
- return self._auth._get_user_attributes(user, attributes)
+ return self._auth.get_entry_attributes(user, attributes)
def search_mail_address(self, domain, mail_address):
return self._auth._search_mail_address(domain, mail_address)