One more question for everyone. How do I access data in an LDAP database from Zope without using LDAP UserFolder? I don't want people to have to log in to view our LDAP server (it's a phonebook app), but adding LDAPUserFolder to a folder seems to force people into authenticating. I'd like to just do: import ldap l = ldap.initialize("ldap://ldap.inktomi.com:389") l.simple_bind_s("","") res = l.search_s("ou=People, dc=inktomi, dc=com", ldap.SCOPE_ONELEVEL, "uid=%s" % requestor_uid); print res[1]["userpassword"][0] ...in a python script, after a form is posted, based on whateveer requestor_uid is (filled out in a previous form), but it's strange, I get a popup for an authentication box (even when the script has full proxy rights as manager) when this attempts to initalize. The error I get after I abort the login popup is: Error Type: Unauthorized Error Value: You are not allowed to access initialize in this context (everything works in command-line python, btw.) Thanks again. --john
Use an external method instead of Python Script. The through-the-web security of Python Scripts are getting in your way. ----- Original Message ----- From: "John Adams" <jadams@inktomi.com> To: <zope@zope.org> Sent: Thursday, May 09, 2002 10:01 PM Subject: [Zope] Zope and LDAP
One more question for everyone.
How do I access data in an LDAP database from Zope without using
LDAP
UserFolder? I don't want people to have to log in to view our LDAP server (it's a phonebook app), but adding LDAPUserFolder to a folder seems to force people into authenticating.
I'd like to just do:
import ldap
l = ldap.initialize("ldap://ldap.inktomi.com:389") l.simple_bind_s("","") res = l.search_s("ou=People, dc=inktomi, dc=com", ldap.SCOPE_ONELEVEL, "uid=%s" % requestor_uid);
print res[1]["userpassword"][0]
...in a python script, after a form is posted, based on whateveer requestor_uid is (filled out in a previous form), but it's strange, I get a popup for an authentication box (even when the script has full proxy rights as manager) when this attempts to initalize.
The error I get after I abort the login popup is:
Error Type: Unauthorized Error Value: You are not allowed to access initialize in this context
(everything works in command-line python, btw.)
Thanks again. --john
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (2)
-
Chris McDonough -
John Adams