Changeset View
Changeset View
Standalone View
Standalone View
pykolab/auth/__init__.py
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | def authenticate(self, login): | ||||
if len(login) == 3: | if len(login) == 3: | ||||
# The realm has not been specified. See if we know whether or not | # The realm has not been specified. See if we know whether or not | ||||
# to use virtual_domains, as this may be a cause for the realm not | # to use virtual_domains, as this may be a cause for the realm not | ||||
# having been specified separately. | # having been specified separately. | ||||
use_virtual_domains = conf.get('imap', 'virtual_domains') | use_virtual_domains = conf.get('imap', 'virtual_domains') | ||||
# TODO: Insert debug statements | # TODO: Insert debug statements | ||||
#if use_virtual_domains == "userid": | #if use_virtual_domains == "userid": | ||||
#print "# Derive domain from login[0]" | #print "# Derive domain from login[0]" | ||||
Lint: PEP8 E116: unexpected indentation (comment) | |||||
#elif not use_virtual_domains: | #elif not use_virtual_domains: | ||||
#print "# Explicitly do not user virtual domains??" | #print "# Explicitly do not user virtual domains??" | ||||
Lint: PEP8 E116 unexpected indentation (comment) Lint: PEP8 E116: unexpected indentation (comment) | |||||
#else: | #else: | ||||
## Do use virtual domains, derive domain from login[0] | ## Do use virtual domains, derive domain from login[0] | ||||
Lint: PEP8 E116 unexpected indentation (comment) Lint: PEP8 E116: unexpected indentation (comment) | |||||
#print "# Derive domain from login[0]" | #print "# Derive domain from login[0]" | ||||
Lint: PEP8 E116 unexpected indentation (comment) Lint: PEP8 E116: unexpected indentation (comment) | |||||
if len(login[0].split('@')) > 1: | if len(login[0].split('@')) > 1: | ||||
domain = login[0].split('@')[1] | domain = login[0].split('@')[1] | ||||
elif len(login) >= 4: | elif len(login) >= 4: | ||||
domain = login[3] | domain = login[3] | ||||
else: | else: | ||||
domain = conf.get("kolab", "primary_domain") | domain = conf.get("kolab", "primary_domain") | ||||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | def connect(self, domain=None): | ||||
) | ) | ||||
# Get the actual authentication and authorization backend. | # Get the actual authentication and authorization backend. | ||||
if conf.get(section, 'auth_mechanism') == 'ldap': | if conf.get(section, 'auth_mechanism') == 'ldap': | ||||
log.debug(_("Starting LDAP..."), level=8) | log.debug(_("Starting LDAP..."), level=8) | ||||
from pykolab.auth.ldap import LDAP | from pykolab.auth.ldap import LDAP | ||||
self._auth = LDAP(self.domain) | self._auth = LDAP(self.domain) | ||||
elif conf.get(section, 'auth_mechanism') == 'plesk': | |||||
log.debug(_("Starting Plesk..."), level=8) | |||||
from pykolab.auth import plesk | |||||
self._auth = plesk.Plesk(self.domain) | |||||
# elif conf.get(section, 'auth_mechanism') == 'sql': | # elif conf.get(section, 'auth_mechanism') == 'sql': | ||||
# from .sql import SQL | # from .sql import SQL | ||||
# self._auth = SQL(self.domain) | # self._auth = SQL(self.domain) | ||||
else: | else: | ||||
log.debug(_("Starting LDAP..."), level=8) | log.debug(_("Starting LDAP..."), level=8) | ||||
from pykolab.auth.ldap import LDAP | from pykolab.auth.ldap import LDAP | ||||
self._auth = LDAP(self.domain) | self._auth = LDAP(self.domain) | ||||
▲ Show 20 Lines • Show All 158 Lines • Show Last 20 Lines |
unexpected indentation (comment)