Examples of UserBean


Examples of com.liusoft.dlog4j.beans.UserBean

      HttpServletRequest request, HttpServletResponse response)
      throws Exception {
    BBSReplyForm rform = (BBSReplyForm) form;

    while (true) {
      UserBean loginUser = super.getLoginUser(request, response);
      if (loginUser == null)
        break;
      TopicReplyBean trb = BBSReplyDAO.getTopicReplyByID(rform.getId());
      if (trb == null)
        break;
      if (trb.getUser().getId() != loginUser.getId()
          && loginUser.getOwnSiteId() != rform.getSid())
        break;
      BBSReplyDAO.delete(trb);
      break;
    }
    StringBuffer ext = new StringBuffer();
View Full Code Here

Examples of com.liusoft.dlog4j.beans.UserBean

      HttpServletRequest request, HttpServletResponse response)
      throws Exception {
    BBSTopicForm log = (BBSTopicForm) form;
    super.validateClientId(request, log);
    ActionMessages msgs = new ActionMessages();
    UserBean loginUser = super.getLoginUser(request, response);
    while (true) {
      if (loginUser == null) {
        msgs.add("topic", new ActionMessage("error.user_not_login"));
        break;
      }
      if (loginUser.getStatus() != UserBean.STATUS_NORMAL) {
        msgs.add("topic", new ActionMessage("error.user_not_available"));
        break;
      }
      if (StringUtils.isEmpty(log.getTitle())) {
        msgs.add("title", new ActionMessage("error.empty_not_allowed"));
        break;
      }
      if (StringUtils.isEmpty(log.getContent())) {
        msgs.add("content",
            new ActionMessage("error.empty_not_allowed"));
        break;
      }
      SiteBean site = super.getSiteByID(log.getSid());
      if (site == null) {
        msgs.add("topic", new ActionMessage("error.site_not_available"));
        break;
      }
      //��������
      if(isUserInBlackList(site, loginUser)){
        msgs.add("topic", new ActionMessage("error.user_in_blacklist"));
        break;
      }
      ForumBean forum = BBSForumDAO.getForumByID(log.getForum());
      if (forum == null || forum.getSite().getId() != site.getId()
          || !forum.canCreateOrUpdateTopic(loginUser)) {
        msgs.add("topic", new ActionMessage("error.forum_not_available",
            new Integer(log.getForum())));
        break;
      }     
     
      // ����TopicBean
      TopicBean topic = new TopicBean();
      topic.setUser(loginUser);
      topic.setUsername(loginUser.getName());
      topic.setSite(site);
      // �Է����ı����Լ������Զ����������ִʹ���
      topic.setTitle(super.autoFiltrate(site, log.getTitle()));
      String content = StringUtils.abbreviate(super.autoFiltrate(null,
          log.getContent()), MAX_TOPIC_LENGTH);
      topic.setContent(super.filterScriptAndStyle(content));
      // FIXME: �����ؼ���̫���������ݿ�д��ʧ�ܵ�����
      topic.setKeyword(DLOGSecurityManager.IllegalGlossary
          .deleteIllegalWord(log.getSearchKey()));
      topic.setClient(new ClientInfo(request, log.getClientType()));
      topic.setCreateTime(new Date());
      topic.setForum(forum);
      topic.setStatus(TopicBean.STATUS_NORMAL);
      if(site.getOwner().getId()==loginUser.getId()){
        if (log.getTop() == 1)
          topic.setTop(true);
        if (log.getElite() == 1)
          topic.setElite(true);
      }
      BBSTopicDAO.create(topic, (log.getBookmark() == 1));

      // �����ϴ�����Ϣ
      pickupUploadFileItems(request, response, loginUser.getId(), site, topic
          .getId(), TopicBean.TYPE_BBS);
      break;
    }
    if (!msgs.isEmpty()) {
      saveMessages(request, msgs);
View Full Code Here

Examples of com.liusoft.dlog4j.beans.UserBean

      HttpServletRequest request, HttpServletResponse response)
      throws Exception {
    BBSTopicForm log = (BBSTopicForm) form;
    super.validateClientId(request, log);
    ActionMessages msgs = new ActionMessages();
    UserBean loginUser = super.getLoginUser(request, response);
    while (true) {
      if (loginUser == null) {
        msgs.add("log", new ActionMessage("error.user_not_login"));
        break;
      }
      if (loginUser.getStatus() != UserBean.STATUS_NORMAL) {
        msgs.add("log", new ActionMessage("error.user_not_available"));
        break;
      }
      if (StringUtils.isEmpty(log.getTitle())) {
        msgs.add("title", new ActionMessage("error.empty_not_allowed"));
        break;
      }
      if (StringUtils.isEmpty(log.getContent())) {
        msgs.add("content",
            new ActionMessage("error.empty_not_allowed"));
        break;
      }
      // ����û���Ȩ��
      TopicBean topic = BBSTopicDAO.getTopicByID(log.getId());
      if (topic != null) {
        if (topic.getUser().getId() != loginUser.getId()
            && loginUser.getOwnSiteId() != log.getSid()) {
          msgs.add("bbs", new ActionMessage("error.access_deny"));
          break;
        }
        // �Է����ı����Լ������Զ����������ִʹ���
        String title = super.autoFiltrate(topic.getSite(),log.getTitle());
        if (!StringUtils.equals(title, topic.getTitle()))
          topic.setTitle(title);
        String content = StringUtils.abbreviate(super.autoFiltrate(
            null, log.getContent()), MAX_TOPIC_LENGTH);       
        if (!StringUtils.equals(content, topic.getContent())){
          topic.setContent(super.filterScriptAndStyle(content));
          //�����ı�����(Winter Lau, 2006-5-12)
          TextCacheManager.updateTextContent(
              TopicBean.TYPE_BBS, topic.getId(), topic.getContent());
        }
        String keyword = super.autoFiltrate(topic.getSite(),log.getSearchKey());
        boolean updateTags = false;
        if (!StringUtils.equals(keyword, topic.getKeyword())) {
          topic.setKeyword(keyword);
          updateTags = true;
        }
        topic.setModifyTime(new Date());
        if(topic.getSite().getOwner().getId()==loginUser.getId()){
          topic.setTop(log.getTop() == 1);
          topic.setElite(log.getElite() == 1);
        }
        BBSTopicDAO.update(topic, updateTags);
      }
View Full Code Here

Examples of com.liusoft.dlog4j.beans.UserBean

   */
  public void doValidateLogin(ActionMapping mapping,
      ActionForm form, HttpServletRequest request,
      HttpServletResponse response) throws Exception
  {
    UserBean loginUser = super.getLoginUser(request, response);
    outputPlainMsg(response, String.valueOf((loginUser!=null)?1:0));
  }
View Full Code Here

Examples of com.liusoft.dlog4j.beans.UserBean

      throws Exception
  {
    GuestBookForm msgform = (GuestBookForm)form;
    super.validateClientId(request, msgform);
    if(StringUtils.isNotEmpty(msgform.getReply())){
      UserBean loginUser = super.getLoginUser(request, response);
      if(loginUser!=null){
        //�ж��Ƿ�Ϊվ��
        SiteBean site = SiteDAO.getSiteByID(msgform.getSid());
        if(site!=null && site.isOwner(loginUser)){
          //�ظ�����
View Full Code Here

Examples of com.liusoft.dlog4j.beans.UserBean

      HttpServletRequest request, HttpServletResponse response, String s_msg_id)
      throws Exception
  {
    int msg_id = Integer.parseInt(s_msg_id);
    GuestBookForm msgform = (GuestBookForm)form;
    UserBean loginUser = super.getLoginUser(request, response);
    if(loginUser!=null && loginUser.getOwnSiteId()==msgform.getSid()){
      GuestBookDAO.deleteMsg(msgform.getSid(),msg_id);
    }
    String ext = null;
    if(msgform.getPage()>1)
      ext = "page=" + msgform.getPage();
View Full Code Here

Examples of com.liusoft.dlog4j.beans.UserBean

    while(true){
      if(StringUtils.isEmpty(msgform.getContent())){
        msgs.add("content", new ActionMessage("error.empty_content"));
        break;
      }
      UserBean loginUser = super.getLoginUser(request, response);
      if(loginUser==null){
        msgs.add("message", new ActionMessage("error.user_not_login"));
        break;
      }
      else if(loginUser.getStatus()!=UserBean.STATUS_NORMAL){
        msgs.add("message", new ActionMessage("error.user_not_available"));
        break;
      }
      SiteBean site = super.getSiteByID(msgform.getSid());
      if(site==null){
View Full Code Here

Examples of com.liusoft.dlog4j.beans.UserBean

  protected ActionForward doDeleteAll(ActionMapping mapping,
      ActionForm form, HttpServletRequest request,
      HttpServletResponse response, String s_status) throws Exception      
  {
    MessageForm msg = (MessageForm)form;
    UserBean loginUser = super.getLoginUser(request, response);
    if(loginUser!=null){
      try{
        int status = Integer.parseInt(s_status);
        MessageDAO.deleteMsgs(loginUser.getId(),status);
      }catch(Exception e){
        context().log("delete message where status is "+s_status+" failed.", e);
      }
    }
    return makeForward(mapping.findForward("msgs"), msg.getSid());
View Full Code Here

Examples of com.liusoft.dlog4j.beans.UserBean

  protected ActionForward doDelete(ActionMapping mapping,
      ActionForm form, HttpServletRequest request,
      HttpServletResponse response, String s_msg_id) throws Exception      
  {
    MessageForm msg = (MessageForm)form;
    UserBean loginUser = super.getLoginUser(request, response);
    if(loginUser!=null){
      try{
        int msg_id = Integer.parseInt(s_msg_id);
        MessageDAO.deleteMsg(loginUser.getId(), msg_id);
      }catch(Exception e){
        context().log("delete message #"+s_msg_id+" failed.", e);
      }
    }
    String ext = null;
View Full Code Here

Examples of com.liusoft.dlog4j.beans.UserBean

  protected ActionForward doDeleteMessages(ActionMapping mapping,
      ActionForm form, HttpServletRequest request,
      HttpServletResponse response) throws Exception      
  {
    MessageForm msg = (MessageForm)form;
    UserBean loginUser = super.getLoginUser(request, response);
    if(loginUser!=null){
      String[] mids = request.getParameterValues("mid");
      MessageDAO.deleteMsgs(loginUser.getId(), mids);
    }
    return makeForward(mapping.findForward("msgs"), msg.getSid());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.