summaryrefslogtreecommitdiffstats
path: root/pykolab/auth/__init__.py
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-04-13 12:33:10 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-04-13 12:33:10 +0100
commit6bcf448d8ee1a9a542d7798c39a68d1be604c61f (patch)
treef8bc5bc3b9f49e2002a05f2050d0b193bdd8c696 /pykolab/auth/__init__.py
parentbc0af8397060e65a265bc9ce22df17b1353bf436 (diff)
downloadpykolab-6bcf448d8ee1a9a542d7798c39a68d1be604c61f.tar.gz
Allow the Kolab SMTP Access Policy to consult groups as well
Diffstat (limited to 'pykolab/auth/__init__.py')
-rw-r--r--pykolab/auth/__init__.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/pykolab/auth/__init__.py b/pykolab/auth/__init__.py
index 36e9600..04fd578 100644
--- a/pykolab/auth/__init__.py
+++ b/pykolab/auth/__init__.py
@@ -144,6 +144,23 @@ class Auth(object):
self._auth._disconnect()
+ def find_group(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._find_group(attr, value, domain=domain, **kw)
+
def find_user(self, attr, value, domain=None, **kw):
self.connect(domain)
@@ -242,6 +259,14 @@ class Auth(object):
return self._auth._domain_section(domain)
+ def get_group_attribute(self, domain, group, attribute):
+ self.connect(domain=domain)
+
+ if self.secondary_domains.has_key(domain):
+ domain = self.secondary_domains[domain]
+
+ return self._auth._get_group_attribute(group, attribute)
+
def get_user_attribute(self, domain, user, attribute):
self.connect(domain=domain)