<%= @user.name %><%= link_to "@#{@user.username}", @user.path, class: "ml-2", target: "_blank", rel: "noopener" %>

<% if @user.access_locked? %>
<%= link_to "Unlock access", unlock_access_admin_user_path(@user), method: :patch, class: "btn btn-success" %>
<% end %> Admin Profile

Member since <%= @user.created_at.strftime("%b %e '%y") %>

<%= render "activity" %> <%= render "current_roles" %>

User Status <% if @user.suspended? %> 🚨 Member is Suspended 🚨 <% elsif @user.warned %> Member is Warned <% elsif @user.comment_suspended? %> Member is Comment Suspended <% elsif @user.trusted %> Member is Trusted <% else %> Member is in Good Standing <% end %>

<%= form_for(@user, url: user_status_admin_user_path(@user), html: { class: "mt-3" }) do |f| %>
<%= f.label "Select new user status", class: "mr-3" %> <% options = { "Base Roles" => Constants::Role::BASE_ROLES } %> <% options["Special Roles"] = Constants::Role::SPECIAL_ROLES if current_user.has_role?(:super_admin) %> <%= f.select(:user_status, grouped_options_for_select(options), include_blank: true) %>
<%= f.label "Reason for action:" %> <%= f.text_area :note_for_current_role, required: true, class: "form-control" %>
<%= f.submit "Update User Status", class: "crayons-btn float-right" %> <% end %>
<%= render "notes" %> <%= render "negative_reactions" %> <%= render "reports" %> <%= render "data_export" %>

Remove Identity

Removing a social account identity can solve certain sign in issues, for example:

  • They created an account on <%= community_name %>, but deleted their original social account and recreated it with the same Twitter/GitHub username. This will be true if their Twitter/GitHub account's UID does not match their identity's UID. You can use the following third party tools to check: Steps to check:
    1. Click one of the links to check their social account's UID.
    2. Confirm whether or not it matches with the identity's UID.
    3. If it doesn't match, delete the respective identity.
    4. Ask the user to reauthorize their social account via <%= app_url(user_settings_path(:account)) %>
  • <% @user.identities.each do |identity| %> <%= form_for(@user, url: remove_identity_admin_user_path(@user), html: { method: :delete, onsubmit: "return confirm('Are you sure? This should only be done as a solution for the listed example(s).)" }) do |f| %> <%= f.hidden_field :identity_id, value: identity.id %>

    <%= identity.provider.capitalize %> UID: <%= identity.uid %> - Username: <%= identity.auth_data_dump.present? ? identity.auth_data_dump["info"]["nickname"] : "no auth data dump available! 😞" %>

    <%= f.submit "Delete #{identity.provider.capitalize} Identity", class: "btn btn-danger" %> <% end %> <% end %>

Destructive Actions

Merge User

To merge a duplicate account, make sure you are currently on the page of the user you want to KEEP. Below, add the user id of the account to merge information from, and delete.

<%= form_for(@user, url: merge_admin_user_path(@user), html: { method: :post, onsubmit: "return confirm('Are you sure? This is extremely destructive and irreversible. Merging will delete all the other users content and combine it with this user')" }) do |f| %> <%= f.label "User to be deleted:" %> <%= f.text_field :merge_user_id, placeholder: "#ID" %> <%= f.submit "Merge Users", class: "btn btn-danger" %> <% end %>

Banish User

<% if @user.comments.where("created_at < ?", 100.days.ago).empty? && @user.created_at < 100.days.ago %>

This is extremely destructive. Banishing will delete all the user's existing content and change their username to @spam_###.

Do not do this lightly.

<%= form_for(@user, url: banish_admin_user_path(@user), html: { method: :post, onsubmit: "return confirm('Are you sure? This is extremely destructive and irreversible. Banishing will delete all articles and turn their username into @spam_###')" }) do %> <% end %> <% elsif current_user.has_role?(:super_admin) || current_user.has_role?(:support_admin) %>

This is not a new user. You are only allowed to take this action because you are a super admin or a support admin.

This is extremely destructive. Banishing will delete all the user's existing content and change their username to @spam_###.

Do not do this lightly.

<%= form_for(@user, url: banish_admin_user_path(@user), html: { method: :post, onsubmit: "return confirm('Are you sure? This is extremely destructive and irreversible. Banishing will delete all articles and turn their username into @spam_###')" }) do %> <% end %> <% else %>

This is not a new user. Only super admins or support admins are allowed to banish this user.

<% end %>
<% if current_user.has_role?(:super_admin) %>

Fully Delete User

This will completely destroy the user and all of their activity from our database. This action is irreversible.

Do not do this lightly.

<%= form_for(@user, url: full_delete_admin_user_path(@user), html: { method: :post, onsubmit: "return confirm('Are you sure? This is extremely destructive and irreversible.')" }) do |f| %> <% end %>
<% end %>