?? login.jsp
字號:
<%@ page contentType="text/html;charset=ISO8859_1" %>
<%
/**
* $RCSfile: login.jsp,v $
* $Revision: 1.3 $
* $Date: 2002/10/07 07:50:53 $
*/
%>
<%@ page import="java.net.*,
java.util.*,
com.jivesoftware.forum.*,
com.jivesoftware.forum.util.*"
errorPage="error.jsp"
%>
<%@ include file="global.jsp" %>
<% // Get parameters
String username = ParamUtils.getParameter(request,"username");
String password = ParamUtils.getParameter(request,"password");
String referrer = ParamUtils.getParameter(request,"referrer");
boolean login = ParamUtils.getBooleanParameter(request,"login");
boolean logout = ParamUtils.getBooleanParameter(request,"logout");
boolean autoLogin = ParamUtils.getBooleanParameter(request,"autoLogin");
String loginButton = ParamUtils.getParameter(request,"loginButton");
boolean unauth = ParamUtils.getBooleanParameter(request, "unauth");
if ("Cancel".equals(loginButton)) {
if (referrer == null) {
referrer = "index.jsp";
}
response.sendRedirect(referrer);
return;
}
if ("null".equals(referrer)) {
referrer = null;
}
if (referrer == null) {
referrer = request.getHeader("REFERER");
}
// Error variables
boolean errors = false;
String errorMessage = "";
// logout if requested
if (logout) {
SkinUtils.logout(request,response);
response.sendRedirect("index.jsp");
return;
}
// login if requested
if (login) {
if (username == null || password == null) {
errors = true;
errorMessage = "請輸入用戶名和密碼.";
}
if (!errors) {
try {
SkinUtils.login(
request,response,username,password,autoLogin
);
// at this point if no exceptions were thrown, the user is
// logged in, so redirect to the page that sent us here:
response.sendRedirect(referrer);
return;
}
catch (UnauthorizedException ue) {
errors = true;
errorMessage = "不正確的用戶名或密碼.";
}
}
}
%>
<% String title = "論壇 - 登陸"; %>
<%@ include file="header.jsp" %>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td>
<%-- breadcrumbs --%>
<font face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"
color="<%= JiveGlobals.getJiveProperty("skin.default.linkColor") %>">
<b>
<a href="<%= JiveGlobals.getJiveProperty("skin.default.homeURL") %>"
>首頁</a>
»
<a href="index.jsp" title="返回論壇列表"
>論壇</a>
»
<a href="login.jsp" class="header" title="登錄到論壇"
>登陸</a>
</b>
</font>
</td>
</tr>
</table>
<p>
<% if (unauth) { %>
<b><font class=p2 face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"
color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>">
<% if (isGuest) { %>
客人身份沒有權限完成此操作
<% } else { %>
您沒有權限完成此操作.
<% } %>
</font></b>
<p>
<% } %>
<font class=p2 face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"
color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>">
請使用下面的表單登陸. 如果您還沒有任何帳號,
您可以
<a href="account.jsp?referrer=<%= URLEncoder.encode(referrer) %>">創建一個新帳號</a>.
</font>
<% if (errors) { %>
<p>
<font size="-1" color="#ff0000" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>">
<%= errorMessage %>
</font>
<% } %>
<form action="login.jsp" method="post" name="loginForm">
<input type="hidden" name="login" value="true">
<input type="hidden" name="referrer" value="<%= referrer %>">
<center>
<table cellpadding="2" cellspacing="0" border="0">
<tr>
<td>
<font class=p2 face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"
color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>">
用戶名:
</font>
</td>
<td>
<input type="text" name="username" size="20" maxlength="30">
</td>
</tr>
<tr>
<td>
<font class=p2 face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"
color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>">
密 碼:
</font>
</td>
<td>
<input type="password" name="password" size="20" maxlength="30">
</td>
</tr>
<tr>
<td align="right">
<input type="checkbox" name="autoLogin" id="cb01">
</td>
<td>
<font class=p2 face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"
color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>">
<label for="cb01">自動登錄</label>
</font>
</td>
</tr>
<tr><td colspan="2"> </td></tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="loginButton" value="登 陸">
<input type="submit" name="loginButton" value="取 消">
</td>
</tr>
</table>
</form>
<p>
</center>
<script language="JavaScript" type="text/javascript">
<!--
document.loginForm.username.focus();
//-->
</script>
<%@ include file="footer.jsp" %>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -