Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-05-04 06:55:35 +0300
committerStan Hu <stanhu@gmail.com>2016-05-04 19:21:34 +0300
commit731b231357f3b0b71f60a3bb1f81f8cd78f3e318 (patch)
treed25a82ac9e30773cbadbff9063511dca04fd986a /app
parent1a9d50597262a31f03dc66584f05d66b905d9d59 (diff)
Log to application.log when an admin starts and stops impersonating a user
Closes gitlab-org/gitlab-ee#536
Diffstat (limited to 'app')
-rw-r--r--app/controllers/admin/impersonations_controller.rb2
-rw-r--r--app/controllers/admin/users_controller.rb2
2 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/admin/impersonations_controller.rb b/app/controllers/admin/impersonations_controller.rb
index 2db824c87ef..8be35f00a77 100644
--- a/app/controllers/admin/impersonations_controller.rb
+++ b/app/controllers/admin/impersonations_controller.rb
@@ -7,6 +7,8 @@ class Admin::ImpersonationsController < Admin::ApplicationController
warden.set_user(impersonator, scope: :user)
+ Gitlab::AppLogger.info("User #{original_user.username} has stopped impersonating #{impersonator.username}")
+
session[:impersonator_id] = nil
redirect_to admin_user_path(original_user)
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb
index b8976fa09a9..f2f654c7bcd 100644
--- a/app/controllers/admin/users_controller.rb
+++ b/app/controllers/admin/users_controller.rb
@@ -41,6 +41,8 @@ class Admin::UsersController < Admin::ApplicationController
warden.set_user(user, scope: :user)
+ Gitlab::AppLogger.info("User #{current_user.username} has started impersonating #{user.username}")
+
flash[:alert] = "You are now impersonating #{user.username}"
redirect_to root_path