diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-12-26 11:23:53 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-12-26 11:23:53 +0000 |
commit | 7b8ebb7e3ffc62e28396fadbd009216eb0e53c5f (patch) | |
tree | 43269790cccebe4e886064e897b9cb0d59edb31b /app/models/auth_source.rb | |
parent | eba4efc9d0ad6222818a32a5bac2190cef0d45b0 (diff) | |
download | redmine-7b8ebb7e3ffc62e28396fadbd009216eb0e53c5f.tar.gz redmine-7b8ebb7e3ffc62e28396fadbd009216eb0e53c5f.zip |
Auto-populate fields while creating a new user with LDAP (#10286).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11080 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/auth_source.rb')
-rw-r--r-- | app/models/auth_source.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/models/auth_source.rb b/app/models/auth_source.rb index 784415863..d7098d5cb 100644 --- a/app/models/auth_source.rb +++ b/app/models/auth_source.rb @@ -48,6 +48,24 @@ class AuthSource < ActiveRecord::Base write_ciphered_attribute(:account_password, arg) end + def searchable? + false + end + + def self.search(q) + results = [] + AuthSource.all.each do |source| + begin + if source.searchable? + results += source.search(q) + end + rescue AuthSourceException => e + logger.error "Error while searching users in #{source.name}: #{e.message}" + end + end + results + end + def allow_password_changes? self.class.allow_password_changes? end |