⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 move.java

📁 反ajax原代码
💻 JAVA
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   Move.java

package com.laoer.bbscs.web.action;

import com.laoer.bbscs.bean.*;
import com.laoer.bbscs.business.IForumService;
import com.laoer.bbscs.sys.*;
import com.laoer.bbscs.web.form.MoveForm;
import com.laoer.bbscs.web.servlet.UserCheck;
import com.laoer.comm.util.FileIO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.*;
import org.apache.struts.util.MessageResources;

// Referenced classes of package com.laoer.bbscs.web.action:
//            BaseAction

public class Move extends BaseAction
{

    public Move()
    {
    }

    public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
    {
        ActionErrors errors = new ActionErrors();
        MoveForm form = (MoveForm)actionForm;
        UserCheck uc = getUserCheck(httpServletRequest, httpServletResponse, form.getBid());
        if(uc.isGuest())
        {
            errors.add("error.pleaselogin", new ActionError("error.pleaselogin"));
            saveErrors(httpServletRequest, errors);
            return SysUtil.getPassLogin(actionMapping);
        }
        if(uc.getBs() == null)
        {
            errors.add("error.baordsno", new ActionError("error.baordsno"));
            saveErrors(httpServletRequest, errors);
            return actionMapping.findForward("error");
        }
        httpServletRequest.setAttribute("uc", uc);
        if(form.getAction().equals("show"))
        {
            form.setAction("move");
            return actionMapping.findForward("move");
        }
        if(form.getAction().equals("move"))
        {
            uc = getUserCheck(httpServletRequest, httpServletResponse, form.getMoveto());
            if(uc.getBs() == null)
            {
                errors.add("error.baordsno", new ActionError("error.baordsno"));
                saveErrors(httpServletRequest, errors);
                return actionMapping.findForward("error");
            }
            if(!uc.isCanPost())
            {
                errors.add("error.forum.cannotpost", new ActionError("error.forum.cannotpost"));
                saveErrors(httpServletRequest, errors);
                return actionMapping.findForward("error");
            }
            if(uc.getPower() <= 0 && !uc.isCanPostNotNeedExp())
            {
                errors.add("nopower", new ActionError("error.post.nopower"));
                saveErrors(httpServletRequest, errors);
                return actionMapping.findForward("error");
            }
            com.laoer.bbscs.bean.UserInfo ui = getUserCache().getUserInfoFromCache(uc.getId());
            if(ui == null)
            {
                errors.add("error.getusererror", new ActionError("error.getusererror"));
                saveErrors(httpServletRequest, errors);
                return actionMapping.findForward("error");
            }
            MessageResources messages = getResources(httpServletRequest);
            java.util.Locale locale = getLocale(httpServletRequest);
            Forum forum = getForumService().getForum(form.getId(), form.getBid());
            if(forum == null)
            {
                errors.add("getpost", new ActionError("error.post.getpost"));
                saveErrors(httpServletRequest, errors);
                return actionMapping.findForward("error");
            }
            String content = messages.getMessage(locale, "zhuantie.zhuanzaizi", forum.getBoardName(), forum.getUserName(), forum.getTitle()) + "<br>" + FileIO.readFile(SysUtil.getForumPath(forum.getBoardID(), forum.getPostTime()) + forum.getDetail(), Constant.CHARSET);
            long atime = SysUtil.getLongTime();
            String IP = httpServletRequest.getRemoteAddr();
            Forum toforum = ForumFactory.getInstance(form.getMoveto());
            toforum.setAgree(0);
            toforum.setAmend("");
            toforum.setArtSize(forum.getArtSize());
            toforum.setAuditing(uc.getBs().getAttrib8());
            toforum.setBeAgainst(0);
            toforum.setBoardID(form.getMoveto());
            toforum.setBoardName(uc.getBs().getBoardsName());
            toforum.setCanNotDel((short)0);
            toforum.setCanNotRe((short)0);
            toforum.setCanReadExp(0);
            toforum.setClick(0);
            toforum.setDelIP("");
            toforum.setDelSign((short)0);
            toforum.setDelTime(0L);
            toforum.setDelUserID(0L);
            toforum.setDelUserName("");
            toforum.setDetail(content);
            toforum.setDoEliteName("");
            toforum.setDoEliteTime(0L);
            toforum.setElite(0L);
            toforum.setEliteID(0L);
            toforum.setEmailInform((short)0);
            toforum.setFace(forum.getFace());
            toforum.setHavePic((short)0);
            toforum.setId1(0L);
            toforum.setId2(0L);
            toforum.setIpAddress(IP);
            toforum.setIsB((short)0);
            toforum.setIsLock((short)0);
            toforum.setIsNew((short)1);
            toforum.setIsTop((short)0);
            toforum.setIsVote((short)0);
            toforum.setLastPostNickName("---");
            toforum.setLastPostTitle("---");
            toforum.setLastPostUserName("---");
            toforum.setLastTime(atime);
            toforum.setMsgInform((short)0);
            toforum.setNickName(uc.getNickname());
            toforum.setPicName("");
            toforum.setPostTime(atime);
            toforum.setReNum(0);
            toforum.setSign("");
            toforum.setTitle(messages.getMessage(locale, "zhuantie.zhuanzai") + forum.getTitle());
            toforum.setUserID(uc.getId());
            toforum.setUserName(uc.getUsername());
            toforum.setVtime("");
            Result r = getForumService().createForum("new", toforum, uc, null);
            if(!r.isRight())
            {
                errors.add("posterror", new ActionError(r.getMsg()));
                saveErrors(httpServletRequest, errors);
                return actionMapping.findForward("error");
            }
            toforum = (Forum)r.getObject();
            if(forum.getHavePic() != 0 && forum.getPicName() != null && uc.getBs().getAttrib9() == 1)
            {
                toforum.setHavePic(forum.getHavePic());
                String picFileName = "file_" + toforum.getId().longValue() + "_" + toforum.getPostTime() + SysUtil.getFileExt(forum.getPicName());
                toforum.setPicName(picFileName);
                SysUtil.cpoyFile(SysUtil.getUpFilePath(forum.getBoardID(), forum.getPostTime()) + forum.getPicName(), SysUtil.getUpFilePath(toforum.getBoardID(), toforum.getPostTime()) + picFileName);
                getForumService().saveForum(toforum);
            }
            ActionForward forward = new ActionForward(SysUtil.getResultUrl("zhuantie.ok", "read" + Constant.FILEPREFIX + "?bid=" + form.getBid() + "&id=" + form.getMainid() + "&page=" + form.getPage() + "&inpages=" + form.getInpages()), true);
            return forward;
        } else
        {
            return actionMapping.findForward("error");
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -