summaryrefslogtreecommitdiffstats
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2022-03-19 09:56:46 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2022-03-19 09:56:46 +0000
commitf286a6044be49b88b067f89072618aecc7164caa (patch)
tree6359dfe601c787be72932e98a862f5b99e98d11f /app/controllers/application_controller.rb
parent65a91d13a0ef8a08f2cb118ea0bda716910db6a9 (diff)
downloadredmine-f286a6044be49b88b067f89072618aecc7164caa.tar.gz
redmine-f286a6044be49b88b067f89072618aecc7164caa.zip
Deprecate and rename rss_* methods to atom_* methods (#15118).
Patch by Mischa The Evil and Marius BÄ‚LTEANU git-svn-id: http://svn.redmine.org/redmine/trunk@21467 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb27
1 files changed, 19 insertions, 8 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index c287cc96a..5d2c9074e 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -33,7 +33,7 @@ class ApplicationController < ActionController::Base
helper :avatars
class_attribute :accept_api_auth_actions
- class_attribute :accept_rss_auth_actions
+ class_attribute :accept_atom_auth_actions
class_attribute :model_object
layout 'base'
@@ -120,9 +120,9 @@ class ApplicationController < ActionController::Base
end
elsif autologin_user = try_to_autologin
user = autologin_user
- elsif params[:format] == 'atom' && params[:key] && request.get? && accept_rss_auth?
- # RSS key authentication does not start a session
- user = User.find_by_rss_key(params[:key])
+ elsif params[:format] == 'atom' && params[:key] && request.get? && accept_atom_auth?
+ # ATOM key authentication does not start a session
+ user = User.find_by_atom_key(params[:key])
end
end
if user.nil? && Setting.rest_api_enabled? && accept_api_auth?
@@ -624,16 +624,27 @@ class ApplicationController < ActionController::Base
:content_type => 'application/atom+xml'
end
- def self.accept_rss_auth(*actions)
+ def self.accept_atom_auth(*actions)
if actions.any?
- self.accept_rss_auth_actions = actions
+ self.accept_atom_auth_actions = actions
else
- self.accept_rss_auth_actions || []
+ self.accept_atom_auth_actions || []
end
end
+ def self.accept_rss_auth(*actions)
+ ActiveSupport::Deprecation.warn "Application#self.accept_rss_auth is deprecated and will be removed in Redmine 6.0. Please use #self.accept_atom_auth instead."
+ self.class.accept_atom_auth(*actions)
+ end
+
+ def accept_atom_auth?(action=action_name)
+ self.class.accept_atom_auth.include?(action.to_sym)
+ end
+
+ # TODO: remove in Redmine 6.0
def accept_rss_auth?(action=action_name)
- self.class.accept_rss_auth.include?(action.to_sym)
+ ActiveSupport::Deprecation.warn "Application#accept_rss_auth? is deprecated and will be removed in Redmine 6.0. Please use #accept_atom_auth? instead."
+ accept_atom_auth?(action)
end
def self.accept_api_auth(*actions)