Skip to content
Snippets Groups Projects
Commit 71793eed authored by admiralobvious's avatar admiralobvious
Browse files

Make sure we check for lower AND upper case prefix

Fixes #3.
parent 424e8e1c
No related branches found
No related tags found
No related merge requests found
...@@ -95,3 +95,18 @@ Classes ...@@ -95,3 +95,18 @@ Classes
.. autoclass:: flask_simpleldap.LDAP .. autoclass:: flask_simpleldap.LDAP
:members: :members:
History
-------
Changes:
- 0.1.1: September 6, 2014
- Fix GitHub issue `#3<https://github.com/admiralobvious/flask-simpleldap/issues/3>`_,
Not compatible with uppercase distinguished names.
- 0.1: August 9, 2014
- Initial Release
\ No newline at end of file
...@@ -188,7 +188,7 @@ class LDAP(object): ...@@ -188,7 +188,7 @@ class LDAP(object):
if records: if records:
if current_app.config['LDAP_USER_GROUPS_FIELD'] in records[0][1]: if current_app.config['LDAP_USER_GROUPS_FIELD'] in records[0][1]:
groups = records[0][1][current_app.config['LDAP_USER_GROUPS_FIELD']] groups = records[0][1][current_app.config['LDAP_USER_GROUPS_FIELD']]
result = [re.findall('cn=(.*?),', group)[0] for group in groups] result = [re.findall('(?:cn=|CN=)(.*?),', group)[0] for group in groups]
return result return result
except ldap.LDAPError as e: except ldap.LDAPError as e:
raise LDAPException(self.error(e)) raise LDAPException(self.error(e))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment