Commit 228da2dd authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Admin can see and remove user identities

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 74a6732c
......@@ -7,6 +7,7 @@ v 7.13.0 (unreleased)
- Rename "Design" profile settings page to "Preferences".
- Allow users to customize their default Dashboard page.
- Update ssl_ciphers in Nginx example to remove DHE settings. This will deny forward secrecy for Android 2.3.7, Java 6 and OpenSSL 0.9.8
- Admin can remove user identities
v 7.12.0 (unreleased)
- Fix post-receive errors on a push when an external issue tracker is configured (Stan Hu)
......
class Admin::IdentitiesController < Admin::ApplicationController
before_action :user, only: [:destroy]
def destroy
identity = user.identities.find(params[:id])
respond_to do |format|
if identity.destroy
format.html { redirect_to [:admin, user], notice: 'User identity was successfully removed.' }
else
format.html { redirect_to [:admin, user], alert: 'Failed to remove user identity.' }
end
end
end
protected
def user
@user ||= User.find_by!(username: params[:user_id])
end
end
%tr
%td
= identity.provider
%td
= identity.extern_uid
%td
= link_to [:admin, @user, identity], method: :delete,
class: 'btn btn-xs btn-danger',
data: { confirm: "Are you sure you want to remove this identity" } do
%i.fa.fa-trash
Delete
......@@ -23,6 +23,8 @@
%a{"data-toggle" => "tab", href: "#projects"} Projects
%li
%a{"data-toggle" => "tab", href: "#ssh-keys"} SSH keys
%li
%a{"data-toggle" => "tab", href: "#identities"} Identities
.tab-content
#account.tab-pane.active
......@@ -230,3 +232,15 @@
%i.fa.fa-times
#ssh-keys.tab-pane
= render 'profiles/keys/key_table', admin: true
#identities.tab-pane
- if @user.identities.present?
%table.table
%thead
%tr
%th Provider
%th Id
%th
= render @user.identities
- else
%h4 This user has no identities
......@@ -149,6 +149,8 @@ Gitlab::Application.routes.draw do
namespace :admin do
resources :users, constraints: { id: /[a-zA-Z.\/0-9_\-]+/ } do
resources :keys, only: [:show, :destroy]
resources :identities, only: [:destroy]
member do
put :team_update
put :block
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment