Package com.liusoft.dlog4j.beans

Examples of com.liusoft.dlog4j.beans.SiteBean


   * ��ȡ��ǰ���ڷ��ʵ���վ�������ǵ��ù�validateSiteOwner����ͨ���÷�����ȡ����վ��Ϣ
   * @param req
   * @return
   */
  protected static SiteBean getSiteBean(HttpServletRequest req){
    SiteBean site = (SiteBean)req.getAttribute(KEY_SITE);
    if(site == null){
      try{
        int site_id = Integer.parseInt(req.getParameter(Globals.PARAM_SID));
        site = SiteDAO.getSiteByID(site_id);
        if(site!=null)
View Full Code Here


    do{
      if (form.getSid() < 1) {
        msgs.add("site", new ActionMessage("error.site_not_available"));
        break;
      }
      SiteBean site = getSiteByID(form.getSid());
      if (site == null) {
        msgs.add("site", new ActionMessage("error.site_not_available"));
        break;
      }
      UserBean loginUser = getLoginUser(req, res);
      if (loginUser == null) {
        msgs.add("user", new ActionMessage("error.user_not_login"));
        break;
      }
      if (loginUser.getStatus() != UserBean.STATUS_NORMAL) {
        msgs.add("user", new ActionMessage("error.user_not_available"));
        break;
      }
      if (!site.isOwner(loginUser)) {
        msgs.add("user", new ActionMessage("error.access_deny"));
        break;
      }
      req.setAttribute(KEY_SITE, site);
      req.setAttribute(KEY_USER, loginUser);
View Full Code Here

      }
      if (loginUser.getStatus() != UserBean.STATUS_NORMAL) {
        msgs.add("reply", new ActionMessage("error.user_not_available"));
        break;
      }
      SiteBean site = getSiteByID(rform.getSid());
      if (site == null) {
        msgs.add("reply", new ActionMessage("error.site_not_available"));
        break;
      }
      //��������
      if(isUserInBlackList(site, loginUser)){
        msgs.add("reply", new ActionMessage("error.user_in_blacklist"));
        break;
      }
      TopicOutlineBean topic = BBSTopicDAO.getTopicOutlineByID(rform.getTid());
      if (topic == null
          || topic.getStatus() != TopicBean.STATUS_NORMAL
          || topic.getSite().getId() != site.getId()
          || !topic.getForum().canCreateOrUpdateTopic(loginUser)) {
        msgs.add("log", new ActionMessage("error.topic_not_available",
            new Integer(rform.getTid())));
        break;
      }
View Full Code Here

      }
      if (loginUser.getStatus() != UserBean.STATUS_NORMAL) {
        msgs.add("reply", new ActionMessage("error.user_not_available"));
        break;
      }
      SiteBean site = super.getSiteByID(rform.getSid());
      if (site == null) {
        msgs.add("reply", new ActionMessage("error.site_not_available"));
        break;
      }
      TopicReplyBean rbean = BBSReplyDAO.getTopicReplyByID(rform.getId());
View Full Code Here

      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);
      }
View Full Code Here

    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)){
          //�ظ�����
          GuestBookBean gbean = GuestBookDAO.getMsg(msgform.getSid(), msgform.getId());
          if(gbean!=null){
            String reply = super.autoFiltrate(site,msgform.getReply());           
            if(reply.length()>MAX_GB_REPLY_LENGTH)
View Full Code Here

      }
      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){
        msgs.add("message", new ActionMessage("error.site_not_available"));
        break;
      }
      //��������
      if(isUserInBlackList(site, loginUser)){
        msgs.add("message", new ActionMessage("error.user_in_blacklist"));
        break;
      }
      GuestBookBean msgbean = new GuestBookBean();
      String content = super.autoFiltrate(site,msgform.getContent());
      if(content.length()>MAX_GB_COUNT_LENGTH)
        content = content.substring(0, MAX_GB_COUNT_LENGTH);
      msgbean.setContent(super.filterScriptAndStyle(content));
      msgbean.setClient(new ClientInfo(request, 0));
      msgbean.setUser(loginUser);
      msgbean.setSiteId(site.getId());
      try{
        GuestBookDAO.createMsg(msgbean);
      }catch(HibernateException e){
        context().log("undelete diary failed.", e);
        msgs.add("message", new ActionMessage("error.database", e.getMessage()));
View Full Code Here

    final BBSSearchForm sform = (BBSSearchForm)form;
    if(StringUtils.isEmpty(sform.getKey())){
      return mapping.getInputForward();
    }
    //������������
    final SiteBean site = super.getSiteByID(sform.getId());

    SearchParameter param = new SearchParameter() {
      public String getSearchKey() {
        return sform.getKey();
      }
      public HashMap getConditions() {
        HashMap conds = new HashMap();
        if (site != null) {
          conds.put("site.id", new Integer(site.getId()));
        }
        if(sform.getFid()>0){
          conds.put("forum.id", new Integer(sform.getFid()));
        }
        return conds;
View Full Code Here

    if(StringUtils.isEmpty(forum.getName())){
      msgs.add("name", new ActionMessage("error.forum_name_empty"));
    }
    else{     
      super.validateClientId(request, forum);
      SiteBean site = super.getSiteBean(request);
      ForumBean fbean = new ForumBean();
      fbean.setName(forum.getName());
      if(!StringUtils.isEmpty(forum.getDesc()))
        fbean.setDesc(forum.getDesc());
      fbean.setCreateTime(new Date());
View Full Code Here

    } else if (DLOGSecurityManager.IllegalGlossary.existIllegalWord(album.getName())){
      msgs.add("name", new ActionMessage("error.illegal_glossary"));
    } else if (DLOGSecurityManager.IllegalGlossary.existIllegalWord(album.getDesc())){
      msgs.add("desc", new ActionMessage("error.illegal_glossary"));
    } else {
      SiteBean site = super.getSiteBean(request);
      AlbumBean abean = new AlbumBean();
      abean.setName(super.autoFiltrate(site, album.getName()));
      if (StringUtils.isNotEmpty(album.getDesc())){
        String desc = super.autoFiltrate(site, album.getDesc());
        abean.setDesc(super.filterScriptAndStyle(desc));
View Full Code Here

TOP

Related Classes of com.liusoft.dlog4j.beans.SiteBean

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.