Package com.iisigroup.cap.auth.model

Examples of com.iisigroup.cap.auth.model.User


    public void changeUserPassword(String userId, String password) {
        SysParm parmPwdExpiredDay = commonDao.findById(SysParm.class,
                PwdPloicyKeys.PWD_EXPIRED_DAY.toString().toLowerCase());
        int expiredDay = Integer.parseInt(parmPwdExpiredDay.getParmValue());
        Date now = Calendar.getInstance().getTime();
        User user = userDao.findByCode(userId);
        String pwdHash = encodePassword(user.getCode(), password);
        user.setPwdExpiredTime(new Timestamp(CapDate.shiftDays(now, expiredDay)
                .getTime()));
        user.setPassword(pwdHash);
        user.setStatus("0");
        userDao.save(user);
        // insert pwd history
        PwdLog uph = new PwdLog();
        uph.setUserCode(user.getCode());
        uph.setPassword(pwdHash);
        uph.setUpdateTime(new Timestamp(now.getTime()));
        userPwdHistoryDao.save(uph);
    }
View Full Code Here


                PwdPloicyKeys.PWD_EXPIRED_DAY.toString().toLowerCase());
        SysParm parmPwdNotifyDay = commonDao.findById(SysParm.class,
                PwdPloicyKeys.PWD_NOTIFY_DAY.toString().toLowerCase());
        int notifyDay = Integer.parseInt(parmPwdNotifyDay.getParmValue());
        int expiredDay = Integer.parseInt(parmPwdExpiredDay.getParmValue());
        User user = userDao.findByCode(userId);
        List<PwdLog> list = userPwdHistoryDao.findByUserCode(
                user.getOid(), 1);
        for (PwdLog h : list) {
            int diff = CapDate.calculateDays(Calendar.getInstance().getTime(),
                    h.getUpdateTime());
            if (diff >= (expiredDay - notifyDay)) {
                return (expiredDay - diff);
View Full Code Here

        return dao.findBySysTypeAndPath(systemType, url);
    }

    @Override
    public void lockUserByUserId(String userId) {
        User user = userDao.findByCode(userId);
        if (!"2".equals(user.getStatus())) {
            user.setPreStatus(user.getStatus());
            user.setStatus("2");
            user.setUpdateTime(CapDate.getCurrentTimestamp());
            user.setUpdater(CapSecurityContext.getUserId());
            userDao.save(user);
        }
    }
View Full Code Here

        }
    }

    @Override
    public void login(String userId) {
        User user = userDao.findByCode(userId);
        user.setLastLoginTime(CapDate.getCurrentTimestamp());
        userDao.save(user);
    }
View Full Code Here

TOP

Related Classes of com.iisigroup.cap.auth.model.User

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.