<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="gbase.db.*,java.sql.*"%>
<%
	response.addHeader("P3P","CP=CAO PSA OUR");
	String message="µÇÂ¼Ê§°Ü!";
	String url="index.jsp";
	String web_account= request.getParameter("web_account")==null?"":request.getParameter("web_account");
	String user_account= request.getParameter("user_account")==null?"":request.getParameter("user_account");
	String password= request.getParameter("password")==null?"":request.getParameter("password");
	
	String sql = "select b.web_id,a.web_account,a.user_account,a.password,a.user_name,a.user_id from web_user a,web_info b where a.web_account=b.web_account and a.web_account='"+web_account+"' and a.user_account='"+user_account+"' and a.password='"+password+"'";
        DBOperation theDBOperation = new DBOperation();
        try {
          ResultSet rs=theDBOperation.getResultSet(sql);
          if(rs.next() & rs.getString("password").equals(password))
          {  
           String user_name=rs.getString("user_name");
           String user_id=rs.getString("user_id");
           String web_id=rs.getString("web_id");
           url="index.jsp";
           session.setAttribute("web_account",web_account);
           session.setAttribute("web_id",web_id);
           session.setAttribute("user_account",user_account);
           session.setAttribute("user_name",user_name);
           session.setAttribute("user_id",user_id);
           session.setAttribute("cms_login_flag","cms_login_ok");
           message="µÇÂ¼³É¹¦!";
          }
          else
           url="login.jsp";
      }
      catch (Exception ex) {
        message = "µÇÂ¼Ê§°Ü!";
      }
%>
<script language="javascript">
function process(message,url)
{ 
  if(message=="µÇÂ¼Ê§°Ü!")
  alert(message);
  
  self.location = url;
}
</script>
<html>
	<head>
		<title></title>
	</head>
	<body onload="javascript: process('<%=message%>','<%=url%>');">
	</body>
</html>