Am 20.07.2011 17:17 schrieb jo:
Here is the code:
...
ldapcon = ldap.initialize('ldap://%s'%self.host)
filter = "(%s=%s)" % (self.filter_id,user_name)
rc = ldapcon.search(self.basedn, ldap.SCOPE_SUBTREE, filter)
I guess the problem is that you don't bind to the ldap server before
searching. This would only work if the server allows anonymous search
access. Otherwise you need to do a ldapcon.simple_bind_s(binddn, bindpw)
where binddn is what you usually pass to ldap_search with the -D option
and bindpw the password you pass with the -w option.
Make these configurable like the other settings, catch
ldap.INVALID_CREDENTIALS for the bind command, and do an
ldapcon.unbind_s() at the end.
-- Christoph
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en.