]> git.openstreetmap.org Git - rails.git/blob - vendor/plugins/open_id_authentication/lib/open_id_authentication/request.rb
merge 19889:20181 of rails_port into the openID branch
[rails.git] / vendor / plugins / open_id_authentication / lib / open_id_authentication / request.rb
1 module OpenIdAuthentication
2   module Request
3     def self.included(base)
4       base.alias_method_chain :request_method, :openid
5     end
6
7     def request_method_with_openid
8       if !parameters[:_method].blank? && parameters[:open_id_complete] == '1'
9         parameters[:_method].to_sym
10       else
11         request_method_without_openid
12       end
13     end
14   end
15 end
16
17 # In Rails 2.3, the request object has been renamed
18 # from AbstractRequest to Request
19 if defined? ActionController::Request
20   ActionController::Request.send :include, OpenIdAuthentication::Request
21 else
22   ActionController::AbstractRequest.send :include, OpenIdAuthentication::Request
23 end