From 831bd722b854f376eebbcdeae86fff476372593a Mon Sep 17 00:00:00 2001 From: Manson Wang Date: Mon, 7 Oct 2013 14:36:52 +0800 Subject: [PATCH] Fix site preference openness problem --- app/controllers/application_controller.rb | 2 +- app/controllers/pages_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8e62edacc..55c0df12b 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -18,7 +18,7 @@ class ApplicationController < ActionController::Base helper_attr :site_valid_locales def check_backend_openness - if !Me.backend_openness_on + if Site.first.backend_openness_on redirect_to '/users/sign_in' if not (authenticate_user! and is_member? ) end end diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index a85c6548e..da6f4ac02 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -113,7 +113,7 @@ class PagesController < ApplicationController end def check_frontend_open - if Me.frontend_closed && current_user.nil? #Need to be change + if !Site.first.frontend_closed && current_user.nil? #Need to be change redirect_to '/admin/dashboards' end end