diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 11:59:07 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 11:59:07 +0000 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /app/controllers/users_controller.rb | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) | |
download | gitlab-ce-8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca.tar.gz |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'app/controllers/users_controller.rb')
-rw-r--r-- | app/controllers/users_controller.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 05573255066..46245286820 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -33,18 +33,36 @@ class UsersController < ApplicationController end format.json do + # In 13.8, this endpoint will be removed: + # https://gitlab.com/gitlab-org/gitlab/-/issues/289972 load_events pager_json("events/_events", @events.count, events: @events) end end end + # Get all keys of a user(params[:username]) in a text format + # Helpful for sysadmins to put in respective servers + def ssh_keys + render plain: user.all_ssh_keys.join("\n") + end + def activity respond_to do |format| format.html { render 'show' } + + format.json do + load_events + pager_json("events/_events", @events.count, events: @events) + end end end + # Get all gpg keys of a user(params[:username]) in a text format + def gpg_keys + render plain: user.gpg_keys.select(&:verified?).map(&:key).join("\n") + end + def groups load_groups |