aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Chatzimichos <tampakrap@gentoo.org>2011-07-20 05:19:03 +0300
committerTheo Chatzimichos <tampakrap@gentoo.org>2011-07-20 05:19:03 +0300
commitda797655b0b41d8d40bd90de724aaa425099f73a (patch)
treee6b876a13de0a16815d3b2c02a8f9ad1ddd4e34c
parentMove the ModelForms from models.py to forms.py (diff)
downloadidentity.gentoo.org-da797655b0b41d8d40bd90de724aaa425099f73a.tar.gz
identity.gentoo.org-da797655b0b41d8d40bd90de724aaa425099f73a.tar.bz2
identity.gentoo.org-da797655b0b41d8d40bd90de724aaa425099f73a.zip
In ldap_wrapper for user search, set anon=False if an ldap object is
passed to the function
-rw-r--r--libraries/ldap_wrappers.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/libraries/ldap_wrappers.py b/libraries/ldap_wrappers.py
index 0ec00e7..a81ca1b 100644
--- a/libraries/ldap_wrappers.py
+++ b/libraries/ldap_wrappers.py
@@ -98,14 +98,16 @@ def ldap_current_user_bind(username, password):
return None
def ldap_user_search(filter = '*', attr = settings.LDAP_BASE_ATTR, results = None, anon = True, l = False):
- if anon:
- l = ldap_anon_user_bind()
'''
Perform LDAP query, it supports multiple OU's and attrs.
Since there is ability to search in multiple OU's
(eg ou=developers and ou=users). If there is a result
available, the for loop should break
'''
+ if l:
+ anon = False
+ if anon:
+ l = ldap_anon_user_bind()
user = ''
for ldap_base_dn in settings.LDAP_BASE_DN:
try: