mirror of https://github.com/apache/archiva.git
[MRM-1617] reset password link
display change password box after key validation. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1300944 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7fd8be158e
commit
2eb122127b
|
@ -70,6 +70,11 @@ $(function() {
|
|||
validateKey(validateMeId);
|
||||
return;
|
||||
}
|
||||
var resetPassword= $.urlParam('resetPassword');
|
||||
if (resetPassword){
|
||||
resetPasswordForm(resetPassword);
|
||||
return;
|
||||
}
|
||||
|
||||
var browse = $.urlParam('browse');
|
||||
if (browse){
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue