<%@ page contentType="text/html;charset=GBK" %>
<%
/**
 *	$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"
%>
<%  // Get parameters
    String web_account= request.getParameter("web_account")==null?"":request.getParameter("web_account");
    String username = ParamUtils.getParameter(request,"username");
    if(username!=null && !username.equals(""))
     username=username+"-user-web-"+web_account;
    
    String password = ParamUtils.getParameter(request,"password");
    String referrer = "work.jsp?web_account="+web_account;
    boolean autoLogin = true;
    boolean errors=false;
    String errorMessage;
    // login if requested
   if (username == null || password == null) {
     errors = true;
     errorMessage = "请输入用户名和密码.";
   }
   if (!errors) {
     try {
	SkinUtils.login(request,response,username,password,autoLogin);
	response.sendRedirect(referrer);
	return;
	}
     catch (UnauthorizedException ue) {
	errors = true;
	errorMessage = "不正确的用户名或密码.";
	}
    }
if(errors){
%>
<script>
alert('不正确的用户名或密码');
window.history.back();
</script>
<%
}
%>