debian-mirror-gitlab/app/views/admin/users/show.html.haml

262 lines
9.5 KiB
Text
Raw Normal View History

2018-03-17 18:26:18 +05:30
- add_to_breadcrumbs "Users", admin_users_path
- breadcrumb_title @user.name
2015-09-11 14:41:01 +05:30
- page_title @user.name, "Users"
= render 'admin/users/head'
.row
.col-md-6
2018-11-08 19:23:39 +05:30
.card
.card-header
2015-09-11 14:41:01 +05:30
= @user.name
2018-11-08 19:23:39 +05:30
%ul.content-list
2015-09-11 14:41:01 +05:30
%li
2018-03-27 19:54:05 +05:30
= image_tag avatar_icon_for_user(@user, 60), class: "avatar s60"
2015-09-11 14:41:01 +05:30
%li
%span.light Profile page:
%strong
= link_to user_path(@user) do
= @user.username
2015-11-26 14:37:03 +05:30
= render 'admin/users/profile', user: @user
2015-09-11 14:41:01 +05:30
2018-11-08 19:23:39 +05:30
.card
.card-header
2015-09-11 14:41:01 +05:30
Account:
2018-11-08 19:23:39 +05:30
%ul.content-list
2015-09-11 14:41:01 +05:30
%li
%span.light Name:
%strong= @user.name
%li
%span.light Username:
%strong
= @user.username
%li
%span.light Email:
%strong
2019-09-30 21:07:59 +05:30
= render partial: 'shared/email_with_badge', locals: { email: mail_to(@user.email), verified: @user.confirmed? }
2015-09-11 14:41:01 +05:30
- @user.emails.each do |email|
%li
%span.light Secondary email:
2019-09-30 21:07:59 +05:30
%strong
= render partial: 'shared/email_with_badge', locals: { email: email.email, verified: email.confirmed? }
2018-11-08 19:23:39 +05:30
= link_to remove_email_admin_user_path(@user, email), data: { confirm: "Are you sure you want to remove #{email.email}?" }, method: :delete, class: "btn-sm btn btn-remove float-right", title: 'Remove secondary email', id: "remove_email_#{email.id}" do
2015-09-11 14:41:01 +05:30
%i.fa.fa-times
2018-11-20 20:47:30 +05:30
%li
%span.light ID:
%strong
= @user.id
2015-09-11 14:41:01 +05:30
%li.two-factor-status
%span.light Two-factor Authentication:
2017-08-17 22:00:37 +05:30
%strong{ class: @user.two_factor_enabled? ? 'cgreen' : 'cred' }
2015-09-11 14:41:01 +05:30
- if @user.two_factor_enabled?
Enabled
2018-11-08 19:23:39 +05:30
= link_to 'Disable', disable_two_factor_admin_user_path(@user), data: {confirm: 'Are you sure?'}, method: :patch, class: 'btn btn-sm btn-remove float-right', title: 'Disable Two-factor Authentication'
2014-09-02 18:07:02 +05:30
- else
2015-09-11 14:41:01 +05:30
Disabled
2019-07-31 22:56:46 +05:30
= render_if_exists 'admin/namespace_plan_info', namespace: @user.namespace
2016-06-02 11:05:42 +05:30
%li
%span.light External User:
%strong
= @user.external? ? "Yes" : "No"
2015-09-11 14:41:01 +05:30
%li
%span.light Can create groups:
%strong
= @user.can_create_group ? "Yes" : "No"
%li
%span.light Personal projects limit:
%strong
= @user.projects_limit
%li
%span.light Member since:
%strong
= @user.created_at.to_s(:medium)
2015-09-11 14:41:01 +05:30
- if @user.confirmed_at
%li
%span.light Confirmed at:
%strong
= @user.confirmed_at.to_s(:medium)
2015-09-11 14:41:01 +05:30
- else
%li
%span.light Confirmed:
%strong.cred
No
%li
%span.light Current sign-in IP:
%strong
2020-06-23 00:09:42 +05:30
- if @user.current_sign_in_ip # rubocop:disable Style/RedundantCondition
= @user.current_sign_in_ip
- else
never
2015-09-11 14:41:01 +05:30
%li
%span.light Current sign-in at:
%strong
- if @user.current_sign_in_at
= @user.current_sign_in_at.to_s(:medium)
- else
never
%li
%span.light Last sign-in IP:
%strong
2020-06-23 00:09:42 +05:30
- if @user.last_sign_in_ip # rubocop:disable Style/RedundantCondition
= @user.last_sign_in_ip
2015-09-11 14:41:01 +05:30
- else
never
2014-09-02 18:07:02 +05:30
2015-09-11 14:41:01 +05:30
%li
%span.light Last sign-in at:
%strong
- if @user.last_sign_in_at
= @user.last_sign_in_at.to_s(:medium)
2015-09-11 14:41:01 +05:30
- else
never
%li
%span.light Sign-in count:
%strong
= @user.sign_in_count
2019-07-07 11:18:12 +05:30
%li
%span.light= _("Highest role:")
%strong
= Gitlab::Access.human_access_with_none(@user.highest_role)
2019-09-04 21:01:54 +05:30
= render_if_exists 'admin/users/using_license_seat', user: @user
2015-09-11 14:41:01 +05:30
- if @user.ldap_user?
%li
%span.light LDAP uid:
%strong
= @user.ldap_identity.extern_uid
- if @user.created_by
%li
%span.light Created by:
%strong
= link_to @user.created_by.name, [:admin, @user.created_by]
2019-09-30 21:07:59 +05:30
= render_if_exists 'namespaces/shared_runner_status', namespace: @user.namespace
2019-07-31 22:56:46 +05:30
2020-06-23 00:09:42 +05:30
= render 'shared/custom_attributes', custom_attributes: @user.custom_attributes
2015-09-11 14:41:01 +05:30
.col-md-6
- unless @user == current_user
- unless @user.confirmed?
2018-11-20 20:47:30 +05:30
.card.border-info
.card-header.bg-info.text-white
2015-09-11 14:41:01 +05:30
Confirm user
2018-11-08 19:23:39 +05:30
.card-body
2015-09-11 14:41:01 +05:30
- if @user.unconfirmed_email.present?
- email = " (#{@user.unconfirmed_email})"
%p This user has an unconfirmed email address#{email}. You may force a confirmation.
%br
2019-12-26 22:10:19 +05:30
= link_to 'Confirm user', confirm_admin_user_path(@user), method: :put, class: "btn btn-info", data: { confirm: 'Are you sure?', qa_selector: 'confirm_user_button' }
2019-07-31 22:56:46 +05:30
2020-06-23 00:09:42 +05:30
= render 'admin/users/user_detail_note'
2019-07-31 22:56:46 +05:30
2019-12-21 20:55:43 +05:30
- if @user.deactivated?
.card.border-info
.card-header.bg-info.text-white
Reactivate this user
.card-body
= render partial: 'admin/users/user_activation_effects'
%br
= link_to 'Activate user', activate_admin_user_path(@user), method: :put, class: "btn btn-info", data: { confirm: 'Are you sure?' }
- elsif @user.can_be_deactivated?
.card.border-warning
.card-header.bg-warning.text-white
Deactivate this user
.card-body
= render partial: 'admin/users/user_deactivation_effects'
%br
%button.btn.btn-warning{ data: { 'gl-modal-action': 'deactivate',
content: 'You can always re-activate their account, their data will remain intact.',
url: deactivate_admin_user_path(@user),
username: sanitize_name(@user.name) } }
= s_('AdminUsers|Deactivate user')
2015-09-11 14:41:01 +05:30
- if @user.blocked?
2018-11-20 20:47:30 +05:30
.card.border-info
.card-header.bg-info.text-white
2015-09-11 14:41:01 +05:30
This user is blocked
2018-11-08 19:23:39 +05:30
.card-body
2016-09-13 17:45:13 +05:30
%p A blocked user cannot:
2015-09-11 14:41:01 +05:30
%ul
2016-09-13 17:45:13 +05:30
%li Log in
%li Access Git repositories
2015-09-11 14:41:01 +05:30
%br
= link_to 'Unblock user', unblock_admin_user_path(@user), method: :put, class: "btn btn-info", data: { confirm: 'Are you sure?' }
- else
2018-11-18 11:00:15 +05:30
.card.border-warning
.card-header.bg-warning.text-white
2015-09-11 14:41:01 +05:30
Block this user
2018-11-08 19:23:39 +05:30
.card-body
2019-12-21 20:55:43 +05:30
= render partial: 'admin/users/user_block_effects'
2015-09-11 14:41:01 +05:30
%br
2019-12-21 20:55:43 +05:30
%button.btn.btn-warning{ data: { 'gl-modal-action': 'block',
content: 'You can always unblock their account, their data will remain intact.',
url: block_admin_user_path(@user),
username: sanitize_name(@user.name) } }
= s_('AdminUsers|Block user')
2015-09-11 14:41:01 +05:30
- if @user.access_locked?
2018-11-20 20:47:30 +05:30
.card.border-info
.card-header.bg-info.text-white
2015-09-11 14:41:01 +05:30
This account has been locked
2018-11-08 19:23:39 +05:30
.card-body
2015-09-11 14:41:01 +05:30
%p This user has been temporarily locked due to excessive number of failed logins. You may manually unlock the account.
%br
= link_to 'Unlock user', unlock_admin_user_path(@user), method: :put, class: "btn btn-info", data: { confirm: 'Are you sure?' }
2018-11-18 11:00:15 +05:30
.card.border-danger
.card-header.bg-danger.text-white
2018-03-17 18:26:18 +05:30
= s_('AdminUsers|Delete user')
2018-11-08 19:23:39 +05:30
.card-body
2017-08-17 22:00:37 +05:30
- if @user.can_be_removed? && can?(current_user, :destroy_user, @user)
2015-09-11 14:41:01 +05:30
%p Deleting a user has the following effects:
2017-08-17 22:00:37 +05:30
= render 'users/deletion_guidance', user: @user
2015-09-11 14:41:01 +05:30
%br
2019-12-21 20:55:43 +05:30
%button.delete-user-button.btn.btn-danger{ data: { 'gl-modal-action': 'delete',
2018-03-17 18:26:18 +05:30
delete_user_url: admin_user_path(@user),
block_user_url: block_admin_user_path(@user),
2019-12-21 20:55:43 +05:30
username: sanitize_name(@user.name) } }
2018-03-17 18:26:18 +05:30
= s_('AdminUsers|Delete user')
2015-09-11 14:41:01 +05:30
- else
- if @user.solo_owned_groups.present?
%p
This user is currently an owner in these groups:
2017-08-17 22:00:37 +05:30
%strong= @user.solo_owned_groups.map(&:name).join(', ')
2015-09-11 14:41:01 +05:30
%p
You must transfer ownership or delete these groups before you can delete this user.
2017-08-17 22:00:37 +05:30
- else
%p
You don't have access to delete this user.
2017-09-10 17:25:29 +05:30
2018-11-18 11:00:15 +05:30
.card.border-danger
.card-header.bg-danger.text-white
2018-03-17 18:26:18 +05:30
= s_('AdminUsers|Delete user and contributions')
2018-11-08 19:23:39 +05:30
.card-body
2017-09-10 17:25:29 +05:30
- if can?(current_user, :destroy_user, @user)
%p
This option deletes the user and any contributions that
would usually be moved to the
= succeed "." do
= link_to "system ghost user", help_page_path("user/profile/account/delete_account")
As well as the user's personal projects, groups owned solely by
the user, and projects in them, will also be removed. Commits
to other projects are unaffected.
%br
2019-12-21 20:55:43 +05:30
%button.delete-user-button.btn.btn-danger{ data: { 'gl-modal-action': 'delete-with-contributions',
2018-03-17 18:26:18 +05:30
delete_user_url: admin_user_path(@user, hard_delete: true),
block_user_url: block_admin_user_path(@user),
2019-12-21 20:55:43 +05:30
username: @user.name } }
2018-03-17 18:26:18 +05:30
= s_('AdminUsers|Delete user and contributions')
2017-09-10 17:25:29 +05:30
- else
%p
You don't have access to delete this user.
2018-03-17 18:26:18 +05:30
2019-12-21 20:55:43 +05:30
= render partial: 'admin/users/modals'