diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-04-25 17:17:49 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-04-25 17:17:49 +0000 |
commit | 5e57a1a9d9478162ac4f27ae96b2ccaf55a1aba7 (patch) | |
tree | 93e57765139714bd82dede475725516c448c0d55 /vendor/plugins/open_id_authentication/init.rb | |
parent | 34e20c4373b7f5a20ab3a132feae3f70f21ec477 (diff) | |
download | redmine-5e57a1a9d9478162ac4f27ae96b2ccaf55a1aba7.tar.gz redmine-5e57a1a9d9478162ac4f27ae96b2ccaf55a1aba7.zip |
Merged rails-3.2 branch.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9528 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'vendor/plugins/open_id_authentication/init.rb')
-rw-r--r-- | vendor/plugins/open_id_authentication/init.rb | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/vendor/plugins/open_id_authentication/init.rb b/vendor/plugins/open_id_authentication/init.rb index 2055ef700..84ec11fc4 100644 --- a/vendor/plugins/open_id_authentication/init.rb +++ b/vendor/plugins/open_id_authentication/init.rb @@ -1,16 +1,12 @@ -begin
- require 'openid'
-rescue LoadError
- begin
- gem 'ruby-openid', '>=2.1.4'
- rescue Gem::LoadError
- # no openid support
- end
-end
-
-if Object.const_defined?(:OpenID)
- config.to_prepare do
- OpenID::Util.logger = Rails.logger
- ActionController::Base.send :include, OpenIdAuthentication
- end
-end
+if Rails.version < '3' + config.gem 'rack-openid', :lib => 'rack/openid', :version => '>=0.2.1' +end + +require 'open_id_authentication' + +config.middleware.use OpenIdAuthentication + +config.after_initialize do + OpenID::Util.logger = Rails.logger + ActionController::Base.send :include, OpenIdAuthentication +end |