From 1f3f9831add4973fbb077d23360bf520cfae7a95 Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Mon, 4 Nov 2013 15:41:23 +0800 Subject: [PATCH] Fixed Openness Issue --- app/controllers/application_controller.rb | 2 +- app/controllers/pages_controller.rb | 2 +- app/views/layouts/_left_menu.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b959d85c9..442980438 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 Site.first.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 0accef0b4..fab2acefb 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -130,7 +130,7 @@ class PagesController < ApplicationController end def check_frontend_open - if Site.first.frontend_open && current_user.nil? #Need to be change + if !Site.first.frontend_open && current_user.nil? #Need to be change redirect_to '/admin/dashboards' end end diff --git a/app/views/layouts/_left_menu.html.erb b/app/views/layouts/_left_menu.html.erb index 3117786c0..6e6184479 100644 --- a/app/views/layouts/_left_menu.html.erb +++ b/app/views/layouts/_left_menu.html.erb @@ -21,7 +21,7 @@ - <% if !@site.desktop_closed%> + <% if @site.desktop_closed%>
  • <%= t(:desktop) %>