Feature #1913 » Redmine-app-models-auth_source_ldap.diff
redmine/app/models/auth_source_ldap.rb 2008-09-16 12:44:04.000000000 +0000 | ||
---|---|---|
33 | 33 |
return nil if login.blank? || password.blank? |
34 | 34 |
attrs = [] |
35 | 35 |
# get user's DN |
36 |
ldap_con = initialize_ldap_con(self.account, self.account_password) |
|
36 |
if self.account.include? "$login" then |
|
37 |
logger.debug "LDAP-Auth with User login" |
|
38 |
ldap_con = initialize_ldap_con(self.account.sub("$login", login), password) |
|
39 |
else |
|
40 |
logger.debug "LDAP-Auth with Admin User" |
|
41 |
ldap_con = initialize_ldap_con(self.account, self.account_password) |
|
42 |
end |
|
37 | 43 |
login_filter = Net::LDAP::Filter.eq( self.attr_login, login ) |
38 | 44 |
object_filter = Net::LDAP::Filter.eq( "objectClass", "*" ) |
39 | 45 |
dn = String.new |