Package uk.org.woodcraft.bookings.datamodel

Examples of uk.org.woodcraft.bookings.datamodel.User.checkPassword()


      String email = request.getParameter(LOGIN_EMAIL);
      String password = request.getParameter(LOGIN_PASSWORD);

      User user = CannedQueries.getUserByEmail(email);
      if (user != null && user.getAccessLevel().getCanLogin()
          && user.checkPassword(password))
    {
        if (!user.getApproved() )
          return "User has not yet been approved for login. Please wait until you are sent an email approving access to the booking system.";
       
        if (!user.getEmailValidated() )
View Full Code Here


    testUser = CannedQueries.getUserByEmail(email);
    assertEquals(true, testUser.getEmailValidated());
    assertEquals(false, testUser.getApproved());
    testUser = CannedQueries.getUserByEmail(email);
    assertEquals(Accesslevel.UNIT_ADMIN, testUser.getAccessLevel());
    assertTrue(testUser.checkPassword(password));
  }
 
  @Test
  public void testCantSignUpExistingUser()
  {
View Full Code Here

      return false;
   
    // Note apiUsername is an email for these purposes
      User user = CannedQueries.getUserByEmail(apiUsername);
      if (user != null && user.getAccessLevel().equals(Accesslevel.API)
          && user.checkPassword(apiPassword))
      {
        return true;
      }
    return false;
  }
View Full Code Here

   
    SecurityModel.checkAllowed(Operation.WRITE, user);
   
    if (oldPassword == null && newPassword == null) return INPUT;
   
    if (!getCurrentUser().getAccessLevel().getIsSuperUser() && !user.checkPassword(oldPassword))
    {
      log.warn(String.format("%s Failed password change - wrong current password for %s", getRequestSource(), user.getEmail()));
      addActionError("Current password supplied is incorrect. Please try again");
      return INPUT;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.