changeset 4932:4c142c453f11

merge main
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 30 Jul 2009 21:02:07 +0200
parents de0f87166f1c (current diff) 43c468a525ef (diff)
children c8be59640927
files
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/auth/ldap_login.py	Thu Jul 30 21:01:46 2009 +0200
+++ b/MoinMoin/auth/ldap_login.py	Thu Jul 30 21:02:07 2009 +0200
@@ -83,6 +83,7 @@
         tls_require_cert=0, # 0 == ldap.OPT_X_TLS_NEVER (needed for self-signed certs)
         bind_once=False, # set to True to only do one bind - useful if configured to bind as the user on the first attempt
         autocreate=False, # set to True if you want to autocreate user profiles
+        name='ldap', # use e.g. 'ldap_pdc' and 'ldap_bdc' (or 'ldap1' and 'ldap2') if you auth against 2 ldap servers
         ):
         self.server_uri = server_uri
         self.bind_dn = bind_dn
@@ -111,6 +112,7 @@
 
         self.bind_once = bind_once
         self.autocreate = autocreate
+        self.name = name
 
     def login(self, request, user_obj, **kw):
         username = kw.get('username')
@@ -231,13 +233,14 @@
                 u.name = username
                 u.aliasname = aliasname
                 u.remember_me = 0 # 0 enforces cookie_lifetime config param
-                logging.debug("creating userprefs with name %r email %r alias %r" % (username, email, aliasname))
+                logging.debug("creating user object with name %r email %r alias %r" % (username, email, aliasname))
 
             except ldap.INVALID_CREDENTIALS, err:
                 logging.debug("invalid credentials (wrong password?) for dn %r (username: %r)" % (dn, username))
                 return CancelLogin(_("Invalid username or password."))
 
             if u and self.autocreate:
+                logging.debug("calling create_or_update to autocreate user %r" % u.name)
                 u.create_or_update(True)
             return ContinueLogin(u)