📄 signbbs_jsp.java
字号:
package org.apache.jsp.bbs;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
import java.util.*;
import java.util.Date;
import java.text.*;
public final class signbbs_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
int admintobz;
private static java.util.Vector _jspx_dependants;
static {
_jspx_dependants = new java.util.Vector(2);
_jspx_dependants.add("/bbs/checkbbsuser.jsp");
_jspx_dependants.add("/bbs/../inc/conn.jsp");
}
public java.util.List getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=gb2312");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write(" \r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write('\r');
out.write('\n');
String username=null;
username = (String)session.getAttribute("name");
if(username==""||username==null)
{
out.print("<script language='javascript'>");
out.print("alert('你还没有登录论坛,请先登录!');");
out.print("history.go(-1);");
out.print("</script>");
out.close();
}
out.write('\r');
out.write('\n');
out.write('\r');
out.write('\n');
out.write('\r');
out.write('\n');
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url="jdbc:odbc:db2000";
Connection conn= DriverManager.getConnection(url);
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
out.write('\r');
out.write('\n');
out.write('\r');
out.write('\n');
String sql,myname;
String id = request.getParameter("id");
String postuser = request.getParameter("postuser");
String bbsname = (String)session.getAttribute("name");
sql="SELECT top 1 BBS_Cate.BBS_Cate_Manager_Name FROM BBS_Cate,bbstitle where BBS_Cate.BBS_Cate_ID = bbstitle.BoardID_2 AND bbstitle.id="+id;
Statement stmt3=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
ResultSet rs3=stmt3.executeQuery(sql);
if(rs3.next()){
myname=rs3.getString("BBS_Cate_Manager_Name");
admintobz=0;
if(myname.indexOf(username)!=-1)
{
admintobz=1;
}
}
if((String)session.getAttribute("bz")=="1"||(String)session.getAttribute("bbsadmin")=="1"||postuser.equals(bbsname)||admintobz==1){
sql="update bbstitle set deleted=1 where id="+id;
stmt.executeUpdate(sql);
response.sendRedirect("main.jsp");
}
else{
out.print("<script language='javascript'>");
out.print("alert('你的权限太低,无法使用此功能!');");
out.print("history.go(-1);");
out.print("</script>");
out.close();
}
stmt.close();
conn.close();
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -