]> source.dussan.org Git - sonarqube.git/commitdiff
Do not show crappy error page if url /plugins/* has bad parameters
authorSimon Brandhof <simon.brandhof@gmail.com>
Fri, 12 Aug 2011 10:08:33 +0000 (12:08 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Fri, 12 Aug 2011 10:08:33 +0000 (12:08 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/plugins/configuration_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/controllers/plugins/home_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/controllers/plugins/resource_controller.rb

index f5ea76a519d5dab5b2c6ca73c9e8ce06856cc4ff..5160ea28c8f21ed576788a27084972b433aa71b6 100644 (file)
@@ -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|
index 59ce20ce328b9536bf66e9ca29658bdb83174994..8f53a48b20860b6f12090a0ecbaf59213b40e33e 100644 (file)
@@ -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|
index 5db6657cebdb132adc970df683652524c9adbbc1..b8967a29821495326e691201387dad39e82f883a 100644 (file)
@@ -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