]> source.dussan.org Git - redmine.git/commitdiff
Fixed: LDAP authentication crashes if one of the LDAP attributes name is left blank...
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 19 Oct 2007 19:36:42 +0000 (19:36 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 19 Oct 2007 19:36:42 +0000 (19:36 +0000)
When not checking "On-the-fly" register, the 3 optional fields can now be safely left blank.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@854 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/auth_source_ldap.rb

index c8b0a12c98936ea28279ca4263be67a09dd83ab4..2433c96b1b0dcce67bd212e8b6d460b0f6e9c06e 100644 (file)
@@ -40,7 +40,7 @@ class AuthSourceLdap < AuthSource
       attrs = [:firstname => AuthSourceLdap.get_attr(entry, self.attr_firstname),
                :lastname => AuthSourceLdap.get_attr(entry, self.attr_lastname),
                :mail => AuthSourceLdap.get_attr(entry, self.attr_mail),
-               :auth_source_id => self.id ]
+               :auth_source_id => self.id ] if onthefly_register?
     end
     return nil if dn.empty?
     logger.debug "DN found for #{login}: #{dn}" if logger && logger.debug?