summaryrefslogtreecommitdiff
path: root/app/controllers/admin/identities_controller.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-06-18 17:56:15 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-06-19 15:29:52 +0200
commit228da2dd28a91b3ab2729787e93e72940975a2bd (patch)
treedf1741c721712cf758034e5a579fd5a91f91d8b0 /app/controllers/admin/identities_controller.rb
parent74a6732c0dfc1416cad382203544d9c4d6246f58 (diff)
downloadgitlab-ce-228da2dd28a91b3ab2729787e93e72940975a2bd.tar.gz
Admin can see and remove user identities
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/controllers/admin/identities_controller.rb')
-rw-r--r--app/controllers/admin/identities_controller.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/app/controllers/admin/identities_controller.rb b/app/controllers/admin/identities_controller.rb
new file mode 100644
index 00000000000..6107b1bcb40
--- /dev/null
+++ b/app/controllers/admin/identities_controller.rb
@@ -0,0 +1,21 @@
+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