Package com.uphea.service

Examples of com.uphea.service.UserAuthManager


  /**
   * Try to log user via cookie data.
   */
  @Override
  protected Object loginViaCookie(String[] cookieData) {
    UserAuthManager userAuthManager = AppCore.ref.getPetite().getBean(UserAuthManager.class);
    Long id;
    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


  /**
   * Logins user.
   */
  @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);
    return new UserSession(user);
  }
View Full Code Here

TOP

Related Classes of com.uphea.service.UserAuthManager

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.