Coder Social home page Coder Social logo

Comments (1)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 25, 2024
Oops, additional bind was for testing.  This is the correct patch..

diff -u orig/ldap_ctxt.py new/ldap_ctxt.py
--- orig/ldap_ctxt.py   2008-06-24 20:53:52.000000000 -0400
+++ new/ldap_ctxt.py    2008-08-19 18:50:44.000000000 -0400
@@ -62,6 +62,7 @@
                   'ldap_base_dn': messages.MSG_LDAP_BASE_DN,
                   'ldap_timeout': messages.MSG_LDAP_TIMEOUT,
                   'ldap_page_size': messages.MSG_LDAP_PAGE_SIZE,
+                  'ldap_follow_referrals': messages.MSG_LDAP_FOLLOW_REFERRALS,
                   'tls_option': messages.MSG_TLS_OPTION,
                   'tls_cacertdir': messages.MSG_TLS_CACERTDIR,
                   'tls_cacertfile': messages.MSG_TLS_CACERTFILE}
@@ -80,6 +81,7 @@
     self.ldap_timeout = TIMEOUT_SECS
     self.ldap_url = None
     self.ldap_page_size = 0
+    self.ldap_follow_referrals = 'false'
     self.tls_option = 'never'
     self.tls_cacertdir = '/etc/ssl/certs'
     self.tls_cacertfile = ''
@@ -91,6 +93,10 @@
     self._required_config = ['ldap_url', 'ldap_user_filter', 'ldap_base_dn']
     self.config_changed = False
     self.conn = None
+    if self.ldap_follow_referrals == 'true':
+      ldap.set_option(ldap.OPT_REFERRALS, 1)
+    else:
+      ldap.set_option(ldap.OPT_REFERRALS, 0)
     if self.tls_option == 'demand':
       ldap.set_option(ldap.OPT_X_TLS, ldap.OPT_X_TLS_DEMAND)
     elif self.tls_option == 'allow':
diff -u orig/messages.py new/messages.py
--- orig/messages.py    2007-12-14 18:38:38.000000000 -0500
+++ new/messages.py     2008-08-19 18:44:38.000000000 -0400
@@ -157,6 +157,8 @@

 MSG_LDAP_URL = "URL for your LDAP server."

+MSG_LDAP_FOLLOW_REFERRALS = "Set to 'true' if LDAP referrals should be 
followed. 
Defaults to false"
+
 MSG_LDAP_PAGE_SIZE = """Some ldap servers (like Active Directory) will return 
 only a limited number of responses to a query and require the ldap client 
 to request more on subsequent requests.  If you have such a server, set this to

Original comment by [email protected] on 19 Aug 2008 at 10:51

from google-apps-for-your-domain-ldap-sync.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.