From c378aa30f0942a58f3f504edf61233296d671eff Mon Sep 17 00:00:00 2001 From: radhika Date: Wed, 30 Jul 2014 10:32:43 -0400 Subject: [PATCH] 3193: update the ssh popup to not require name. --- apps/workbench/app/controllers/users_controller.rb | 5 +++++ .../app/views/users/_add_ssh_key_popup.html.erb | 8 ++++---- .../app/views/users/add_ssh_key_popup.js.erb | 13 +++++++++---- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/apps/workbench/app/controllers/users_controller.rb b/apps/workbench/app/controllers/users_controller.rb index 836c185242..805d0d2e80 100644 --- a/apps/workbench/app/controllers/users_controller.rb +++ b/apps/workbench/app/controllers/users_controller.rb @@ -263,6 +263,11 @@ class UsersController < ApplicationController key_params['public_key'] = params['public_key'] end + if !key_params['name'] + split_key = key_params['public_key'].split + key_params['name'] = split_key[-1] if (split_key.size == 3) + end + new_key = AuthorizedKey.create! key_params if new_key format.js diff --git a/apps/workbench/app/views/users/_add_ssh_key_popup.html.erb b/apps/workbench/app/views/users/_add_ssh_key_popup.html.erb index 283154f174..83299813ac 100644 --- a/apps/workbench/app/views/users/_add_ssh_key_popup.html.erb +++ b/apps/workbench/app/views/users/_add_ssh_key_popup.html.erb @@ -18,14 +18,14 @@ style: "font-weight: bold", target: "_blank" %> -
- - -