Revision 882
Added by Jean-Philippe Lang over 17 years ago
trunk/app/models/auth_source_ldap.rb | ||
---|---|---|
35 | 35 |
dn = String.new |
36 | 36 |
ldap_con.search( :base => self.base_dn, |
37 | 37 |
:filter => object_filter & login_filter, |
38 |
:attributes=> ['dn', self.attr_firstname, self.attr_lastname, self.attr_mail]) do |entry| |
|
38 |
# only ask for the DN if on-the-fly registration is disabled |
|
39 |
:attributes=> (onthefly_register? ? ['dn', self.attr_firstname, self.attr_lastname, self.attr_mail] : ['dn'])) do |entry| |
|
39 | 40 |
dn = entry.dn |
40 | 41 |
attrs = [:firstname => AuthSourceLdap.get_attr(entry, self.attr_firstname), |
41 | 42 |
:lastname => AuthSourceLdap.get_attr(entry, self.attr_lastname), |
Also available in: Unified diff
LDAP authentication: only ask for the user's DN if on-the-fly registration is disabled