6279: if hostname ends with .shell, strip it.
authorradhika <radhika@curoverse.com>
Thu, 9 Jul 2015 00:25:51 +0000 (20:25 -0400)
committerradhika <radhika@curoverse.com>
Thu, 9 Jul 2015 00:25:51 +0000 (20:25 -0400)
apps/workbench/app/controllers/actions_controller.rb
apps/workbench/app/views/users/_manage_virtual_machines.html.erb

index 77abb6315615552394e732c043c877855b432a18..f1985a64284c52450d0f4fcd43f91e284e6cd814 100644 (file)
@@ -230,10 +230,13 @@ You can try recreating the collection to get a copy with full provenance data."
 
   expose_action :webshell do
     shell_in_a_box_url_config = Rails.configuration.shell_in_a_box_url
+
     return render_not_found if not shell_in_a_box_url_config
 
+    return unprocessable "Missing parameters" if not params['login'] or not params['hostname']
+
     @webshell_login = params['login']
-    @webshell_hostname = params['hostname']
+    @webshell_hostname = params['hostname'].chomp('.shell')
 
     if not shell_in_a_box_url_config.end_with?('/')
       shell_in_a_box_url_config += '/'
index f3756ac62151fbdde555904c88c3ae090a25de89..75e7d155af84ca1b5e017fd79d8c0a7346f796a9 100644 (file)
             </td>
             <td>
               <% if  Rails.configuration.shell_in_a_box_url %>
-                <%= link_to 'Login', webshell_path(login: @my_vm_logins[vm[:uuid]].first, hostname: vm[:hostname], vm_uuid: vm[:uuid]) %>
+                <% if @my_vm_logins[vm[:uuid]] %>
+                  <% @my_vm_logins[vm[:uuid]].each do |login| %>
+                    <%= link_to 'Login', webshell_path(login: login, hostname: vm[:hostname]) %>
+                  <% end %>
+                <% end %>
               <% end %>
             </td>
           </tr>