mirror of https://github.com/apache/archiva.git
use configured applicationUrl to send registration email
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1342595 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2db8f333d8
commit
5f43a65cd8
|
@ -23,9 +23,9 @@ import org.apache.archiva.admin.model.beans.LegacyArtifactPath;
|
|||
import org.apache.archiva.admin.model.beans.NetworkConfiguration;
|
||||
import org.apache.archiva.admin.model.beans.OrganisationInformation;
|
||||
import org.apache.archiva.admin.model.beans.UiConfiguration;
|
||||
import org.apache.archiva.redback.authorization.RedbackAuthorization;
|
||||
import org.apache.archiva.rest.api.model.AdminRepositoryConsumer;
|
||||
import org.apache.archiva.security.common.ArchivaRoleConstants;
|
||||
import org.apache.archiva.redback.authorization.RedbackAuthorization;
|
||||
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.GET;
|
||||
|
@ -214,10 +214,20 @@ public interface ArchivaAdministrationService
|
|||
void setUiConfiguration( UiConfiguration uiConfiguration )
|
||||
throws ArchivaRestServiceException;
|
||||
|
||||
@Path( "applicationUrl" )
|
||||
@GET
|
||||
@Produces( MediaType.TEXT_PLAIN )
|
||||
@RedbackAuthorization( noRestriction = true, noPermission = true )
|
||||
/**
|
||||
* @since 1.4-M3
|
||||
*/
|
||||
String getApplicationUrl()
|
||||
throws ArchivaRestServiceException;
|
||||
|
||||
|
||||
@Path( "getNetworkConfiguration" )
|
||||
@GET
|
||||
@Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
|
||||
@Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
|
||||
@RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
|
||||
NetworkConfiguration getNetworkConfiguration()
|
||||
throws ArchivaRestServiceException;
|
||||
|
|
|
@ -369,6 +369,19 @@ public class DefaultArchivaAdministrationService
|
|||
}
|
||||
}
|
||||
|
||||
public String getApplicationUrl()
|
||||
throws ArchivaRestServiceException
|
||||
{
|
||||
try
|
||||
{
|
||||
return archivaAdministration.getUiConfiguration().getApplicationUrl();
|
||||
}
|
||||
catch ( RepositoryAdminException e )
|
||||
{
|
||||
throw new ArchivaRestServiceException( e.getMessage(), e );
|
||||
}
|
||||
}
|
||||
|
||||
public NetworkConfiguration getNetworkConfiguration()
|
||||
throws ArchivaRestServiceException
|
||||
{
|
||||
|
|
|
@ -576,11 +576,6 @@ define("archiva.general-admin",["jquery","i18n","order!utils","order!jquery.tmpl
|
|||
var uiConfiguration=new UiConfiguration(data.showFindArtifacts,data.appletFindEnabled,data.disableEasterEggs,data.applicationUrl);
|
||||
var uiConfigurationViewModel=new UiConfigurationViewModel(uiConfiguration);
|
||||
ko.applyBindings(uiConfigurationViewModel,mainContent.get(0));
|
||||
/*var validator = mainContent.find("#network-configuration-edit-form").validate({
|
||||
showErrors: function(validator, errorMap, errorList) {
|
||||
customShowError(mainContent.find("#network-configuration-edit-form" ).get(0),validator,errorMap,errorMap);
|
||||
}
|
||||
});*/
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -116,11 +116,17 @@ define("redback",["jquery","order!utils","jquery.validate","jquery.json","order!
|
|||
//$("#modal-register").focus();
|
||||
}
|
||||
|
||||
UserRegistrationRequest=function(user,applicationUrl){
|
||||
this.user=user;
|
||||
this.applicationUrl=applicationUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* validate the register form and call REST service
|
||||
*/
|
||||
register=function(){
|
||||
$.log("register.js#register");
|
||||
|
||||
$.log("redback.js#register");
|
||||
var valid = $("#user-register-form").valid();
|
||||
if (!valid) {
|
||||
return;
|
||||
|
@ -130,13 +136,23 @@ define("redback",["jquery","order!utils","jquery.validate","jquery.json","order!
|
|||
|
||||
$('#modal-register-footer').append(smallSpinnerImg());
|
||||
|
||||
var user = {};
|
||||
user.username = $("#user-register-form-username").val();
|
||||
user.fullName = $("#user-register-form-fullname").val();
|
||||
user.email = $("#user-register-form-email").val();
|
||||
jQuery.ajax({
|
||||
$.ajax({
|
||||
url: "restServices/archivaServices/archivaAdministrationService/applicationUrl",
|
||||
type: "GET",
|
||||
dataType: 'text',
|
||||
success: function(data){
|
||||
$.log("applicationUrl ok:"+data);
|
||||
|
||||
var user = {
|
||||
username: $("#user-register-form-username").val(),
|
||||
fullName: $("#user-register-form-fullname").val(),
|
||||
email: $("#user-register-form-email").val()
|
||||
};
|
||||
|
||||
var userRegistrationRequest=new UserRegistrationRequest(user,data);
|
||||
$.ajax({
|
||||
url: 'restServices/redbackServices/userService/registerUser',
|
||||
data: JSON.stringify(user),
|
||||
data: JSON.stringify(userRegistrationRequest),
|
||||
type: 'POST',
|
||||
contentType: "application/json",
|
||||
success: function(result){
|
||||
|
@ -163,7 +179,9 @@ define("redback",["jquery","order!utils","jquery.validate","jquery.json","order!
|
|||
displayRedbackError(obj);
|
||||
window.modalRegisterWindow.modal('hide');
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue