summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-07-05 13:04:08 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-07-05 13:04:08 +0100
commit4db2566d1391ec458a6b4dd9a5324ae6f658ea15 (patch)
tree8d38d033377091bc08a24f22ac891eb857304703 /pykolab
parenta5462b9450047521bd766280c0d1b0af17f297ee (diff)
downloadpykolab-4db2566d1391ec458a6b4dd9a5324ae6f658ea15.tar.gz
Amend some of the _connect() code
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/auth/__init__.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/pykolab/auth/__init__.py b/pykolab/auth/__init__.py
index 3e44532..b33c0be 100644
--- a/pykolab/auth/__init__.py
+++ b/pykolab/auth/__init__.py
@@ -90,25 +90,27 @@ class Auth(object):
else:
section = domain
- if self._auth.has_key(section) and not self._auth[section] == None:
+ if self._auth.has_key(domain) and not self._auth[domain] == None:
return
- #print "Connecting to Authentication backend for domain %s" %(domain)
+ log.debug(_("Connecting to Authentication backend for domain %s") %(domain), level=8)
if not conf.has_section(section):
section = 'kolab'
+ if not conf.has_option(section, 'auth_mechanism'):
+ section = 'kolab'
+
if conf.get(section, 'auth_mechanism') == 'ldap':
from pykolab.auth import ldap
self._auth[domain] = ldap.LDAP()
elif conf.get(section, 'auth_mechanism') == 'sql':
from pykolab.auth import sql
self._auth[domain] = sql.SQL()
- #else:
- ## TODO: Fail more verbose
- #print "COULD NOT FIND AUTHENTICATION MECHANISM FOR DOMAIN %s" %(domain)
- #print self._auth
+ else:
+ from pykolab.auth import ldap
+ self._auth[domain] = ldap.LDAP()
def disconnect(self, domain=None):
"""