]> source.dussan.org Git - sonarqube.git/commitdiff
Replace usage of verify :post by verify_post_request as it's using session 1211/head
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Thu, 8 Sep 2016 16:09:55 +0000 (18:09 +0200)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Fri, 9 Sep 2016 08:10:51 +0000 (10:10 +0200)
server/sonar-web/src/main/webapp/WEB-INF/app/controllers/encryption_configuration_controller.rb
server/sonar-web/src/main/webapp/WEB-INF/app/controllers/server_id_configuration_controller.rb

index 0f53cc2ba3de82d05e5e4b4321a193eeb03065bc..de0e69eade04f059800ff25579892a3a2269b988 100644 (file)
@@ -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'
index 4a9c047dfe59120ee5b7818dbf3ce086e531096c..8a1ff9442038bb7310807dbecb16a4c76e4e7558 100644 (file)
@@ -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