📄 _setup5__jsp.java
字号:
/*
* JSP generated by Resin 2.1.4 (built Fri Aug 2 14:16:52 PDT 2002)
*/
package _setup;
import javax.servlet.*;
import javax.servlet.jsp.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
import java.sql.*;
import java.security.*;
import org.ehotsoft.yekki.sql.ConnectionManager;
import org.ehotsoft.yekki.util.PropertyManager;
import org.ehotsoft.yekki.util.StringUtil;
import org.ehotsoft.yekki.util.ParamUtil;
public class _setup5__jsp extends com.caucho.jsp.JavaPage{
private boolean _caucho_isDead;
public void
_jspService(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException
{
com.caucho.jsp.QPageContext pageContext = (com.caucho.jsp.QPageContext) com.caucho.jsp.QJspFactory.create().getPageContext(this, request, response, null, true, 8192, true);
javax.servlet.jsp.JspWriter out = (javax.servlet.jsp.JspWriter) pageContext.getOut();
javax.servlet.ServletConfig config = getServletConfig();
javax.servlet.Servlet page = this;
javax.servlet.http.HttpSession session = pageContext.getSession();
javax.servlet.ServletContext application = pageContext.getServletContext();
response.setContentType("text/html;charset=gb2312");
request.setCharacterEncoding("GB2312");
try {
pageContext.write(_jsp_string0, 0, _jsp_string0.length);
pageContext.write(_jsp_string0, 0, _jsp_string0.length);
pageContext.write(_jsp_string0, 0, _jsp_string0.length);
pageContext.write(_jsp_string0, 0, _jsp_string0.length);
pageContext.write(_jsp_string0, 0, _jsp_string0.length);
pageContext.write(_jsp_string0, 0, _jsp_string0.length);
//DbConnectionProvider conProvider = DbConnectionManager.getDbConnectionProvider();
pageContext.write(_jsp_string0, 0, _jsp_string0.length);
boolean error = false;
String errorMessage = null;
//Make sure the install has not already been completed.
String setup = PropertyManager.getProperty("setup");
if( setup != null && setup.equals("true") ) {
error = true;
errorMessage = "Yekki 安装已经完成.如果你想" +
"重新运行本工具, 须从Yekki属性中删除'setup=true'" +
"文件.";
}
pageContext.write(_jsp_string1, 0, _jsp_string1.length);
// get parameters
boolean createAdmin = ParamUtil.getBooleanParameter(request,"createAdmin");
String username = ParamUtil.getStringParameter(request,"username");
String password = ParamUtil.getStringParameter(request,"password");
if (password == null) {
password = "";
}
String confirmPassword = ParamUtil.getStringParameter(request,"confirmPassword");
if (confirmPassword == null) {
confirmPassword = "";
}
String name = ParamUtil.getStringParameter(request,"name");
String email = ParamUtil.getStringParameter(request,"email");
if( name == null ) { name = ""; }
if( createAdmin ) {
if (! password.equals(confirmPassword)) {
error = true;
errorMessage = "密码不匹配.请按后退按纽,重新输入.";
}
else {
Connection con = null;
Statement stmt = null;
PreparedStatement pstmt = null;
try {
String sql = "insert into jiveUser(userID,username,passwordHash,name,email,emailVisible,nameVisible) "
+ " values(?,?,?,?,?,?,?)";
password = StringUtil.hash(password);
con = ConnectionManager.getConnection();
if( con == null ) {
error = true;
errorMessage = "不能访问数据库Could not access the database. Make sure that you completed the database " +
"setup step correctly.";
}
else {
pstmt = con.prepareStatement(sql);
pstmt.setInt(1,1);
pstmt.setString(2,username);
pstmt.setString(3,password);
pstmt.setString(4,name);
pstmt.setString(5,email);
pstmt.setInt(6,1);
pstmt.setInt(7,1);
pstmt.executeUpdate();
pstmt.close();
stmt = con.createStatement();
stmt.executeUpdate("insert into jiveUserPerm(forumID,userID,permission) values(-1,1,0)");
stmt.executeUpdate("insert into jiveUserPerm(forumID,userID,permission) values(-1,1,1)");
stmt.executeUpdate("insert into jiveUserPerm(forumID,userID,permission) values(-1,1,2)");
stmt.executeUpdate("insert into jiveUserPerm(forumID,userID,permission) values(-1,1,3)");
stmt.executeUpdate("insert into jiveUserPerm(forumID,userID,permission) values(-1,1,4)");
stmt.executeUpdate("insert into jiveUserPerm(forumID,userID,permission) values(-1,1,5)");
stmt.executeUpdate("insert into jiveUserPerm(forumID,userID,permission) values(-1,1,6)");
stmt.executeUpdate("insert into jiveUserPerm(forumID,userID,permission) values(-1,1,7)");
//stmt.executeUpdate("insert into jiveUserPerm(forumID,userID,permission) values(-1,-1,0)");
//stmt.executeUpdate("insert into jiveUserPerm(forumID,userID,permission) values(-1,-1,6)");
//stmt.executeUpdate("insert into jiveUserPerm(forumID,userID,permission) values(-1,-1,7)");
stmt.close();
}
if( !error ) {
out.println( "ok");
response.sendRedirect("setup6.jsp");
return;
}
}
catch( SQLException sqle ) {
System.err.println( sqle );
sqle.printStackTrace();
error = true;
errorMessage = "在数据库中创建管理员错误. 有一些 " +
"可能的原因如下: <ul> <li>Yekki 不可能建立一个连接 " +
"和你的数据库. <li>你忘记的安装 Yekki 数据库计划. <li> " +
"你已经创建一个管理员帐号在你以前用此" +
"安装工具. </ul> <p>" +
"你可以检查你的日志文件去发现更多的信息关于" +
"此错误. 请修复问题,按后退按纽, " +
"重新创建管理员";
}
finally {
try {
con.close();
} catch (Exception e) { }
}
}
}
pageContext.write(_jsp_string2, 0, _jsp_string2.length);
if (!error) {
pageContext.write(_jsp_string3, 0, _jsp_string3.length);
} //end no error
else {
pageContext.write(_jsp_string4, 0, _jsp_string4.length);
out.print(( errorMessage ));
pageContext.write(_jsp_string5, 0, _jsp_string5.length);
} //end error
pageContext.write(_jsp_string6, 0, _jsp_string6.length);
} catch (java.lang.Throwable _jsp_e) {
pageContext.handlePageException(_jsp_e);
} finally {
JspFactory.getDefaultFactory().releasePageContext(pageContext);
}
}
private com.caucho.java.LineMap _caucho_line_map;
private java.util.ArrayList _caucho_depends = new java.util.ArrayList();
public boolean _caucho_isModified()
{
if (_caucho_isDead)
return true;
if (com.caucho.util.CauchoSystem.getVersionId() != 2057024146)
return true;
for (int i = _caucho_depends.size() - 1; i >= 0; i--) {
com.caucho.vfs.Depend depend;
depend = (com.caucho.vfs.Depend) _caucho_depends.get(i);
if (depend.isModified())
return true;
}
return false;
}
public long _caucho_lastModified()
{
return 0;
}
public com.caucho.java.LineMap _caucho_getLineMap()
{
return _caucho_line_map;
}
public void destroy()
{
_caucho_isDead = true;
super.destroy();
}
public void init(com.caucho.java.LineMap lineMap,
com.caucho.vfs.Path appDir)
throws javax.servlet.ServletException
{
com.caucho.vfs.Path resinHome = com.caucho.util.CauchoSystem.getResinHome();
com.caucho.vfs.MergePath mergePath = new com.caucho.vfs.MergePath();
mergePath.addMergePath(appDir);
mergePath.addMergePath(resinHome);
mergePath.addClassPath(getClass().getClassLoader());
_caucho_line_map = new com.caucho.java.LineMap("_setup5__jsp.java", "/setup/setup5.jsp");
_caucho_line_map.add(9, 1);
_caucho_line_map.add(1, 35);
_caucho_line_map.add(6, 37);
_caucho_line_map.add(13, 45);
_caucho_line_map.add(126, 150);
_caucho_line_map.add(172, 154);
_caucho_line_map.add(179, 159);
_caucho_line_map.add(182, 161);
com.caucho.vfs.Depend depend;
depend = new com.caucho.vfs.Depend(mergePath.lookup("doc/setup/setup5.jsp"), 1030450275136L, 6060L);
_caucho_depends.add(depend);
}
private static byte []_jsp_string6;
private static byte []_jsp_string2;
private static byte []_jsp_string3;
private static byte []_jsp_string5;
private static byte []_jsp_string1;
private static byte []_jsp_string0;
private static byte []_jsp_string4;
static {
try {
_jsp_string6 = "\r\n\r\n<p> 如果你已经创建了管理员帐号,你可以<a href=\"setup6.jsp\"> 跳过这一步</a>. \r\n<p>\r\n\r\n</body>\r\n</html>\r\n\r\n\r\n".getBytes("GB2312");
_jsp_string2 = "\r\n\r\n<html>\r\n<head>\r\n <title>Yekki 安装 - 第五步</title>\r\n <link rel=\"stylesheet\" href=\"style/global.css\">\r\n</head>\r\n\r\n<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#0000FF\" vlink=\"#800080\" alink=\"#FF0000\" background=\"../images/background.gif\">\r\n<p> \r\n ".getBytes("GB2312");
_jsp_string3 = "\r\n <b>创建一个管理员帐号</b>\r\n<ul>\r\n 一个管理员帐号将允许你去管理你的Yekki副本. 一定要记住你的密码? 如果你忘记了, 你将重新设置它. <form action=\"setup5.jsp\" mode=\"post\"> \r\n <input type=\"hidden\" name=\"createAdmin\" value=\"true\">\r\n <table cellpadding=\"3\" cellspacing=\"0\" border=\"0\">\r\n <tr> \r\n <td><font size=\"-1\">姓名</font></td>\r\n <td> \r\n <input type=\"text\" size=\"30\" name=\"name\" value=\"\">\r\n </td>\r\n </tr>\r\n <tr> \r\n <td><font size=\"-1\">用户名</font></td>\r\n <td> \r\n <input type=\"text\" size=\"30\" name=\"username\" value=\"\">\r\n </td>\r\n </tr>\r\n <tr> \r\n <td><font size=\"-1\">电子邮件</font></td>\r\n <td> \r\n <input type=\"text\" size=\"30\" name=\"email\" value=\"\">\r\n </td>\r\n </tr>\r\n <tr> \r\n <td><font size=\"-1\">密码</font></td>\r\n <td> \r\n <input type=\"password\" size=\"30\" name=\"password\" value=\"\">\r\n </td>\r\n </tr>\r\n <tr> \r\n <td><font size=\"-1\">确认密码</font><br>\r\n <font size=\"-1\"></font></td>\r\n <td> \r\n <input type=\"password\" size=\"30\" name=\"confirmPassword\" value=\"\">\r\n </td>\r\n </tr>\r\n </table>\r\n</ul>\r\n\r\n<center>\r\n <input type=\"submit\" value=\"创建管理员\">\r\n</center>\r\n\r\n".getBytes("GB2312");
_jsp_string5 = "\r\n \r\n </font>\r\n".getBytes("GB2312");
_jsp_string1 = "\r\n\r\n".getBytes("GB2312");
_jsp_string0 = "\r\n".getBytes("GB2312");
_jsp_string4 = "\r\n <font color=\"Red\">错误!</font>\r\n <p><font size=2>\r\n \r\n ".getBytes("GB2312");
} catch (java.io.UnsupportedEncodingException e) {
e.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -