1
0
Fork 0
mirror of https://github.com/kakwa/ldapcherry synced 2025-07-04 20:37:48 +02:00

multiple changes

* change parameters name for Backend Ldap
* fix default value handling in backends get_param
* correct exception in backends get_param
* fix syntaxe error
* add backend name in test_BackendLdap.py
This commit is contained in:
kakwa 2015-05-21 21:40:13 +02:00
parent cb843a40e5
commit 93ed190913
6 changed files with 34 additions and 27 deletions

View file

@ -16,12 +16,12 @@ class Backend(ldapcherry.backend.Backend):
self.config = config
self._logger = logger
self.backend_name = name
self.binddn = self.get_param(binddn)
self.ca = self.get_param(ca)
self.checkcert = self.get_param(checkcert)
self.starttls = self.get_param(starttls)
self.uri = self.get_param(uri)
self.user_filter_tmpl = self.get_param(user_filter_tmpl)
self.binddn = self.get_param('binddn')
self.ca = self.get_param('ca', False)
self.checkcert = self.get_param('checkcert', 'on')
self.starttls = self.get_param('starttls', 'off')
self.uri = self.get_param('uri')
self.user_filter_tmpl = self.get_param('user_filter_tmpl')
def auth(self, username, password):
@ -97,7 +97,7 @@ class Backend(ldapcherry.backend.Backend):
else:
ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT,ldap.OPT_X_TLS_DEMAND)
if self.starttls == 'on':
if self.starttls == 'on':
try:
ldap_client.start_tls_s()
except ldap.OPERATIONS_ERROR: