@Override
public CreateUserResult execute(CreateUser action, ExecutionContext context)
throws ActionException {
//This should reeeeaaaaaly be cleaned out
UserDao dao = new UserDao();
log.severe("\nReceived user:"+
"\n Username: "+ action.getUserToCreate().getUsername()+
"\n Recieved password: "+ action.getUserToCreate().getHashedPassword()+
"\n Email: " +action.getUserToCreate().getEmail());
String sessionId = null;
String dataStoreId = null;
User userToCreate = action.getUserToCreate();
if(userToCreate == null )
{
log.severe("\nreturned because userToCreate was null!!!");
return new CreateUserResult(sessionId, dataStoreId);
}
else {
dataStoreId = dao.createUser(userToCreate);
log.severe("\n From dao.CreateUser(), the datastoreId is: " +dataStoreId);
if (dataStoreId != null) {
HttpSession session = requestProvider.get().getSession();
session.setAttribute("login.authenticated", userToCreate.getUsername());
sessionId = session.getId();