Package com.ursu.shared

Examples of com.ursu.shared.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();
        return new CreateUserResult(sessionId, dataStoreId);
      }
      else return new CreateUserResult(sessionId, dataStoreId) ;
    }
View Full Code Here


      currentUser.setUsername(username);
     
      return currentUser;
    }
    else {
    User tempUser =  ofy().query(User.class).filter("username",
        username).get();
    if(tempUser != null ) {
     
       currentUser = new CurrentUser();
       currentUser.setLoggedIn(true);
       currentUser.setUsername(username);
       if(tempUser.isAdministrator())
         currentUser.setAdmin(true);
       else
         currentUser.setAdmin(false);
       return currentUser;
         }
View Full Code Here

   */
  public String createUser(User user) {
    String hashedPassword = BCrypt.hashpw(user.getHashedPassword(),
        BCrypt.gensalt());
    user.setHashedPassword(hashedPassword);
    User tempUser =  ofy().query(User.class).filter("username",
        user.getUsername()).get();
    if (tempUser == null){
      ofy().put(user);
    return user.getId().toString();
    }
View Full Code Here

  private void addHandlers() {
    registerHandler(getView().getCreateAccountBtn().addClickHandler(new ClickHandler() {

      @Override
      public void onClick(ClickEvent event) {
        User user;

        if(verifyFields()){
          user = new User();
          createUserFomFields(user);
         
          CreateUser action = new CreateUser(user);
          dispatchAsync.execute(action, createUserCallback);
View Full Code Here

TOP

Related Classes of com.ursu.shared.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.