From 801b5838e12498c7ce8d28139841d06e6c921ab4 Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Wed, 8 Mar 2017 16:00:49 +0530 Subject: [PATCH] FIX: do not show faq/guidelines page to anonymous users for private forums --- app/controllers/static_controller.rb | 1 + app/views/static/show.html.erb | 12 ++++---- spec/controllers/static_controller_spec.rb | 32 ++++++++++++++++++++++ 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/app/controllers/static_controller.rb b/app/controllers/static_controller.rb index 90e8b498594..e91bda504c4 100644 --- a/app/controllers/static_controller.rb +++ b/app/controllers/static_controller.rb @@ -10,6 +10,7 @@ class StaticController < ApplicationController def show return redirect_to(path '/') if current_user && (params[:id] == 'login' || params[:id] == 'signup') + return redirect_to path('/login') if SiteSetting.login_required? && current_user.nil? && (params[:id] == 'faq' || params[:id] == 'guidelines') map = { "faq" => {redirect: "faq_url", topic_id: "guidelines_topic_id"}, diff --git a/app/views/static/show.html.erb b/app/views/static/show.html.erb index c941961795e..ba7592c9597 100644 --- a/app/views/static/show.html.erb +++ b/app/views/static/show.html.erb @@ -3,12 +3,12 @@