Attachment 'ldap_auth.diff'

Download

   1 --- auth.py.org	2007-08-08 14:24:01.000000000 -0600
   2 +++ MoinMoin/auth.py	2007-08-08 14:33:36.000000000 -0600
   3 @@ -425,8 +425,11 @@
   4              l.simple_bind_s(dn, password.encode(coding))
   5              if verbose: request.log("LDAP: Bound with dn %s (username: %s)" % (dn, username))
   6  
   7 -            email = ldap_dict.get(cfg.ldap_email_attribute, [''])[0]
   8 -            email = email.decode(coding)
   9 +            if cfg.ldap_email_attribute:
  10 +                email = ldap_dict.get(cfg.ldap_email_attribute, [''])[0]
  11 +                email = email.decode(coding)
  12 +            else:
  13 +                email = None
  14  
  15              aliasname = ''
  16              try:
  17 @@ -442,10 +445,13 @@
  18                      aliasname = sn
  19              aliasname = aliasname.decode(coding)
  20  
  21 -            u = user.User(request, auth_username=username, password=password, auth_method='ldap', auth_attribs=('name', 'password', 'email', 'mailto_author',))
  22 +            if email:
  23 +                u = user.User(request, auth_username=username, password=password, auth_method='ldap', auth_attribs=('name', 'password', 'email', 'mailto_author',))
  24 +                u.email = email
  25 +            else:
  26 +                u = user.User(request, auth_username=username, password=password, auth_method='ldap', auth_attribs=('name', 'password', 'mailto_author',))
  27              u.name = username
  28              u.aliasname = aliasname
  29 -            u.email = email
  30              u.remember_me = 0 # 0 enforces cookie_lifetime config param
  31              if verbose: request.log("LDAP: creating userprefs with name %s email %s alias %s" % (username, email, aliasname))
  32  

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2007-08-08 20:42:09, 1.6 KB) [[attachment:ldap_auth.diff]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.