Skip to content
Snippets Groups Projects
Commit be5a98de authored by Alexandre Ferland's avatar Alexandre Ferland Committed by GitHub
Browse files

Merge pull request #30 from theneedyguy/master

Fix for python3
parents c2467322 315a05c9
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import re import re
from functools import wraps from functools import wraps
import ldap import ldap
import sys
from ldap import filter as ldap_filter from ldap import filter as ldap_filter
from flask import abort, current_app, g, make_response, redirect, url_for, \ from flask import abort, current_app, g, make_response, redirect, url_for, \
request request
...@@ -149,6 +150,9 @@ class LDAP(object): ...@@ -149,6 +150,9 @@ class LDAP(object):
return return
try: try:
conn = self.initialize conn = self.initialize
if sys.version_info[0] > 2:
conn.simple_bind_s(user_dn, password)
else:
conn.simple_bind_s(user_dn.decode('utf-8'), password) conn.simple_bind_s(user_dn.decode('utf-8'), password)
return True return True
except ldap.LDAPError: except ldap.LDAPError:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment