?? setup5.jsp
字號:
<%@ page contentType="text/html;charset=ISO8859_1" %>
<%
/**
* $RCSfile: setup5.jsp,v $
* $Revision: 1.1.1.1 $
* $Date: 2002/09/09 13:50:22 $
*
* Copyright (C) 1999-2001 CoolServlets, Inc. All rights reserved.
*
* This software is the proprietary information of CoolServlets, Inc.
* Use is subject to license terms.
*/
%>
<%@ page import="java.io.*,
java.util.*,
java.lang.reflect.*,
com.jivesoftware.forum.*,
com.jivesoftware.forum.util.*,
com.jivesoftware.util.*"
%>
<%
Locale locale = JiveGlobals.getLocale();
// Set the JSP page to use the Jive locale
response.setLocale(locale);
// Load the appropriate resource bundle to display the page.
ResourceBundle bundle = SkinUtils.getResourceBundle("skin_admin_setup", locale);
%>
<% // get parameters
boolean setupCompleted = false;
Object completed = session.getAttribute("setupCompleted");
if (completed != null) {
setupCompleted = ((Boolean)completed).booleanValue();
}
boolean updateAdmin = ParamUtils.getBooleanParameter(request,"updateAdmin");
String currentPassword = ParamUtils.getParameter(request, "currentPassword");
String password = ParamUtils.getParameter(request,"password");
if (password == null) {
password = "";
}
String confirmPassword = ParamUtils.getParameter(request,"confirmPassword");
if (confirmPassword == null) {
confirmPassword = "";
}
String email = ParamUtils.getParameter(request,"email");
boolean errors = false;
String errorMessage = "";
if (!setupCompleted && updateAdmin) {
if (!password.equals(confirmPassword)) {
errors = true;
errorMessage = "輸入的兩次口令不匹配。請重新輸入。";
}
if (password.equals("")) {
errors = true;
errorMessage = "口令不能為空";
}
else {
Authorization auth = null;
try {
auth = AuthorizationFactory.getAuthorization("admin", currentPassword);
}
catch (UnauthorizedException ue) {
errors = true;
errorMessage = "你給出的管理員口令不正確。請使用正確口令重試。";
}
if (!errors) {
try {
ForumFactory forumFactory = ForumFactory.getInstance(auth);
UserManager userManager = forumFactory.getUserManager();
User admin = userManager.getUser("admin");
admin.setPassword(password);
if (email != null) {
admin.setEmail(email);
}
Date now = new Date();
admin.setCreationDate(now);
admin.setModifiedDate(now);
// Everything seems to have worked!
session.setAttribute("setupCompleted",new Boolean(true));
session.setAttribute("sidebar.3.light", GREEN);
response.sendRedirect("setup5.jsp");
return;
}
catch (Exception e) {
e.printStackTrace();
errors = true;
errorMessage = "設置管理員信息時發生錯誤。請檢查錯誤日志試著修正錯誤。";
}
}
}
}
%>
<%@ include file="global.jsp" %>
<%@ include file="header.jsp" %>
<table cellpadding="6" cellspacing="0" border="0" width="100%">
<tr>
<td width="1%" valign="top">
<% // set sidebar properties
if (!GREEN.equals(getSessionString(session,"sidebar.3.light"))) {
session.setAttribute("sidebar.3.light", YELLOW);
}
%>
<%@ include file="sidebar.jsp" %>
</td>
<td width="99%" valign="top">
<b>管理員賬號設置</b>
<hr size="0">
<% if (!setupCompleted) { %>
<font size="-1">
Jive論壇數據庫腳本包括一個缺省的管理員賬號,口令為"admin",基于安全的考慮,必須修改此口令。你也應該提供一個合法的郵件地址,在發生系統錯誤時能夠被警告。
<p>
<% if (errors) { %>
<font color="#cc3300">
<i><%= errorMessage %></i>
<p>
</font>
<% } %>
<ul>
<form action="setup5.jsp" mode="post">
<input type="hidden" name="updateAdmin" value="true">
<table cellpadding="3" cellspacing="0" border="0">
<tr>
<td><font size="-1">當前口令</font></td>
<td><input type="text" size="30" name="currentPassword" value="admin"></td>
</tr>
<tr>
<td><font size="-1">email</font></td>
<td><input type="text" size="30" name="email" value=""></td>
</tr>
<tr>
<td><font size="-1">新口令</font></td>
<td><input type="password" size="30" name="password" value=""></td>
</tr>
<tr>
<td><font size="-1">口令確認</font></td>
<td><input type="password" size="30" name="confirmPassword" value=""></td>
</tr>
</table>
</ul>
<p>
<hr size="0">
<center>
<input type="submit" value="更新管理員賬號">
</center>
</form>
<% } %>
<% if (setupCompleted) {
// set "setup" property equal to true
%>
<font size="-1">
Jive論壇安裝完成!請點擊下面的登錄按鈕登錄到Jive管理工具。
<p>
</font>
<form action="../index.jsp">
<hr size="0">
<center>
<input type="submit" value="管理登錄">
</center>
</form>
<% } %>
</td>
</tr>
</table>
<%@ include file="footer.jsp" %>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -