Package org.jayasoft.woj.portal.data.dao.security

Examples of org.jayasoft.woj.portal.data.dao.security.UserDao


      User u = order.getBuyer();
      Price price = order.getPrice();
      SpecialOffer so = order.getSpecialOffer();
      int nb = order.getSubscribedUsers();
      int duration = order.getSubscribedYears();
      UserDao userDao = DaoFactory.getUserDao();
      LicenseDao licenseDao = DaoFactory.getLicenseDao();
      try {
            ClufImpl cluf = getActiveCluf();
           
        userDao.fetch(u);
        UserImpl user = (UserImpl)userDao.findUser(u.getLogin());
        userDao.fetch(user);

            if ((user.getLastAcceptedCluf() == null) || !cluf.getVersion().equals(user.getLastAcceptedCluf().getVersion())) {
                user.setLastAcceptedCluf(cluf);
            }
View Full Code Here


            throw new ServiceException("failed to add community license to user " + u.getLogin(), e);
        }
    }

    private void addFreeLicense(User u, License l) throws DaoException, ServiceException {
        UserDao userDao = DaoFactory.getUserDao();
        ClufImpl cluf = getActiveCluf();
        UserImpl user = (UserImpl)userDao.findUser(u.getLogin());
        userDao.fetch(user);
        if ((user.getLastAcceptedCluf() == null) || !cluf.getVersion().equals(user.getLastAcceptedCluf().getVersion())) {
            user.setLastAcceptedCluf(cluf);
        }
        user.getBuyedLicenses().add(l);
        l.setBuyer(user);
View Full Code Here

        }
        return null;
    }

  public User getOwner(License l) {
    UserDao userDao = DaoFactory.getUserDao();
    User user = userDao.findUserUsinglicense(l);
    return user;
  }
View Full Code Here

        }
       
    }

    public License createTrialLicenseForGroup(User userLogged, Long groupId) throws ServiceException {
        UserDao userDao = DaoFactory.getUserDao();
        LicenseDao licenseDao = DaoFactory.getLicenseDao();
        GroupDao groupDao = DaoFactory.getGroupDao();
        LOGGER.info("adding trial to user " + userLogged.getLogin() + " registring for a group: " + groupId);

        try {
            ClufImpl cluf = ServiceFactory.getLicenseService().getActiveCluf();
            License l = licenseDao.createTrial();
           
            Group group = (Group) groupDao.find(groupId);
//            l.setHostId(hostId); No Host
            UserImpl user = (UserImpl)userDao.findUser(userLogged.getLogin());
            userDao.fetch(user);
            if ((user.getLastAcceptedCluf() == null) ||
                cluf.getVersion().equals(user.getLastAcceptedCluf().getVersion())) {
                user.setLastAcceptedCluf(cluf);
            }
            user.getBuyedLicenses().add(l);
View Full Code Here

    public void buy(User buyer, Product p, int years, int subscribedUsers) {
        if (buyer instanceof UserImpl) {
            try {
                UserImpl godson = (UserImpl)buyer;
                UserDao uDao = DaoFactory.getUserDao();
                ProductPointDao ppDao = DaoFactory.getProductPointDao();
                UserPointDao upDao = DaoFactory.getUserPointDao();
               
                UserImpl godfather = (UserImpl)uDao.findUser(godson.getGodfather());
                if (godfather != null) {
                    ProductPoint pp = ppDao.get(p, years, ProductPoint.GODSON);
                    if (pp.getPoints()!=0) {
                        UserPoint oldGFUP = getUserPoint(godfather);
                        UserPoint gfUP = UserPointFactory.godson(godfather, oldGFUP, godson, p, subscribedUsers, pp);
View Full Code Here

     * @return a non null User object
     * @throws BadLoginPasswordException if the user could not be connected due to a bad login/pass provided
     * @throws LicenseExpiredException if the license of the user has expired
     */
    public User login(String login, String password) throws BadLoginPasswordException, LicenseExpiredException {
        UserDao dao = DaoFactory.getUserDao();
        User u = dao.findUser(login);
        if (u==null) {
          LOGGER.debug("user [" + login + "] cannot log in, login unknown");
            throw new BadLoginPasswordException("invalid login/password");
        }
       
View Full Code Here

TOP

Related Classes of org.jayasoft.woj.portal.data.dao.security.UserDao

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.