[Zope-CVS] SVN: ldapadapter/trunk/ Fixed bug reported by Bernd Dorn.

Stephan Richter srichter at cosmos.phy.tufts.edu
Thu Jun 23 09:18:23 EDT 2005


Log message for revision 30897:
  Fixed bug reported by Bernd Dorn.
  

Changed:
  U   ldapadapter/trunk/README.txt
  U   ldapadapter/trunk/check.py

-=-
Modified: ldapadapter/trunk/README.txt
===================================================================
--- ldapadapter/trunk/README.txt	2005-06-22 22:14:17 UTC (rev 30896)
+++ ldapadapter/trunk/README.txt	2005-06-23 13:18:23 UTC (rev 30897)
@@ -165,3 +165,31 @@
   Traceback (most recent call last):
   ...
   NoSuchObject: cn=foo,dc=test
+
+
+Checking the Connection
+=======================
+
+When first configuring a LDAP adapter, we often want to check the success of
+connecting to the LDAP server. This can be done with a check adapter:
+
+  >>> from ldapadapter import check
+  >>> check = check.CheckLDAPAdapter(da)
+
+This adapter has a ``testConnection()`` method that accepts a `bindDN` and
+`bindPassword` argument to establish the conection:
+
+  >>> check.testConnection('cn=Manager,dc=org', 'supersecret') \
+  ... # doctest: +ELLIPSIS
+  ['... start check connection', 
+   '... try connect with:', 
+   '... serverURL = ldap://localhost:389', 
+   '... bindDN = cn=Manager,dc=org', 
+   '... <strong>connection OK!</strong>', 
+   '... <strong><ldapadapter.utility.LDAPConnection object at ...></strong>']
+
+  >>> check.testConnection('cn=Bob', 'pretend')
+  ['... start check connection', 
+   '... try connect with:', 
+   '... serverURL = ldap://localhost:389', 
+   '... bindDN = cn=Bob', '... <strong>Test failed!</strong>']

Modified: ldapadapter/trunk/check.py
===================================================================
--- ldapadapter/trunk/check.py	2005-06-22 22:14:17 UTC (rev 30896)
+++ ldapadapter/trunk/check.py	2005-06-23 13:18:23 UTC (rev 30897)
@@ -17,6 +17,7 @@
 """
 import zope.interface
 from zope.interface import implements
+from zope.security.proxy import removeSecurityProxy
 
 from ldapadapter.interfaces import ICheckLDAPAdapter
 



More information about the Zope-CVS mailing list