Package com.jeecms.core.entity.Config

Examples of com.jeecms.core.entity.Config.ConfigLogin


    UnifiedUser user = getByUsername(username);
    if (user == null) {
      return null;
    }
    long now = System.currentTimeMillis();
    ConfigLogin configLogin = configMng.getConfigLogin();
    int maxErrorTimes = configLogin.getErrorTimes();
    int maxErrorInterval = configLogin.getErrorInterval() * 60 * 1000;
    Integer errorCount = user.getErrorCount();
    Date errorTime = user.getErrorTime();
    if (errorCount <= 0 || errorTime == null
        || errorTime.getTime() + maxErrorInterval < now) {
      return maxErrorTimes;
View Full Code Here


  }

  public void updateLoginError(Integer userId, String ip) {
    UnifiedUser user = findById(userId);
    Date now = new Timestamp(System.currentTimeMillis());
    ConfigLogin configLogin = configMng.getConfigLogin();
    int errorInterval = configLogin.getErrorInterval();
    Date errorTime = user.getErrorTime();

    user.setErrorIp(ip);
    if (errorTime == null
        || errorTime.getTime() + errorInterval * 60 * 1000 < now
View Full Code Here

  private void writeCookieErrorRemaining(Integer userErrorRemaining,
      HttpServletRequest request, HttpServletResponse response,
      ModelMap model) {
    // 所有访问的页面都需要写一个cookie,这样可以判断已经登录了几次。
    Integer errorRemaining = getCookieErrorRemaining(request, response);
    ConfigLogin configLogin = configMng.getConfigLogin();
    Integer errorInterval = configLogin.getErrorInterval();
    if (userErrorRemaining != null
        && (errorRemaining == null || userErrorRemaining < errorRemaining)) {
      errorRemaining = userErrorRemaining;
    }
    int maxErrorTimes = configLogin.getErrorTimes();
    if (errorRemaining == null || errorRemaining > maxErrorTimes) {
      errorRemaining = maxErrorTimes;
    } else if (errorRemaining <= 0) {
      errorRemaining = 0;
    } else {
View Full Code Here

  private void writeCookieErrorRemaining(Integer userErrorRemaining,
      HttpServletRequest request, HttpServletResponse response,
      ModelMap model) {
    // 所有访问的页面都需要写一个cookie,这样可以判断已经登录了几次。
    Integer errorRemaining = getCookieErrorRemaining(request, response);
    ConfigLogin configLogin = configMng.getConfigLogin();
    Integer errorInterval = configLogin.getErrorInterval();
    if (userErrorRemaining != null
        && (errorRemaining == null || userErrorRemaining < errorRemaining)) {
      errorRemaining = userErrorRemaining;
    }
    int maxErrorTimes = configLogin.getErrorTimes();
    if (errorRemaining == null || errorRemaining > maxErrorTimes) {
      errorRemaining = maxErrorTimes;
    } else if (errorRemaining <= 0) {
      errorRemaining = 0;
    } else {
View Full Code Here

TOP

Related Classes of com.jeecms.core.entity.Config.ConfigLogin

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.