mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 09:08:10 +08:00
Remove unusued site_settings, show checkbox in UI for boolean values, remove restrict_access
boolean to avoid locking yourself out by setting access_password to empty string. Minor UI tweaks.
This commit is contained in:
@ -146,7 +146,7 @@ class ApplicationController < ActionController::Base
|
||||
return false if current_user.present?
|
||||
|
||||
# Don't cache if there's restricted access
|
||||
return false if SiteSetting.restrict_access?
|
||||
return false if SiteSetting.access_password.present?
|
||||
|
||||
true
|
||||
end
|
||||
@ -216,7 +216,7 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
def check_restricted_access
|
||||
# note current_user is defined in the CurrentUser mixin
|
||||
if SiteSetting.restrict_access? && cookies[:_access] != SiteSetting.access_password
|
||||
if SiteSetting.access_password.present? && cookies[:_access] != SiteSetting.access_password
|
||||
redirect_to request_access_path(:return_path => request.fullpath)
|
||||
return false
|
||||
end
|
||||
|
@ -15,7 +15,7 @@ class InvitesController < ApplicationController
|
||||
user.enqueue_welcome_message('welcome_invite') if user.send_welcome_message
|
||||
|
||||
# We skip the access password if we come in via an invite link
|
||||
cookies.permanent['_access'] = SiteSetting.access_password if SiteSetting.restrict_access?
|
||||
cookies.permanent['_access'] = SiteSetting.access_password if SiteSetting.access_password.present?
|
||||
|
||||
topic = invite.topics.first
|
||||
if topic.present?
|
||||
|
@ -4,7 +4,7 @@ class RobotsTxtController < ApplicationController
|
||||
skip_before_filter :check_restricted_access
|
||||
|
||||
def index
|
||||
path = if SiteSetting.allow_index_in_robots_txt && !SiteSetting.restrict_access
|
||||
path = if SiteSetting.allow_index_in_robots_txt && SiteSetting.access_password.blank?
|
||||
:index
|
||||
else
|
||||
:no_index
|
||||
|
Reference in New Issue
Block a user