aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/controllers/application_controller.rb2
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/controllers/components_controller.rb3
2 files changed, 3 insertions, 2 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/application_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/application_controller.rb
index 442f7ab237c..620279a51f8 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/application_controller.rb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/application_controller.rb
@@ -258,7 +258,7 @@ class ApplicationController < ActionController::Base
def init_resource_for_role(role, resource_param=:id)
@resource=Project.by_key(params[resource_param])
- unless @resource
+ unless @resource && @resource.enabled
flash[:error] = message('dashboard.project_not_found')
redirect_to :controller => :dashboard, :action => :index
else
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/components_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/components_controller.rb
index 760e569a86d..c3fabf78a0d 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/components_controller.rb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/components_controller.rb
@@ -19,12 +19,13 @@
#
class ComponentsController < ApplicationController
+ before_filter :init_resource_for_user_role
+
helper :metrics, :components
SECTION = Navigation::SECTION_RESOURCE
def index
- init_resource_for_user_role
@components_configuration = Sonar::ComponentsConfiguration.new
@snapshots = Snapshot.all(:include => 'project', :conditions => ['snapshots.parent_snapshot_id=?', @snapshot.id])