[ARVADOS] updated: fc68ff843ed4e665ec67c126c43c9edee5de8d3f

git at public.curoverse.com git at public.curoverse.com
Wed Jul 30 15:16:25 EDT 2014


Summary of changes:
 apps/workbench/app/controllers/users_controller.rb |  2 +-
 .../app/views/users/_add_ssh_key_popup.html.erb    |  2 +-
 .../app/views/users/add_ssh_key_popup.js.erb       | 31 ----------------------
 .../api/app/controllers/application_controller.rb  |  1 +
 4 files changed, 3 insertions(+), 33 deletions(-)

       via  fc68ff843ed4e665ec67c126c43c9edee5de8d3f (commit)
       via  ec34701537a4de8f7aff3b7f91b4402367ebb22a (commit)
       via  20f944be863d7d455534ebac0083c25869a3379d (commit)
      from  c378aa30f0942a58f3f504edf61233296d671eff (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit fc68ff843ed4e665ec67c126c43c9edee5de8d3f
Author: radhika <radhika at curoverse.com>
Date:   Wed Jul 30 15:15:51 2014 -0400

    3193: do not validate input submitted on client side

diff --git a/apps/workbench/app/controllers/users_controller.rb b/apps/workbench/app/controllers/users_controller.rb
index 805d0d2..3bcb956 100644
--- a/apps/workbench/app/controllers/users_controller.rb
+++ b/apps/workbench/app/controllers/users_controller.rb
@@ -263,7 +263,7 @@ class UsersController < ApplicationController
         key_params['public_key'] = params['public_key']
       end
 
-      if !key_params['name']
+      if !key_params['name'] && params['public_key'].andand.size>0
         split_key = key_params['public_key'].split
         key_params['name'] = split_key[-1] if (split_key.size == 3)
       end
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 8329981..efa8cae 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
@@ -29,7 +29,7 @@
       </div>
 
       <div class="modal-footer">
-        <button type="submit" id="register" class="btn btn-primary" autofocus>Submit</button>
+        <button type="submit" class="btn btn-primary" autofocus>Submit</button>
         <button class="btn btn-default" onClick="reset_form()" data-dismiss="modal" aria-hidden="true">Cancel</button>
       </div>
 
diff --git a/apps/workbench/app/views/users/add_ssh_key_popup.js.erb b/apps/workbench/app/views/users/add_ssh_key_popup.js.erb
index 808edd7..b04d37f 100644
--- a/apps/workbench/app/views/users/add_ssh_key_popup.js.erb
+++ b/apps/workbench/app/views/users/add_ssh_key_popup.js.erb
@@ -1,36 +1,5 @@
 $("#add-ssh-key-modal-window").html("<%= escape_javascript(render partial: 'add_ssh_key_popup') %>");
 
-// disable the submit button on load
-var $input = $('input:text'),
-$register = $('#register');
-
-var name_value = document.forms["add_new_key_form"]["name"].value;
-var public_key_value = document.forms["add_new_key_form"]["public_key"].value;
-if (public_key_value == null || public_key_value == "") {
-  $register.attr('disabled', true);
-}
-
-// capture events to enable submit button when applicable
-$input.on('keyup paste mouseleave onblur', function() {
-  var trigger = false;
-
-  var name_value = document.forms["add_new_key_form"]["name"].value;
-  var public_key_value = document.forms["add_new_key_form"]["public_key"].value;
-
-  var publicKeyRegExp = /^ssh-(rsa|dss) [A-Za-z0-9+\/=\+]+\b/;
-  var validKey = false;
- 
-  if (publicKeyRegExp.test(public_key_value )) {
-    validKey = true;
-  }
-
-  if (public_key_value == null || public_key_value == "" || !validKey){
-    trigger = true;
-  }
-
-  trigger ? $register.attr('disabled', true) : $register.removeAttr('disabled');
-});
-
 // reset form input fields, for the next time around
 function reset_form() {
   $('#name').val("");

commit ec34701537a4de8f7aff3b7f91b4402367ebb22a
Merge: c378aa3 20f944b
Author: radhika <radhika at curoverse.com>
Date:   Wed Jul 30 14:59:18 2014 -0400

    Merge branch 'master' into 3193-manage-account


-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list