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

📄 _setup5__jsp.java

📁 JSP聊天系统
💻 JAVA
字号:
/*
 * JSP generated by Resin 2.1.2 (built Tue Jun 11 08:26:56 PDT 2002)
 */

package _admin._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");
    try {
      
/**
 * Jive Setup Tool
 * November 28, 2000
 */

      pageContext.write(_jsp_string0, 0, _jsp_string0.length);
      pageContext.write(_jsp_string1, 0, _jsp_string1.length);
      pageContext.write(_jsp_string1, 0, _jsp_string1.length);
      pageContext.write(_jsp_string1, 0, _jsp_string1.length);
      pageContext.write(_jsp_string1, 0, _jsp_string1.length);
      pageContext.write(_jsp_string1, 0, _jsp_string1.length);
      
	//DbConnectionProvider conProvider = DbConnectionManager.getDbConnectionProvider();

      pageContext.write(_jsp_string1, 0, _jsp_string1.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 = "Jive setup appears to have already been completed. If you'd like " +
			"to re-run this tool, delete the 'setup=true' property from your jive.properties " +
			"file.";
	}

      pageContext.write(_jsp_string0, 0, _jsp_string0.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 = "Passwords did not match. Please press the back button and retype them carefully.";
		}
		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 = "Error creating an administrator in the database. There are a few " +
					"possible reasons for this error: <ul> <li>Jive is unable to establish a connection " +
					"with your database. <li> Your forgot to install the Jive database schema. <li> " +
					"You already created an administrator account during a previous use of the " +
					"setup tool. </ul> <p>" +
					"You can examine your log files to see if more information about " +
					"this error is available there. Please fix the problem, press the back button, " +
					"and then try to create the administrator again."; 
			}
			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() != 2057024144)
      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", "/admin/setup/setup5.jsp");
    _caucho_line_map.add(15, 1);
    _caucho_line_map.add(1, 34);
    _caucho_line_map.add(12, 42);
    _caucho_line_map.add(19, 50);
    _caucho_line_map.add(133, 155);
    _caucho_line_map.add(183, 159);
    _caucho_line_map.add(190, 164);
    _caucho_line_map.add(193, 166);
    com.caucho.vfs.Depend depend;
    depend = new com.caucho.vfs.Depend(mergePath.lookup("file:/e:/jnjt/admin/setup/setup5.jsp"), 1029909816541L, 6564L);
    _caucho_depends.add(depend);
  }

  private static byte []_jsp_string3;
  private static byte []_jsp_string6;
  private static byte []_jsp_string4;
  private static byte []_jsp_string5;
  private static byte []_jsp_string0;
  private static byte []_jsp_string1;
  private static byte []_jsp_string2;
  static {
    _jsp_string3 = "\r\n\r\n<b>Create an Administrator Account</b>\r\n\r\n<ul>\r\n  An administrator account will allow you to administer your copy of Jive. Be \r\n  sure to remember your password! If you forget it, you'll have to manually reset \r\n  it. <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\">your name</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\">username</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\">email address</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\">password</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\">password</font><br>\r\n        <font size=\"-1\"><i>(confirm)</i></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=\"Create Administrator\">\r\n</center>\r\n\r\n".getBytes();
    _jsp_string6 = "\r\n\r\n<p>\r\nIf you have already created an administrator account, you can <a href=\"setup6.jsp\">\r\nskip this step</a>.\r\n\r\n<p>\r\n\r\n</body>\r\n</html>\r\n\r\n\r\n".getBytes();
    _jsp_string4 = "\r\n	<font color=\"Red\">Error!</font>\r\n	<p><font size=2>\r\n	\r\n	".getBytes();
    _jsp_string5 = "\r\n	\r\n	</font>\r\n".getBytes();
    _jsp_string0 = "\r\n\r\n".getBytes();
    _jsp_string1 = "\r\n".getBytes();
    _jsp_string2 = "\r\n\r\n<html>\r\n<head>\r\n	<title>Jive Setup - Step 5</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\r\n".getBytes();
  }
}

⌨️ 快捷键说明

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