From: Simon Brandhof Date: Fri, 12 Aug 2011 10:08:33 +0000 (+0200) Subject: Do not show crappy error page if url /plugins/* has bad parameters X-Git-Tag: 2.11^2~165 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2b79a7c204edc49f4635aff7471f384307a1f6d9;p=sonarqube.git Do not show crappy error page if url /plugins/* has bad parameters --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/plugins/configuration_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/plugins/configuration_controller.rb index f5ea76a519d..5160ea28c8f 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/plugins/configuration_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/plugins/configuration_controller.rb @@ -25,6 +25,8 @@ class Plugins::ConfigurationController < ApplicationController page_id=params[:page] @page_proxy=java_facade.getPage(page_id) + return redirect_to(home_path) unless @page_proxy + authorized=@page_proxy.getUserRoles().size==0 unless authorized @page_proxy.getUserRoles().each do |role| diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/plugins/home_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/plugins/home_controller.rb index 59ce20ce328..8f53a48b208 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/plugins/home_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/plugins/home_controller.rb @@ -25,6 +25,7 @@ class Plugins::HomeController < ApplicationController page_id=params[:page] @page_proxy=java_facade.getPage(page_id) + return redirect_to(home_path) unless @page_proxy authorized=@page_proxy.getUserRoles().size==0 unless authorized @page_proxy.getUserRoles().each do |role| diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/plugins/resource_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/plugins/resource_controller.rb index 5db6657cebd..b8967a29821 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/plugins/resource_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/plugins/resource_controller.rb @@ -31,7 +31,7 @@ class Plugins::ResourceController < ApplicationController page_id=params[:page] @page_proxy=java_facade.getPage(page_id) - return redirect_to home_url if @page_proxy.nil? + return redirect_to(home_path) unless @page_proxy authorized=@page_proxy.getUserRoles().size==0 unless authorized