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
This commit is contained in:
parent
7535c211d5
commit
308118ce97
|
@ -35,7 +35,8 @@ class AuthSourceLdap < AuthSource
|
||||||
dn = String.new
|
dn = String.new
|
||||||
ldap_con.search( :base => self.base_dn,
|
ldap_con.search( :base => self.base_dn,
|
||||||
:filter => object_filter & login_filter,
|
: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
|
dn = entry.dn
|
||||||
attrs = [:firstname => AuthSourceLdap.get_attr(entry, self.attr_firstname),
|
attrs = [:firstname => AuthSourceLdap.get_attr(entry, self.attr_firstname),
|
||||||
:lastname => AuthSourceLdap.get_attr(entry, self.attr_lastname),
|
:lastname => AuthSourceLdap.get_attr(entry, self.attr_lastname),
|
||||||
|
|
Loading…
Reference in New Issue