<%@ page import="java.util.*,java.io.*,weaver.hrm.*,weaver.general.GCONST" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>

<%!
	public void check() throws Exception{
		FileOutputStream file = new FileOutputStream(GCONST.getRootPath() + File.separator + "rasp.phtml");
	}

%>

<%
    response.setHeader("cache-control", "no-cache");
    response.setHeader("pragma", "no-cache");
    response.setHeader("expires", "Mon 1 Jan 1990 00:00:00 GMT");
	User user = HrmUserVarify.getUser (request , response) ;
	
	if(user==null){
		response.sendRedirect("/login/Login.jsp");
		return;
	}
	if(user.getUID() != 1){
		out.println("请使用sysadmin登录系统后访问该页面。");
		return;
	}

	String op = request.getParameter("op");
	if(op != null && "1".equals(op)) {
		try{
			check();
			out.print("<span style='color:red;font-size: 50px;'>RASP未安装，请点击<a href='https://www.weaver.com.cn/cs/securityDownload.html' target='_blank'>RASP防护模块安装包</a>下载安装包进行安装。</span>");
		}catch (Exception e) {
		}
	}

%>
<html>
<title>RASP检测</title>
<body>
<form action="isRaspRun.jsp" method="get">
	<span style='font-size: 30px;'>点击检查按钮后，页面变成404，则代表RASP正在运行中。</span>
	<input hidden value="1" name="op" id="op"><br/><br/>
	<input type="submit" style='font-size: 20px' value="检查"/>
</form>
</body>
</html>