summaryrefslogtreecommitdiffstats
path: root/app/models/auth_source_ldap.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-04 11:49:03 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-11-04 11:49:03 +0000
commit308118ce9724bdbea9dcb8ddf766e81b76a2d2df (patch)
tree6d33bdbdb86d58cb521350a72c2355a60f166f12 /app/models/auth_source_ldap.rb
parent7535c211d5e660a7a65ee91e33f14881027836a7 (diff)
downloadredmine-308118ce9724bdbea9dcb8ddf766e81b76a2d2df.tar.gz
redmine-308118ce9724bdbea9dcb8ddf766e81b76a2d2df.zip
LDAP authentication: only ask for the user's DN if on-the-fly registration is disabled
git-svn-id: http://redmine.rubyforge.org/svn/trunk@882 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/auth_source_ldap.rb')
-rw-r--r--app/models/auth_source_ldap.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/auth_source_ldap.rb b/app/models/auth_source_ldap.rb
index 2433c96b1..b79b3ced0 100644
--- a/app/models/auth_source_ldap.rb
+++ b/app/models/auth_source_ldap.rb
@@ -35,7 +35,8 @@ class AuthSourceLdap < AuthSource
dn = String.new
ldap_con.search( :base => self.base_dn,
:filter => object_filter & login_filter,
- :attributes=> ['dn', self.attr_firstname, self.attr_lastname, self.attr_mail]) do |entry|
+ # only ask for the DN if on-the-fly registration is disabled
+ :attributes=> (onthefly_register? ? ['dn', self.attr_firstname, self.attr_lastname, self.attr_mail] : ['dn'])) do |entry|
dn = entry.dn
attrs = [:firstname => AuthSourceLdap.get_attr(entry, self.attr_firstname),
:lastname => AuthSourceLdap.get_attr(entry, self.attr_lastname),