Skip to content
Snippets Groups Projects
Commit 228da2dd authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Admin can see and remove user identities

parent 74a6732c
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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)
Loading
Loading
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
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment