use of io.hops.hopsworks.common.remote.RemoteUserDTO in project hopsworks by logicalclocks.
the class Register method createRemoteUser.
private void createRemoteUser(HttpServletRequest httpServletRequest) {
try {
RemoteUserDTO userDTO = ldapConfigHelper.getLdapHelper().getRemoteUserByUuid(this.uuid);
if (email == null || email.isEmpty()) {
// email is needed for audit
email = userDTO.getEmail().isEmpty() ? null : userDTO.getEmail().get(0);
}
if (email == null || email.isEmpty()) {
throw new GenericException(RESTCodes.GenericErrorCode.ILLEGAL_ARGUMENT, Level.FINE, "Email not provided.");
}
auditedUserAdministration.createRemoteUser(userDTO, email, firstName, lastName, UserAccountStatus.fromValue(status), RemoteUserType.fromValue(remoteUserType), httpServletRequest);
restAll();
MessagesController.addInfoMessage("Success", "User created.", "msg");
} catch (UserException | GenericException e) {
showErrorMsg("Create remote user failed.", e);
}
}
Aggregations