diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js index 9d08d0905..25dad0f3c 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js @@ -70,6 +70,11 @@ $(function() { validateKey(validateMeId); return; } + var resetPassword= $.urlParam('resetPassword'); + if (resetPassword){ + resetPasswordForm(resetPassword); + return; + } var browse = $.urlParam('browse'); if (browse){ diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/register.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/register.js index 72c568424..9b887f8af 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/register.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/register.js @@ -96,7 +96,7 @@ $(function() { * validate a registration key and go to change password key * @param key */ - validateKey=function(key) { + validateKey=function(key,registration) { // FIXME spinner display $.ajax({ url: 'restServices/redbackServices/userService/validateKey/'+key, @@ -104,7 +104,7 @@ $(function() { success: function(result){ window.redbackModel.key=key; $.log("validateKey#sucess"); - changePasswordBox(false,true,null); + changePasswordBox(false,registration?registration:true,null); }, complete: function(){ // hide spinner diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js index 942efa735..9400371c8 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js @@ -410,6 +410,13 @@ $(function() { $("#small-spinner").remove(); } + resetPasswordForm=function(key){ + $.log("resetPasswordForm:"+key); + validateKey(key,false); + $.log("resetPasswordForm#validateKey ok"); + displaySearch(); + } + passwordReset=function(){ var username = $("#user-login-form-username" ).val(); if(username.trim().length<1){ @@ -426,16 +433,17 @@ $(function() { } $("#user-messages" ).html(mediumSpinnerImg()); $.ajax("restServices/redbackServices/userService/resetPassword/"+encodeURIComponent(username), { - type: "GET", - success: function(result) { - clearUserMessages(); - displaySuccessMessage( $.i18n.prop("password.reset.success")); - }, - error: function(result) { - var obj = jQuery.parseJSON(result.responseText); - displayRedbackError(obj); - } - }); + type: "GET", + success: function(result) { + clearUserMessages(); + displayInfoMessage($.i18n.prop("password.reset.success")); + }, + error: function(result) { + clearUserMessages(); + var obj = jQuery.parseJSON(result.responseText); + displayRedbackError(obj); + } + }); } /**