aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/webapp
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/webapp')
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb19
1 files changed, 14 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb
index fbe46141759..87f15af4a01 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb
@@ -25,13 +25,22 @@ class DashboardController < ApplicationController
before_filter :login_required, :except => [:index]
def index
- if params[:id] && !params[:did] && !params[:name]
- return redirect_to(url_for({:controller => 'overview'}) + '?id=' + url_encode(params[:id]))
- end
-
load_resource()
if !@resource || @resource.display_dashboard?
- redirect_if_bad_component()
+ if params[:id]
+ unless @resource
+ return project_not_found
+ end
+ unless @snapshot
+ return project_not_analyzed
+ end
+ end
+
+ # redirect to the project overview
+ if params[:id] && !params[:did] && !params[:name]
+ return redirect_to(url_for({:controller => 'overview'}) + '?id=' + url_encode(params[:id]))
+ end
+
load_dashboard()
load_authorized_widget_definitions()
else