Package com.jeecms.cms.entity.main

Examples of com.jeecms.cms.entity.main.CmsUser


  @RequestMapping("/message/v_read.do")
  public String read(Integer id, Integer box, HttpServletRequest request,
      ModelMap model) {

    CmsUser user = CmsUtils.getUser(request);
    CmsReceiverMessage message = receiverMessageMng.findById(id);
    if (message != null) {
      // 阅读收信
      // 收件人查看更新已读状态
      if (message.getMsgReceiverUser().equals(user)) {
View Full Code Here


  }

  @RequestMapping("/message/v_trash.do")
  public void trash(Integer[] ids, HttpServletRequest request,
      HttpServletResponse response, ModelMap model) throws JSONException {
    CmsUser user = CmsUtils.getUser(request);
    JSONObject object = new JSONObject();
    CmsMessage message;
    CmsReceiverMessage receiverMessage;
    if (user == null) {
      object.put("result", false);
View Full Code Here

  }

  @RequestMapping("/message/v_revert.do")
  public void revert(Integer ids[], HttpServletRequest request,
      HttpServletResponse response, ModelMap model) throws JSONException {
    CmsUser user = CmsUtils.getUser(request);
    JSONObject object = new JSONObject();
    CmsReceiverMessage receiverMessage;
    if (user == null) {
      object.put("result", false);
    } else {
View Full Code Here

  }

  @RequestMapping("/message/v_empty.do")
  public void empty(Integer ids[], HttpServletRequest request,
      HttpServletResponse response, ModelMap model) throws JSONException {
    CmsUser user = CmsUtils.getUser(request);
    JSONObject object = new JSONObject();
    CmsMessage message = null;
    CmsReceiverMessage receiverMessage;
    if (user == null) {
      object.put("result", false);
View Full Code Here

  }

  @RequestMapping("/message/v_findUser.do")
  public void findUserByUserName(String username, HttpServletRequest request,
      HttpServletResponse response, ModelMap model) throws JSONException {
    CmsUser user = CmsUtils.getUser(request);
    JSONObject object = new JSONObject();
    if (user == null) {
      object.put("result", false);
    } else {
      Boolean exist = userMng.usernameNotExist(username);
View Full Code Here

  // 查找未读信息条数
  @RequestMapping(value = "/message/v_countUnreadMsg.do")
  public void findUnreadMessagesByUser(HttpServletRequest request,
      HttpServletResponse response, ModelMap model) throws JSONException {
    CmsUser user = CmsUtils.getUser(request);
    CmsSite site = CmsUtils.getSite(request);
    JSONObject object = new JSONObject();
    if (user == null) {
      object.put("result", false);
    } else {
      List<CmsReceiverMessage> receiverMessages = receiverMessageMng
          .getList(site.getId(), null, user.getId(), null, null,
              null, false, 0, false);
      object.put("result", true);
      if (receiverMessages != null && receiverMessages.size() > 0) {
        object.put("count", receiverMessages.size());
      } else {
View Full Code Here

    return user;
  }

  public void updateLoginInfo(Integer userId, String ip) {
    Date now = new Timestamp(System.currentTimeMillis());
    CmsUser user = findById(userId);
    if (user != null) {
      user.setLoginCount(user.getLoginCount() + 1);
      user.setLastLoginIp(ip);
      user.setLastLoginTime(now);
    }
  }
View Full Code Here

      user.setLastLoginTime(now);
    }
  }

  public void updateUploadSize(Integer userId, Integer size) {
    CmsUser user = findById(userId);
    user.setUploadTotal(user.getUploadTotal() + size);
    if (user.getUploadDate() != null) {
      if (CmsUser.isToday(user.getUploadDate())) {
        size += user.getUploadSize();
      }
    }
    user.setUploadDate(new java.sql.Date(System.currentTimeMillis()));
    user.setUploadSize(size);
  }
View Full Code Here

  public boolean isPasswordValid(Integer id, String password) {
    return unifiedUserMng.isPasswordValid(id, password);
  }

  public void updatePwdEmail(Integer id, String password, String email) {
    CmsUser user = findById(id);
    if (!StringUtils.isBlank(email)) {
      user.setEmail(email);
    } else {
      user.setEmail(null);
    }
    unifiedUserMng.update(id, password, email);
  }
View Full Code Here

      Integer groupId, Integer[] roleIds, Integer[] channelIds,
      Integer[] siteIds, Byte[] steps, Boolean[] allChannels,
      CmsUserExt userExt) {
    UnifiedUser unifiedUser = unifiedUserMng.save(username, email,
        password, ip);
    CmsUser user = new CmsUser();
    user.forAdmin(unifiedUser, viewOnly, selfAdmin, rank);
    CmsGroup group = null;
    if (groupId != null) {
      group = cmsGroupMng.findById(groupId);
    } else {
      group = cmsGroupMng.getRegDef();
    }
    if (group == null) {
      throw new RuntimeException(
          "register default member group not setted!");
    }
    user.setGroup(group);
    user.init();
    dao.save(user);
    cmsUserExtMng.save(userExt, user);
    if (roleIds != null) {
      for (Integer rid : roleIds) {
        user.addToRoles(cmsRoleMng.findById(rid));
      }
    }
    if (channelIds != null) {
      Channel channel;
      for (Integer cid : channelIds) {
View Full Code Here

TOP

Related Classes of com.jeecms.cms.entity.main.CmsUser

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.