Examples of User


Examples of org.baeldung.persistence.model.User

    boolean accountNonExpired = true;
    boolean credentialsNonExpired = true;
    boolean accountNonLocked = true;
    try {
      LOGGER.debug("Loading user by username: {}", email);
      User user = userRepository.findByEmail(email);
      // OCT 21
      Calendar cal = Calendar.getInstance();
      LOGGER.debug("Found user: {}", user);
      if (user == null) {
        return new org.springframework.security.core.userdetails.User(
            " ", " ", enabled, true, true, true,
            getAuthorities(new Integer(1)));
      }
      // OCT 21
      if (!(user.getVerificationToken().isVerified())) {
        enabled = false;
      }
      // OCT 21
      if ((user.getVerificationToken().isVerified())
          && (user.getVerificationToken().getExpiryDate().getTime() - cal
              .getTime().getTime()) <= 0) {
        userRepository.delete(user);
        // DEBUGGING
        System.out.println("Deleted");

        accountNonExpired = false;
      }
      return new org.springframework.security.core.userdetails.User(
          user.getEmail(), user.getPassword().toLowerCase(), enabled,
          accountNonExpired, credentialsNonExpired, accountNonLocked,
          getAuthorities(user.getRole().getRole()));

    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

Examples of org.beangle.ems.security.User

public class HomeAction extends SecurityActionSupport {

  private MenuService menuService;
 
  public String index() {
    User user = entityDao.get(User.class, getUserId());
    Long categoryId = getUserCategoryId();
    put("categoryId", categoryId);
    MenuProfile profile = getMenuProfile(categoryId);
    if (null != profile) {
      put("menus", HierarchyEntityUtil.getRoots(menuService.getMenus(profile, user)));
View Full Code Here

Examples of org.beangle.security.User

      }
    }
  }

  public void registerAuthorities(Long userId) {
    User user = (User) entityDao.get(User.class, userId);
    Set<Group> groups = userService.getGroups(user);
    Long[] groupIds = new Long[groups.size()];
    int i = 0;
    for (final Group group : groups) {
      registerGroupAuthorities(group);
      groupIds[i++] = group.getId();
    }
    userGroupIds.put(user.getId(), groupIds);
  }
View Full Code Here

Examples of org.beangle.security.blueprint.User

public class MyUploadAction extends SecurityActionSupport {

  protected AvatarBase avatarBase;

  public String uploadForm() {
    User user = getUser();
    Avatar avatar = avatarBase.getAvatar(user.getName());
    put("avatar", avatar);
    put("user", user);
    return forward();
  }
View Full Code Here

Examples of org.beangle.security.core.userdetail.User

      return makeUserDetailsFromAuthoritiesPopulator();
    }
  }

  private UserDetail makeUserDetailsFromAuthoritiesPopulator() {
    return new User("user", "password", GrantedAuthorityBean.build("ROLE_A", "ROLE_B"));
  }
View Full Code Here

Examples of org.bigbluebutton.api.domain.User

    @Override
    public void userJoined(String meetingId, String internalUserId, String externalUserId, String name, String role) {
      Meeting m = getMeeting(meetingId);
      if (m != null) {
        User user = new User(internalUserId, externalUserId, name, role);
        m.userJoined(user);
        log.debug("New user in meeting " + meetingId + ":" + user.getFullname());
        return;
      }
      log.warn("The meeting " + meetingId + " doesn't exist");
    }
View Full Code Here

Examples of org.bigk.invoices.model.User

      throws ServiceException {
    if (logger.isDebugEnabled()) {
      logger.debug("processLogin(String login=" + login + ", String password=xxx) - start");
    }
   
    User user = null;
    try {
      user = usersDAO.getUser4Login(login);
    } catch (DBAccessException ex) {
      logger.error("processLogin(String, String)", ex);
      throw new ServiceException(ex);
    }
   
    if (user == null) {
      throw new ServiceException("No user found for username",
          "services.LoginServiceImpl.processLogin.no_user",
          new Object[] {login}
      );
    }
   
    String passSHA1 = null;
    try {
      passSHA1 = DigestUtils.digestSHA1(password);
    } catch (NoSuchAlgorithmException e) {
      logger.error("processLogin(String, String)", e);
      throw new ServiceException("NoSuchAlgorithmException", e,
          "services.LoginServiceImpl.processLogin.algoritm_problem",
          new Object[] {e.getMessage()}
      );     
    }
   

    if (logger.isDebugEnabled()) {
      logger.debug("processLogin(String, String) - passSHA1=" + passSHA1);
      logger.debug("processLogin(String, String) - user.getPassword()=" + user.getPassword());
    }
   
    if (!passSHA1.equalsIgnoreCase(user.getPassword())) {
      throw new ServiceException("Wrong password",
          "services.LoginServiceImpl.processLogin.wrong_password",
          null
      );
    }
View Full Code Here

Examples of org.blueoxygen.cimande.security.User

    String FlatJS = "";

    FlatChildGenerator FlatChild;

    try {
      User us = getCurrentUser();
      this.roleId = us.getRole().getId();
      this.siteId = (String) ServletActionContext.getRequest()
          .getSession().getAttribute(LoginFilter.LOGIN_CIMANDE_SITE);

      mySQL = "FROM " + RoleSite.class.getName()
          + " tmp WHERE tmp.role.id='" + this.roleId
View Full Code Here

Examples of org.brain.pojos.User

    String url = request.getRequestURI();
   
    if(url.toLowerCase().indexOf("login.jsf")<0)
    {
      HttpSession session = request.getSession();
      User user =  (User) session.getAttribute("user");
      if(user == null)
      {
        Application application = fc.getApplication();
        NavigationHandler nh = application.getNavigationHandler();
        nh.handleNavigation(fc, "", "error");
View Full Code Here

Examples of org.brixcms.rmiserver.User

    public Long loggedinUserId() {
        return userId;
    }

    public User loginUser(String login, String password) throws AuthenticationException {
        User user = users.query(login, password);
        if (user == null) {
            throw new AuthenticationException();
        }
        userId = user.getId();
        return user;
    }
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.