<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String contextRoot = request.getContextPath().equals("/") ? "" : request.getContextPath();
String ip = request.getHeader("X-FORWARDED-FOR"); 
String key = String.valueOf(request.getParameter("key"));

boolean ipFlag = false; 

if (ip == null || ip.length() == 0) {
    ip = request.getHeader("Proxy-Client-IP");
}

if (ip == null || ip.length() == 0) {
    ip = request.getHeader("WL-Proxy-Client-IP");  // 웹로직
}

if (ip == null || ip.length() == 0) {
    ip = request.getRemoteAddr() ;
}

String iHost = ip.substring(0, 3);

//내부망일때
if (iHost.equals("192")) {
    String ipHost2 = (ip.substring(4)).substring(0,3);
    
    if(ipHost2.equals("168")){
        	String ipHost3 = (ip.substring(8)).substring(0,2);
        	
        	if(ipHost3.equals("10") || ipHost3.equals("20") || ipHost3.equals("30") || ipHost3.equals("11")){
        		ipFlag = true;
        	}
    }
}

%>
<c:set var="contextRoot" value="<%=contextRoot%>" />
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<title>도시교통정보센터</title>
<script>
	var CONTEXTROOT     = "<%=contextRoot%>";
	var IP = "<%=ip%>";
	var IPFLAG = "<%=ipFlag%>";
	var KEY = "<%=key%>";
</script>
<script type="text/javascript"
	src="${contextRoot }/js/common/jquery/jquery.min.js"></script>
<script type="text/javascript"
	src="${contextRoot }/js/common/rtc/SHA256.js?ver=0.1"></script>
<script type="text/javascript"
	src="${contextRoot }/js/common/rtc/md5.js"></script>
<script type="text/javascript"
	src="${contextRoot }/js/common/checkConnection.js?ver=0.2"></script>
<script type="text/javascript" src="${contextRoot }/js/common/func.js"></script>
<style>
* {
	margin: 0px;
	padding: 0px;
}

.wrapper {
	text-align: center;
	padding-top: 100px;
	background: url(${contextRoot }/images/error.gif) no-repeat center;
	display: none;
}

.content {
	width: 100%;
    max-width: 605px;
    height: 540px;
    margin: auto;
}

.txtArea {
    padding-top: 100px;
    margin: auto;
    width: 70%;
    height: 40%;
}

.title {
	padding-top: 30px;
    font-size: 18px;
    text-indent: 70px;
    font-weight: bold;
    height: 90px;
}

.body {
    font-size: 14px;
    line-height: 30px;
    margin: auto;
}

.idDiv {
	text-align: center;
}

.footer{
	margin-top: 50px;
	line-height: 20px;
	font-size: 14px;
}

</style>
</head>
<body>
	<div class="wrapper">
		<div class="content">
			<div class="txtArea">
				<div class="title">
					사이트 접근 제한 안내
				</div>
				<div class="body">
					인증된 사용자만 서비스 이용이 가능합니다. <br/>
					관계자인 경우 관리자에게 문의하세요. <br/>
				</div>
				<div class="footer">
					이용문의 : 02-3495-2088
					<div class="idDiv">
						<span id="idValue"></span> 
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>