Log to application.log when an admin starts and stops impersonating a user
Closes gitlab-org/gitlab-ee#536
This commit is contained in:
		
							parent
							
								
									1a9d505972
								
							
						
					
					
						commit
						731b231357
					
				| 
						 | 
				
			
			@ -2,6 +2,7 @@ Please view this file on the master branch, on stable branches it's out of date.
 | 
			
		|||
 | 
			
		||||
v 8.8.0 (unreleased)
 | 
			
		||||
  - Project#open_branches has been cleaned up and no longer loads entire records into memory.
 | 
			
		||||
  - Log to application.log when an admin starts and stops impersonating a user
 | 
			
		||||
  - Make build status canceled if any of the jobs was canceled and none failed
 | 
			
		||||
  - Remove future dates from contribution calendar graph.
 | 
			
		||||
  - Support e-mail notifications for comments on project snippets
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue