Add whitelist mode (#11291)
This commit is contained in:
parent
85b7b565de
commit
24552b5160
44 changed files with 302 additions and 53 deletions
|
@ -3,7 +3,8 @@
|
|||
class DirectoriesController < ApplicationController
|
||||
layout 'public'
|
||||
|
||||
before_action :check_enabled
|
||||
before_action :authenticate_user!, if: :whitelist_mode?
|
||||
before_action :require_enabled!
|
||||
before_action :set_instance_presenter
|
||||
before_action :set_tag, only: :show
|
||||
before_action :set_tags
|
||||
|
@ -19,7 +20,7 @@ class DirectoriesController < ApplicationController
|
|||
|
||||
private
|
||||
|
||||
def check_enabled
|
||||
def require_enabled!
|
||||
return not_found unless Setting.profile_directory
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue