[Zope-CVS] SVN: ldapadapter/trunk/utility.py If no dn is provided on connect, use the default bind dn an password.

Florent Guillaume fg at nuxeo.com
Sun Oct 10 09:14:51 EDT 2004


Log message for revision 27899:
  If no dn is provided on connect, use the default bind dn an password.
  


Changed:
  U   ldapadapter/trunk/utility.py


-=-
Modified: ldapadapter/trunk/utility.py
===================================================================
--- ldapadapter/trunk/utility.py	2004-10-10 13:06:07 UTC (rev 27898)
+++ ldapadapter/trunk/utility.py	2004-10-10 13:14:50 UTC (rev 27899)
@@ -62,7 +62,7 @@
         self.bindPassword = bindPassword
         self.useSSL = useSSL
 
-    def connect(self, dn, password=None):
+    def connect(self, dn=None, password=None):
         proto = self.useSSL and 'ldaps' or 'ldap'
         conn_str = '%s://%s:%s/' % (proto, self.host, self.port)
         conn = ldap.initialize(conn_str)
@@ -75,8 +75,9 @@
         # TODO: conn.set_option(OPT_REFERRALS, 1)
 
         # Bind the connection to the dn
-        if not dn:
+        if dn is None:
             dn = self.bindDN
+            password = self.bindPassword
         conn.simple_bind_s(dn, password)
         # May raise INVALID_CREDENTIALS, SERVER_DOWN, ...
         



More information about the Zope-CVS mailing list