summaryrefslogtreecommitdiffstats
path: root/pykolab/auth
diff options
context:
space:
mode:
Diffstat (limited to 'pykolab/auth')
-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 3441394..e05ea80 100644
--- a/pykolab/auth/__init__.py
+++ b/pykolab/auth/__init__.py
@@ -191,11 +191,19 @@ class Auth(pykolab.base.Base):
else:
return result
- def find_user(self, attr, value, **kw):
- return self._auth._find_user(attr, value, domain=domain, **kw)
+ def find_resource(self, address):
+ """
+ Find one or more resources corresponding to the recipient address.
+ """
+ result = self._auth.find_resource(address)
- def search_users(self, attr, value, **kw):
- return self._auth._search_users(attr, value, domain=domain, **kw)
+ 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, **kw)
def list_domains(self):
"""
@@ -248,6 +256,9 @@ class Auth(pykolab.base.Base):
def search_mail_address(self, domain, mail_address):
return self._auth._search_mail_address(domain, mail_address)
+ def search_users(self, attr, value, **kw):
+ return self._auth._search_users(attr, value, **kw)
+
def set_entry_attribute(self, domain, entry, attribute):
return self._auth.set_entry_attribute(entry, attribute)