mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: new site setting show_inactive_accounts
This commit is contained in:
@@ -124,7 +124,7 @@ class ListController < ApplicationController
|
||||
|
||||
def topics_by
|
||||
list_opts = build_topic_list_options
|
||||
target_user = fetch_user_from_params({ include_inactive: current_user.try(:staff?) }, [:user_stat, :user_option])
|
||||
target_user = fetch_user_from_params({ include_inactive: current_user.try(:staff?) || (current_user && SiteSetting.show_inactive_accounts) }, [:user_stat, :user_option])
|
||||
list = generate_list_for("topics_by", target_user, list_opts)
|
||||
list.more_topics_url = url_for(construct_url_with(:next, list_opts))
|
||||
list.prev_topics_url = url_for(construct_url_with(:prev, list_opts))
|
||||
|
||||
@@ -6,7 +6,7 @@ class UserActionsController < ApplicationController
|
||||
|
||||
per_chunk = 30
|
||||
|
||||
user = fetch_user_from_params(include_inactive: current_user.try(:staff?))
|
||||
user = fetch_user_from_params(include_inactive: current_user.try(:staff?) || (current_user && SiteSetting.show_inactive_accounts))
|
||||
|
||||
opts = { user_id: user.id,
|
||||
user: user,
|
||||
|
||||
@@ -30,7 +30,7 @@ class UserBadgesController < ApplicationController
|
||||
def username
|
||||
params.permit [:grouped]
|
||||
|
||||
user = fetch_user_from_params
|
||||
user = fetch_user_from_params(include_inactive: current_user.try(:staff?) || (current_user && SiteSetting.show_inactive_accounts))
|
||||
user_badges = user.user_badges
|
||||
|
||||
if params[:grouped]
|
||||
|
||||
@@ -39,7 +39,7 @@ class UsersController < ApplicationController
|
||||
return redirect_to path('/login') if SiteSetting.hide_user_profiles_from_public && !current_user
|
||||
|
||||
@user = fetch_user_from_params(
|
||||
{ include_inactive: current_user.try(:staff?) },
|
||||
{ include_inactive: current_user.try(:staff?) || (current_user && SiteSetting.show_inactive_accounts) },
|
||||
[{ user_profile: :card_image_badge }]
|
||||
)
|
||||
|
||||
@@ -203,14 +203,14 @@ class UsersController < ApplicationController
|
||||
end
|
||||
|
||||
def summary
|
||||
user = fetch_user_from_params
|
||||
user = fetch_user_from_params(include_inactive: current_user.try(:staff?) || (current_user && SiteSetting.show_inactive_accounts))
|
||||
summary = UserSummary.new(user, guardian)
|
||||
serializer = UserSummarySerializer.new(summary, scope: guardian)
|
||||
render_json_dump(serializer)
|
||||
end
|
||||
|
||||
def invited
|
||||
inviter = fetch_user_from_params
|
||||
inviter = fetch_user_from_params(include_inactive: current_user.try(:staff?) || (current_user && SiteSetting.show_inactive_accounts))
|
||||
offset = params[:offset].to_i || 0
|
||||
filter_by = params[:filter]
|
||||
|
||||
@@ -226,7 +226,7 @@ class UsersController < ApplicationController
|
||||
end
|
||||
|
||||
def invited_count
|
||||
inviter = fetch_user_from_params
|
||||
inviter = fetch_user_from_params(include_inactive: current_user.try(:staff?) || (current_user && SiteSetting.show_inactive_accounts))
|
||||
|
||||
pending_count = Invite.find_pending_invites_count(inviter)
|
||||
redeemed_count = Invite.find_redeemed_invites_count(inviter)
|
||||
|
||||
Reference in New Issue
Block a user