<%@page import="java.util.Random"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.lang.*"%>


<%@ page import="java.io.*,
				 javax.servlet.http.*,
                 java.util.*,
            	 jet.cs.util.*,
            	 jet.server.api.http.*,
 				 jet.JSvrResource,
				 java.util.regex.Matcher,
				 java.util.regex.Pattern,
            	 jet.server.log.*,
            	 jet.server.util.WebSecurityUtil" 
%>

<%@ page import="jet.server.api.*" %>

<head>
<style>
a{	
	display:none;
}
</style>
</head>

<body>
		<%
			String jrauth_key = request.getParameter("jrauth_key");
			String jrauth_id = request.getParameter("jrauth_id");
			System.out.println("jrauth_key: "+jrauth_key);
			System.out.println("jrauth_id: "+jrauth_id);
			if(jrauth_id == null || jrauth_key == null) {
			System.out.println("Login failed!");
		%>
			<script type="text/javascript">
				alert("jrauth_key or jrauth_id cannot be blank ");
			</script>
		<%
			return;
			}
			session.setAttribute("jrauth_key", jrauth_key);
			session.setAttribute("jrauth_id", jrauth_id);
			System.getProperties().put("jreport.context", application);
		if (HttpUtil.checkLogin(request, response)) {
			System.out.println("Login successful!");
		%>
			<script type="text/javascript">
				// Which web page do you want to visit after login?
				var url = "http://192.168.128.60:8888/jinfonet/default.jsp";
				window.location.href = url
			</script>
		<% } else {
			System.out.println("Login failed!");
		} 
		%>
</body>