mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 01:16:38 -06:00
UX: Display lock icon in admin user lists when user has 2FA enabled.
This commit is contained in:
parent
edf326a9a5
commit
1b04d881c5
@ -98,6 +98,10 @@
|
||||
{{#if user.moderator}}
|
||||
{{d-icon "shield" title="admin.moderator" }}
|
||||
{{/if}}
|
||||
|
||||
{{#if user.second_factor_enabled}}
|
||||
{{d-icon "lock" title="admin.user.second_factor_enabled" }}
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
|
@ -25,7 +25,8 @@ class AdminUserListSerializer < BasicUserSerializer
|
||||
:silenced,
|
||||
:silenced_till,
|
||||
:time_read,
|
||||
:staged
|
||||
:staged,
|
||||
:second_factor_enabled
|
||||
|
||||
[:days_visited, :posts_read_count, :topics_entered, :post_count].each do |sym|
|
||||
attributes sym
|
||||
@ -115,4 +116,12 @@ class AdminUserListSerializer < BasicUserSerializer
|
||||
SiteSetting.must_approve_users
|
||||
end
|
||||
|
||||
def include_second_factor_enabled?
|
||||
object.totp_enabled?
|
||||
end
|
||||
|
||||
def second_factor_enabled
|
||||
true
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -3471,6 +3471,7 @@ en:
|
||||
private_topics_count: Private Topics
|
||||
posts_read_count: Posts Read
|
||||
post_count: Posts Created
|
||||
second_factor_enabled: Two Factor Authentication Enabled
|
||||
topics_entered: Topics Viewed
|
||||
flags_given_count: Flags Given
|
||||
flags_received_count: Flags Received
|
||||
|
@ -63,7 +63,7 @@ class AdminUserIndexQuery
|
||||
if params[:stats].present? && params[:stats] == false
|
||||
klass.order(order.reject(&:blank?).join(","))
|
||||
else
|
||||
klass.includes(:user_stat).order(order.reject(&:blank?).join(","))
|
||||
klass.includes(:user_stat, :user_second_factor).order(order.reject(&:blank?).join(","))
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user