From aec72f69cd8f318fb1ee1d7921ad629353b11c80 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Thu, 8 Sep 2016 18:09:55 +0200 Subject: [PATCH] Replace usage of verify :post by verify_post_request as it's using session --- .../app/controllers/encryption_configuration_controller.rb | 4 ++-- .../app/controllers/server_id_configuration_controller.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/encryption_configuration_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/encryption_configuration_controller.rb index 0f53cc2ba3d..de0e69eade0 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/encryption_configuration_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/encryption_configuration_controller.rb @@ -23,8 +23,6 @@ class EncryptionConfigurationController < ApplicationController before_filter :admin_required before_filter :remove_layout - verify :method => :post, :only => [:generate_secret, :encrypt], :redirect_to => {:action => :index} - def index if java_facade.hasSecretKey() render :action => 'index' @@ -38,11 +36,13 @@ class EncryptionConfigurationController < ApplicationController end def generate_secret + verify_post_request @secret = java_facade.generateRandomSecretKey() render :partial => 'encryption_configuration/generate_secret_key' end def encrypt + verify_post_request bad_request('No secret key') unless java_facade.hasSecretKey() @encrypted = java_facade.encrypt(params[:text]) render :partial => 'encryption_configuration/encrypt' diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/server_id_configuration_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/server_id_configuration_controller.rb index 4a9c047dfe5..8a1ff944203 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/server_id_configuration_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/server_id_configuration_controller.rb @@ -25,7 +25,6 @@ class ServerIdConfigurationController < ApplicationController PROPERTY_ORGANISATION = 'sonar.organisation' before_filter :admin_required - verify :method => :post, :only => [:generate], :redirect_to => {:action => :index} def index @server_id = Property.value(PROPERTY_SERVER_ID) @@ -42,6 +41,7 @@ class ServerIdConfigurationController < ApplicationController end def generate + verify_post_request organisation = params[:organisation].strip Property.set(PROPERTY_ORGANISATION, organisation) ip_address=params[:address].strip -- 2.39.5