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 149 Lines • ▼ Show 20 Lines | def find_resource(self, address): | ||||
if isinstance(result, list) and len(result) == 1: | if isinstance(result, list) and len(result) == 1: | ||||
return result[0] | return result[0] | ||||
else: | else: | ||||
return result | return result | ||||
def find_user(self, attr, value, **kw): | def find_user(self, attr, value, **kw): | ||||
return self._auth.search_entry_by_attribute(attr, value, **kw) | return self._auth.search_entry_by_attribute(attr, value, **kw) | ||||
def find_user_dn(self, login, kolabuser=False): | def find_user_dn(self, login, kolabuser=False, domain=None): | ||||
return self._auth._find_user_dn(login, kolabuser); | return self._auth._find_user_dn(login, kolabuser, domain); | ||||
def list_recipient_addresses(self, user): | def list_recipient_addresses(self, user): | ||||
return self._auth.list_recipient_addresses(user) | return self._auth.list_recipient_addresses(user) | ||||
def extract_recipient_addresses(self, entry): | def extract_recipient_addresses(self, entry): | ||||
return self._auth.extract_recipient_addresses(entry) | return self._auth.extract_recipient_addresses(entry) | ||||
def list_delegators(self, user): | def list_delegators(self, user): | ||||
▲ Show 20 Lines • Show All 80 Lines • Show Last 20 Lines |
unexpected indentation (comment)