});
}
private void handleSuccess(final SignupInfo data, final WebProtegeDialogCloser dialogCloser) {
final AdminServiceManager adminServiceManager = AdminServiceManager.getInstance();
adminServiceManager.getNewSalt(new AsyncCallback<String>() {
public void onFailure(Throwable caught) {
MessageBox.showAlert("Error",
"There was a problem registering the specified user account. " +
"Please contact admin. (Problem " + caught.getMessage() + ")");
}
public void onSuccess(String salt) {
HashAlgorithm hashAlgorithm = new HashAlgorithm();
String userName = data.getUserName();
String email = data.getEmailAddress().getEmailAddress();
String hashedPassword = hashAlgorithm.md5(salt + data.getPassword());
adminServiceManager.registerUserViaEncrption(userName, hashedPassword, email, new AsyncCallback<UserData>() {
public void onFailure(Throwable caught) {
if(caught instanceof UserNameAlreadyExistsException) {
String username = ((UserNameAlreadyExistsException) caught).getUsername();
MessageBox.showAlert("User name already taken", "A user named "
+ username