Fix site preference openness problem

This commit is contained in:
Manson Wang 2013-10-07 14:36:52 +08:00
parent 940a915125
commit 831bd722b8
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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