diff options
| author | Douwe Maan <douwe@gitlab.com> | 2015-09-28 15:43:02 +0200 |
|---|---|---|
| committer | Douwe Maan <douwe@gitlab.com> | 2015-09-28 15:43:02 +0200 |
| commit | 1c1c7e1abd2ac4f4e88de06f7336bbf8ca5ad3da (patch) | |
| tree | 07ad5566f3c768bccdf4b547640d70da99d89e5b /app | |
| parent | ac34ce8648f48979c257b626a31e65c0ba5b38dc (diff) | |
| parent | 0c877875ea3e7ccbdf48b7736f8c35e2a179ab45 (diff) | |
| download | gitlab-ce-1c1c7e1abd2ac4f4e88de06f7336bbf8ca5ad3da.tar.gz | |
Merge branch 'fxposter/gitlab-ce-login-from-admin'
Diffstat (limited to 'app')
| -rw-r--r-- | app/controllers/admin/users_controller.rb | 6 | ||||
| -rw-r--r-- | app/views/admin/users/_head.html.haml | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index a19b1abee27..00f41a10dd1 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -63,6 +63,12 @@ class Admin::UsersController < Admin::ApplicationController end end + def login_as + sign_in(user) + flash[:alert] = "Logged in as #{user.username}" + redirect_to root_path + end + def disable_two_factor user.disable_two_factor! redirect_to admin_user_path(user), diff --git a/app/views/admin/users/_head.html.haml b/app/views/admin/users/_head.html.haml index 9d5e934c8ba..4245d0f1eda 100644 --- a/app/views/admin/users/_head.html.haml +++ b/app/views/admin/users/_head.html.haml @@ -6,6 +6,8 @@ %span.cred (Admin) .pull-right + - unless @user == current_user + = link_to 'Log in as this user', login_as_admin_user_path(@user), method: :post, class: "btn btn-grouped btn-info" = link_to edit_admin_user_path(@user), class: "btn btn-grouped" do %i.fa.fa-pencil-square-o Edit |
