fronted open switch and backend openness
This commit is contained in:
1 parent
11067ef34f
commit
5ff7dfbac6
14 files changed
+56
-10
No files matched your search
@@ -5,8 +5,9 @@ class Admin::DashboardsController < OrbitBackendController
|
||||
# before_filter :is_admin?
|
||||
|
||||
def index
|
||||
@module_app_contents, @module_app_contents_total = get_module_app_count('bulletin', 'page_context', 'web_link')
|
||||
@recent_updated = get_recently_updated('bulletin', 'page_context', 'web_link')
|
||||
check_backend_openness
|
||||
@module_app_contents, @module_app_contents_total = get_module_app_count('bulletin', 'page_context', 'web_link')
|
||||
@recent_updated = get_recently_updated('bulletin', 'page_context', 'web_link')
|
||||
@most_visited = get_most_visited('bulletin', 'page_context')
|
||||
end
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ class Admin::SitesController < OrbitBackendController
|
||||
|
||||
def update
|
||||
@site.update_attributes(params[:site])
|
||||
site_restart
|
||||
redirect_to :back
|
||||
end
|
||||
|
||||
|
||||
@@ -17,7 +17,15 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
helper_attr :site_valid_locales
|
||||
|
||||
def check_backend_openness
|
||||
if !Me.backend_openness_on
|
||||
redirect_to '/users/sign_in' if not (authenticate_user! and is_member? )
|
||||
end
|
||||
end
|
||||
|
||||
def site_restart
|
||||
Resque.enqueue(RestartServer)
|
||||
end
|
||||
|
||||
def set_current_user
|
||||
User.current = current_or_guest_user
|
||||
|
||||
@@ -15,6 +15,7 @@ class OrbitBackendController < ApplicationController
|
||||
private
|
||||
|
||||
def force_order_for_visitor
|
||||
check_backend_openness
|
||||
setup_vars
|
||||
set_current_user
|
||||
end
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
class PagesController < ApplicationController
|
||||
include ApplicationHelper
|
||||
before_filter :get_item, :only => [:index_from_link, :show_from_link]
|
||||
before_filter :check_frontend_open, :only => [:index,:show]
|
||||
# caches_page :index
|
||||
|
||||
def check_frontend_open
|
||||
if Me.frontend_closed
|
||||
redirect_to '/admin/dashboards'
|
||||
end
|
||||
end
|
||||
|
||||
def index
|
||||
@item = Page.find_by_name('home')
|
||||
|
||||
|
||||
Reference in new issue
Block a user