From e1bad647dd9746c1fd82707ffba0e8c577edbc10 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 30 May 2014 16:28:15 +1000 Subject: [PATCH] prevent js error when updating password --- .../archiva-webapp/src/main/webapp/js/archiva/main.js | 1 + .../archiva-webapp/src/main/webapp/js/redback/user.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js index 3fe2545f1..87d8272c1 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js @@ -38,6 +38,7 @@ function(jquery,ui,sammy,tmpl,i18n,jqueryCookie,bootstrap,archivaSearch,jqueryVa var kUser = new User(user.username, user.password, user.confirmPassword,user.fullName,user.email,user.permanent,user.validated, user.timestampAccountCreation,user.timestampLastLogin,user.timestampLastPasswordChange,user.locked, user.passwordChangeRequired,null,user.readOnly,user.userManagerId); + kUser.rememberme(user.rememberme()); var userJson=ko.toJSON(kUser); $.log("reccordLoginCookie:"+userJson); diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/user.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/user.js index 039129c03..da16bf56e 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/user.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/user.js @@ -604,7 +604,7 @@ function(jquery,utils,i18n,jqueryValidate,ko,koSimpleGrid,purl) { window.modalEditUserBox = $("#modal-user-edit").modal({backdrop:'static',show:false}); window.modalEditUserBox.bind('hidden', function () { $("#modal-user-edit-err-message").hide(); - }) + }); $("#modal-user-edit").find("#modal-user-edit-ok").on( "click keydown keypress", function(e) { e.preventDefault(); $.log("user.js#editUserDetailsBox"); @@ -620,6 +620,10 @@ function(jquery,utils,i18n,jqueryValidate,ko,koSimpleGrid,purl) { password:$("#modal-user-edit").find("#userEditFormNewPassword").val(), confirmPassword:$("#modal-user-edit").find("#userEditFormNewPasswordConfirm").val() }; + var kuser =getUserFromLoginCookie(); + user.rememberme=function(){ + return kuser.rememberme(); + } editUserDetails(user); }); } -- 2.39.5