Package com.jeecms.core.entity

Examples of com.jeecms.core.entity.Authentication


    Pagination page = findByCriteria(crit, pageNo, pageSize);
    return page;
  }

  public Authentication findById(String id) {
    Authentication entity = get(id);
    return entity;
  }
View Full Code Here


    getSession().save(bean);
    return bean;
  }

  public Authentication deleteById(String id) {
    Authentication entity = super.get(id);
    if (entity != null) {
      getSession().delete(entity);
    }
    return entity;
  }
View Full Code Here

  public Authentication login(String username, String password, String ip,
      HttpServletRequest request, HttpServletResponse response,
      SessionProvider session) throws UsernameNotFoundException,
      BadCredentialsException {
    UnifiedUser user = unifiedUserMng.login(username, password, ip);
    Authentication auth = new Authentication();
    auth.setUid(user.getId());
    auth.setUsername(user.getUsername());
    auth.setEmail(user.getEmail());
    auth.setLoginIp(ip);
    save(auth);
    session.setAttribute(request, response, AUTH_KEY, auth.getId());
    return auth;
  }
View Full Code Here

 
  public Authentication activeLogin(UnifiedUser user, String ip,
      HttpServletRequest request, HttpServletResponse response,
      SessionProvider session) {
    unifiedUserMng.activeLogin(user, ip);
    Authentication auth = new Authentication();
    auth.setUid(user.getId());
    auth.setUsername(user.getUsername());
    auth.setEmail(user.getEmail());
    auth.setLoginIp(ip);
    save(auth);
    session.setAttribute(request, response, AUTH_KEY, auth.getId());
    return auth;
  }
View Full Code Here

    if (refreshTime < current) {
      refreshTime = getNextRefreshTime(current, interval);
      int count = dao.deleteExpire(new Date(current - timeout));
      log.info("refresh Authentication, delete count: {}", count);
    }
    Authentication auth = findById(authId);
    if (auth != null && auth.getUpdateTime().getTime() + timeout > current) {
      auth.setUpdateTime(new Timestamp(current));
      return auth;
    } else {
      return null;
    }
  }
View Full Code Here

      HttpServletRequest request) {
    String authId = (String) session.getAttribute(request, AUTH_KEY);
    if (authId == null) {
      return null;
    }
    Authentication auth = retrieve(authId);
    if (auth == null) {
      return null;
    }
    return auth.getUid();
  }
View Full Code Here

    return page;
  }

  @Transactional(readOnly = true)
  public Authentication findById(String id) {
    Authentication entity = dao.findById(id);
    return entity;
  }
View Full Code Here

    dao.save(bean);
    return bean;
  }

  public Authentication deleteById(String id) {
    Authentication bean = dao.deleteById(id);
    return bean;
  }
View Full Code Here

    String returnUrl = RequestUtils.getQueryParam(request, RETURN_URL);
    String message = RequestUtils.getQueryParam(request, MESSAGE);
    String authId = (String) session.getAttribute(request, AUTH_KEY);
    if (authId != null) {
      // 存在认证ID
      Authentication auth = authMng.retrieve(authId);
      // 存在认证信息,且未过期
      if (auth != null) {
        String view = getView(processUrl, returnUrl, auth.getId());
        if (view != null) {
          return view;
        } else {
          model.addAttribute("auth", auth);
          return LOGIN_SUCCESS;
View Full Code Here

      String returnUrl, String message, HttpServletRequest request,
      HttpServletResponse response, ModelMap model) {
    WebErrors errors = validateSubmit(username, password, request);
    if (!errors.hasErrors()) {
      try {
        Authentication auth = authMng.login(username, password,
            RequestUtils.getIpAddr(request), request, response,
            session);
        String view = getView(processUrl, returnUrl, auth.getId());
        if (view != null) {
          return view;
        } else {
          model.addAttribute("auth", auth);
          return LOGIN_SUCCESS;
View Full Code Here

TOP

Related Classes of com.jeecms.core.entity.Authentication

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.