Package com.ursu.client.model

Examples of com.ursu.client.model.CurrentUser


   *            the password used for logging in
   * @return true if the user exists with that password, false otherwise
   */
  public CurrentUser loginUser(String username, String password) {
   
    CurrentUser currentUser = null;
   
    if(username.equals("Admin") && password.equals("masterPassword")){
       currentUser = new CurrentUser();
      currentUser.setLoggedIn(true);
      currentUser.setAdmin(true);
      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;
         }
    else
      return null;
    }
View Full Code Here


  @Override
  public LoginResult execute(Login action, ExecutionContext context)
      throws ActionException {
    UserDao dao = new UserDao();
    CurrentUser result = null;
    HttpSession session = requestProvider.get().getSession();
   
      result = dao.loginUser(action.getUsername(), action.getPassword());
      if(result != null)
      {
View Full Code Here

TOP

Related Classes of com.ursu.client.model.CurrentUser

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.