📄 posttag.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: PostTag.java
package com.laoer.bbscs.web.tag;
import com.laoer.bbscs.bean.Boards;
import com.laoer.bbscs.sys.*;
import com.laoer.bbscs.web.form.PostForm;
import com.laoer.bbscs.web.servlet.UserCheck;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.TagSupport;
import org.apache.struts.util.*;
public class PostTag extends TagSupport
{
private String scope;
private String type;
private String userCheck;
private long bid;
private String form;
private String property;
public PostTag()
{
scope = null;
type = null;
userCheck = null;
bid = 0L;
form = null;
property = null;
}
public String getScope()
{
return scope;
}
public void setScope(String scope)
{
this.scope = scope;
}
public String getType()
{
return type;
}
public void setType(String type)
{
this.type = type;
}
public String getUserCheck()
{
return userCheck;
}
public void setUserCheck(String userCheck)
{
this.userCheck = userCheck;
}
public long getBid()
{
return bid;
}
public void setBid(long bid)
{
this.bid = bid;
}
public int doStartTag()
throws JspException
{
return 0;
}
public int doEndTag()
throws JspException
{
UserCheck uc = (UserCheck)RequestUtils.lookup(pageContext, userCheck, scope);
HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
if(uc == null)
{
HttpServletResponse response = (HttpServletResponse)pageContext.getResponse();
if(this.form == null || property == null)
{
uc = new UserCheck(request, response, bid);
} else
{
Object value = RequestUtils.lookup(pageContext, this.form, property, scope);
uc = new UserCheck(request, response, ((Long)value).longValue());
}
}
if(type.equals("votenotice"))
{
StringBuffer sb = new StringBuffer();
sb.append(Constant.MESSAGE.getMessage(request.getLocale(), "post.youatboardsvote", uc.getBs().getBoardsName(), uc.getBs().getBoardsEName()));
ResponseUtils.write(pageContext, sb.toString());
return 0;
}
if(type.equals("notice"))
{
PostForm form = (PostForm)RequestUtils.lookup(pageContext, "postForm", scope);
StringBuffer sb = new StringBuffer();
sb.append(Constant.MESSAGE.getMessage(request.getLocale(), "post.youatboards", uc.getBs().getBoardsName(), uc.getBs().getBoardsEName()));
sb.append(" ");
if(SysInfo.getInstance().getPosthtml() == 1 && SysInfo.getInstance().getHtmledit() == 1 && uc.getBs().getAttrib2() == 1)
{
if(form.getAction().equals("add"))
if(form.getUseedit().equals("no"))
sb.append(Constant.MESSAGE.getMessage(request.getLocale(), "post.cannotpost", "post" + Constant.FILEPREFIX + "?bid=" + uc.getBid() + "&action=new&useedit=yes"));
else
sb.append(Constant.MESSAGE.getMessage(request.getLocale(), "post.cannotpost1", "post" + Constant.FILEPREFIX + "?bid=" + uc.getBid() + "&action=new&useedit=no"));
if(form.getAction().equals("addre"))
if(form.getUseedit().equals("no"))
sb.append(Constant.MESSAGE.getMessage(request.getLocale(), "post.cannotpost", "post" + Constant.FILEPREFIX + "?bid=" + uc.getBid() + "&action=re&useedit=yes&id=" + form.getId() + "&mainid=" + form.getMainid() + "&page=" + form.getPage() + "&totalnum=" + form.getTotalnum() + "&title=" + SysUtil.encodeURL(form.getTitle(), Constant.CHARSET)));
else
sb.append(Constant.MESSAGE.getMessage(request.getLocale(), "post.cannotpost1", "post" + Constant.FILEPREFIX + "?bid=" + uc.getBid() + "&action=re&useedit=no&id=" + form.getId() + "&mainid=" + form.getMainid() + "&page=" + form.getPage() + "&totalnum=" + form.getTotalnum() + "&title=" + SysUtil.encodeURL(form.getTitle(), Constant.CHARSET)));
}
ResponseUtils.write(pageContext, sb.toString());
return 0;
}
if(type.equals("upfile"))
{
StringBuffer sb = new StringBuffer();
if(SysInfo.getInstance().getUpfile() == 1 && uc.getBs().getAttrib9() == 1)
{
sb.append("<input type=\"file\" name=\"upfile\" class=\"INPUT1\"><br>");
sb.append(Constant.MESSAGE.getMessage(request.getLocale(), "post.upnotice", String.valueOf(SysInfo.getInstance().getUpfilesize()), SysInfo.getInstance().getUpfilename()));
}
ResponseUtils.write(pageContext, sb.toString());
return 0;
} else
{
return 0;
}
}
public String getForm()
{
return form;
}
public void setForm(String form)
{
this.form = form;
}
public String getProperty()
{
return property;
}
public void setProperty(String property)
{
this.property = property;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -