Package com.uphea.domain

Examples of com.uphea.domain.User


    try {
      id = Long.valueOf(cookieData[0]);
    } catch (NumberFormatException ignore) {
      return null;
    }
    User user = userAuthManager.findUser(id, cookieData[1]);
    if (user == null) {
      return null;
    }
    userAuthManager.login(user);
    return new UserSession(user);
View Full Code Here


  @Override
  protected Object loginUsernamePassword(String username, String password) {
    UserAuthManager userAuthManager = AppCore.ref.getPetite().getBean(UserAuthManager.class);

    // check username/password
    User user = userAuthManager.findUser(username, password);
    if (user == null) {
      return null;
    }
    // login
    userAuthManager.login(user);
View Full Code Here

   * Creates cookie data.
   */
  @Override
  protected String[] createCookieData(Object sessionObject) {
    UserSession userSession = (UserSession) sessionObject;
    User user = userSession.getUser();
    return new String[] {String.valueOf(user.getId()), user.getHashpw()};
  }
View Full Code Here

  @PostAction
  @Transaction
  public String execute() {
    if ((captcha != null) && captcha.isCorrect(captchaAnswer)) {
      User user = userService.findUserByEmail(email);

      if (user != null) {
        UserUid uid = userUidService.createUidForUser(user);
        emailBuilder.createLostPasswordMessage(user, uid);
      }
View Full Code Here

  public String save() {
    if (log.isDebugEnabled()) {
      log.debug("save " + question.getId() + ": " + saved);
    }

    User user = userSession.getUser();
    if (user == null) {
      return "text:undefined";
    }

    boolean result = false;
View Full Code Here

  /**
   * Checks users email and password.
   */
  @Transaction
  public User findUser(String email, String rawpwd) {
    User user = appDao.findOneByProperty(User.class, "email", email);
    if (user == null) {
      return null;
    }
    if (passwordEncoder.isPasswordValid(user.getHashpw(), rawpwd) == false) {
      return null;
    }
    return user;
  }
View Full Code Here

  /**
   * Finds user.
   */
  @Transaction
  public User findUser(Long id, String hashpwd) {
    User user = appDao.findOneByProperty(User.class, "id", id);
    if (user == null) {
      return null;
    }
    if (hashpwd == null) {
      return null;
    }
    if (hashpwd.equals(user.getHashpw()) == false) {
      return null;
    }
    return user;
  }
View Full Code Here

  @Override
  public void run() {
    EmailBuilder emailBuilder = petite.getBean(EmailBuilder.class);

    User user = createUser();

    emailBuilder.createWelcomeMessage(user);
  }
View Full Code Here

    emailBuilder.createWelcomeMessage(user);
  }

  User createUser() {
    User user = new User();
    user.setEmail("igor.spasic@gmail.com");
    user.setName("Igor Spasic");
    return user;
  }
View Full Code Here

TOP

Related Classes of com.uphea.domain.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.