Skip to content

Commit

Permalink
Merge PR OCA#190 into 12.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Apr 29, 2020
2 parents 4c6a3b2 + f38942c commit a0967ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions users_ldap_populate/models/users_ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ def _get_ldap_entry_dicts(self, conf, user_name='*', timeout=60):
ldap_password = conf['ldap_password'] or ''
ldap_binddn = conf['ldap_binddn'] or ''
conn.simple_bind_s(
ldap_binddn.encode('utf-8'),
ldap_password.encode('utf-8')
ldap_binddn,
ldap_password
)
results = conn.search_st(
conf['ldap_base'].encode('utf-8'),
conf['ldap_base'],
ldap.SCOPE_SUBTREE,
ldap_filter.encode('utf8'),
ldap_filter,
None,
timeout=timeout
)
Expand Down Expand Up @@ -173,7 +173,7 @@ def get_ldap_entry_dicts(self, conf, user_name='*'):
conn.simple_bind_s(conf['ldap_binddn'] or '',
conf['ldap_password'] or '')
results = conn.search_st(conf['ldap_base'], ldap.SCOPE_SUBTREE,
ldap_filter.encode('utf8'), None,
ldap_filter, None,
timeout=60)
conn.unbind()

Expand Down
2 changes: 1 addition & 1 deletion users_ldap_populate/tests/test_users_ldap_populate.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def simple_bind_s(self, user, password):
return True

def search_st(self, base, scope, ldap_filter, attributes, timeout=None):
if ldap_filter.decode() == '(uid=*)':
if ldap_filter == '(uid=*)':
return self.results
else:
return []
Expand Down

0 comments on commit a0967ff

Please sign in to comment.