aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-web
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-05-25 14:38:35 +0000
committerOlivier Lamy <olamy@apache.org>2012-05-25 14:38:35 +0000
commit23bd07d564f18ce27beea333c0328141b104dec7 (patch)
tree437e9876316488fa325f40315b384ac44eeac335 /archiva-modules/archiva-web
parent5f43a65cd8ea0d320f1c942e613506539d40c7b9 (diff)
downloadarchiva-23bd07d564f18ce27beea333c0328141b104dec7.tar.gz
archiva-23bd07d564f18ce27beea333c0328141b104dec7.zip
use configured applicationUrl to send reset password email.
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1342649 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web')
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js38
1 files changed, 27 insertions, 11 deletions
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 9531b438c..635b76e27 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
@@ -451,6 +451,11 @@ define("redback.user",["jquery","order!utils","i18n","jquery.validate","order!kn
);
}
+ ResetPasswordRequest=function(username,applicationUrl){
+ this.username=username;
+ this.applicationUrl=applicationUrl;
+ }
+
passwordReset=function(){
var username = $("#user-login-form-username" ).val();
if(username.trim().length<1){
@@ -466,17 +471,28 @@ define("redback.user",["jquery","order!utils","i18n","jquery.validate","order!kn
window.modalLoginWindow.modal('hide');
}
$("#user-messages" ).html(mediumSpinnerImg());
- $.ajax("restServices/redbackServices/userService/resetPassword/"+encodeURIComponent(username), {
- type: "GET",
- success: function(result) {
- clearUserMessages();
- displayInfoMessage($.i18n.prop("password.reset.success"));
- },
- error: function(result) {
- clearUserMessages();
- var obj = jQuery.parseJSON(result.responseText);
- displayRedbackError(obj);
- }
+
+ $.ajax({
+ url: "restServices/archivaServices/archivaAdministrationService/applicationUrl",
+ type: "GET",
+ dataType: 'text',
+ success: function(data){
+
+ $.ajax("restServices/redbackServices/userService/resetPassword", {
+ type: "POST",
+ data: JSON.stringify(new ResetPasswordRequest(username,data)),
+ contentType: "application/json",
+ success: function(result) {
+ clearUserMessages();
+ displayInfoMessage($.i18n.prop("password.reset.success"));
+ },
+ error: function(result) {
+ clearUserMessages();
+ var obj = jQuery.parseJSON(result.responseText);
+ displayRedbackError(obj);
+ }
+ });
+ }
});
}