Package com.iisigroup.cap.base.model

Examples of com.iisigroup.cap.base.model.SysParm


   *            request
   * @return IResult
   */
  public IResult modify(IRequest request) {
    AjaxFormResult result = new AjaxFormResult();
    SysParm parm = commonService.findById(SysParm.class, request.get("parmId"));
    if (parm == null) {
      parm = new SysParm();
    }
    CapBeanUtil.map2Bean(request, parm, SysParm.class);
    parm.setUpdateTime(CapDate.getCurrentTimestamp());
    commonService.save(parm);
    return result;
  }
View Full Code Here


   *            request
   * @return IResult
   */
  public IResult delete(IRequest request) {
    AjaxFormResult result = new AjaxFormResult();
    SysParm parm = commonService.findById(SysParm.class, request.get("parmId"));
    if (parm != null) {
      commonService.delete(parm);
    }
    return result;
  }
View Full Code Here

    if (!CapString.isEmpty(val)) {
      put(sKey, val);
      return val;
    }

    SysParm sysParm = commonSrv.findById(SysParm.class, sKey);
    val = sysParm != null ? sysParm.getParmValue() : null;
    put(sKey, val);
    return val;
  }
View Full Code Here

        Map<String, Integer> policy = new HashMap<String, Integer>();
        for (PwdPloicyKeys value : PwdPloicyKeys.values()) {
            String key = value.toString().toLowerCase();
            String data = request.get(key.substring(4));
            policy.put(key, Integer.parseInt(data));
            SysParm parm = commonDao.findById(SysParm.class, key);
            if (parm == null) {
                parm = new SysParm();
            }
            parm.setParmId(key);
            parm.setParmValue(data);
            parm.setParmDesc(CapAppContext.getMessage("pwdpolicy."
                    + key.substring(4)));
            parm.setUpdater(CapSecurityContext.getUserId());
            parm.setUpdateTime(CapDate.getCurrentTimestamp());
            commonDao.save(parm);
        }
        // 針對 pwd_expired_day, pwd_account_disable, pwd_account_delete 的處理
        userDao.processUserStatus(policy.get(PwdPloicyKeys.PWD_EXPIRED_DAY
                .toString().toLowerCase()),
View Full Code Here

    private PwdPolicyService pwdPolicyService;

    public IResult query(IRequest request) {
        AjaxFormResult result = new AjaxFormResult();
        for (PwdPloicyKeys value : PwdPloicyKeys.values()) {
            SysParm parm = commonService.findById(SysParm.class, value
                    .toString().toLowerCase());
            if (parm != null) {
                result.set(parm.getParmId().substring(4), parm.getParmValue());
            }
        }
        return result;
    }
View Full Code Here

        Date now = Calendar.getInstance().getTime();
        user.setCode(code);
        user.setName(name);
        user.setEmail(email);
        if (!StringUtils.isBlank(password)) {
            SysParm parmPwdExpiredDay = commonDao.findById(SysParm.class,
                    PwdPloicyKeys.PWD_EXPIRED_DAY.toString().toLowerCase());
            int expiredDay = Integer.parseInt(parmPwdExpiredDay.getParmValue());
            user.setPwdExpiredTime(new Timestamp(CapDate.shiftDays(now,
                    expiredDay).getTime()));
            user.setPassword(encodePassword(user.getCode(), password));
        }
        user.setUpdateTime(new Timestamp(now.getTime()));
View Full Code Here

    private CodeTypeDao codeTypeDao;

    @Override
    public boolean checkPasswordRule(String userId, String password,
            String password2, boolean forcePwdChange) {
        SysParm parmPwdRule = commonDao.findById(SysParm.class,
                PwdPloicyKeys.PWD_RULE.toString().toLowerCase());
        SysParm parmPwdMinLen = commonDao.findById(SysParm.class,
                PwdPloicyKeys.PWD_MIN_LENGTH.toString().toLowerCase());
        SysParm parmPwdMaxHistory = commonDao.findById(SysParm.class,
                PwdPloicyKeys.PWD_MAX_HISTORY.toString().toLowerCase());
        SysParm parmPwdChangeInteval = commonDao.findById(SysParm.class,
                PwdPloicyKeys.PWD_CHANGE_INTERVAL.toString().toLowerCase());
        int minLen = Integer.parseInt(parmPwdMinLen.getParmValue());
        int maxHistory = Integer.parseInt(parmPwdMaxHistory.getParmValue());
        int changeInteval = Integer.parseInt(parmPwdChangeInteval
                .getParmValue());
        String ruleType = parmPwdRule.getParmValue();
        CodeType rule = codeTypeDao.findByCodeTypeAndCodeValue("pwdrule",
                ruleType, CapSecurityContext.getLocale().toString());
        if (StringUtils.isBlank(password) || StringUtils.isBlank(password2)) {
View Full Code Here

        return passwordEncoder.matches(password, user.getPassword());
    }

    @Override
    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()));
View Full Code Here

    @Override
    public Map<String, String> getPasswordPolicy() {
        Map<String, String> result = new HashMap<String, String>();
        for (PwdPloicyKeys value : PwdPloicyKeys.values()) {
            SysParm parm = commonDao.findById(SysParm.class, value.toString()
                    .toLowerCase());
            if (parm != null) {
                result.put(parm.getParmId(), parm.getParmValue());
            }
        }
        return result;
    }
View Full Code Here

        return spe.encode(password);
    }

    @Override
    public int getPasswordChangeNotifyDay(String userId) {
        SysParm parmPwdExpiredDay = commonDao.findById(SysParm.class,
                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) {
View Full Code Here

TOP

Related Classes of com.iisigroup.cap.base.model.SysParm

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.