summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-03-06 10:16:11 +0000
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-03-06 10:16:11 +0000
commit13f6d51d1055cd0feff46f348de9cd81f8755e05 (patch)
tree6a8e459b271b274eb8dc844ed621424449c12cc1
parentc201bf1264122105a201b68db7aa7d6843dafb90 (diff)
downloadpykolab-13f6d51d1055cd0feff46f348de9cd81f8755e05.tar.gz
Add search_users() to Auth as well
-rw-r--r--pykolab/auth/__init__.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/pykolab/auth/__init__.py b/pykolab/auth/__init__.py
index 2aee830..66eb993 100644
--- a/pykolab/auth/__init__.py
+++ b/pykolab/auth/__init__.py
@@ -161,6 +161,23 @@ class Auth(object):
return self._auth._find_user(attr, value, domain=domain, **kw)
+ def search_users(self, attr, value, domain=None, **kw):
+ self.connect(domain)
+
+ if self.secondary_domains.has_key(domain):
+ log.debug(
+ _("Using primary domain %s instead of secondary domain %s")
+ %(
+ self.secondary_domains[domain],
+ domain
+ ),
+ level=9
+ )
+
+ domain = self.secondary_domains[domain]
+
+ return self._auth._search_users(attr, value, domain=domain, **kw)
+
def list_domains(self):
"""
List the domains using the auth_mechanism setting in the kolab