summaryrefslogtreecommitdiffstats
path: root/app/models/auth_source.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-26 11:23:53 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-26 11:23:53 +0000
commit7b8ebb7e3ffc62e28396fadbd009216eb0e53c5f (patch)
tree43269790cccebe4e886064e897b9cb0d59edb31b /app/models/auth_source.rb
parenteba4efc9d0ad6222818a32a5bac2190cef0d45b0 (diff)
downloadredmine-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.rb18
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