diff --git a/app/controllers/report_controller.rb b/app/controllers/report_controller.rb --- a/app/controllers/report_controller.rb +++ b/app/controllers/report_controller.rb @@ -1,18 +1,14 @@ class ReportController < ApplicationController before_filter :admin_authorization, only: [:login_stat,:submission_stat] - before_filter(only: :problem_hof) { |c| - user = User.find(session[:user_id]) if session[:user_id] - if user==nil - flash[:notice] = 'You have to login first' - redirect_to :controller => 'main', :action => 'login' - return false + before_filter { |c| + return false unless authenticate + + if GraderConfiguration["system.hall_of_fame_available"] + return true; end - - unless GraderConfiguration["hall_of_fame_available"] - flash[:notice] = 'You are not authorized to view the page you requested' - redirect_to :controller => 'main', :action => 'login' unless GraderConfiguration[ "hall_of_fame_available" ] - end + + admin_authorization } def login_stat