<%@ 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();
%>
<c:set var="contextRoot" value="<%=contextRoot%>"/>

<!DOCTYPE html>
<html>
<head>
	<script>var CONTEXTROOT     = "<%=contextRoot%>";</script>
	<script type="text/javascript" src="${contextRoot }/js/common/jquery/jquery.min.js"></script>
	<script type="text/javascript" src="${contextRoot }/js/common/func.js"></script>
	<script>
		const agent = navigator.userAgent.toLowerCase();
	</script>
	
</head>
<body>
	<OBJECT id="auth" classid="clsid:7C159314-7E2C-4E6E-B580-5DF25610F581"
		codebase="/cab/AuthByMAC.cab#Version=1,1,9,0">
		<PARAM name=copyright value="http://isulnara.com">

		<div
			style="position: absolute; top: 276; left: 320; width: 300; height: 68; border: solid 1 #99B3A0; background: #D8D7C4; overflow: hidden; z-index: 1; visibility: visible;">
			<FONT
				style='font-family: "굴림", "Verdana"; font-size: 9pt; font-style: normal;'>
				<BR />&nbsp;&nbsp;인증 컴포넌트가 설치되지 않았습니다.&nbsp;&nbsp; <BR />&nbsp;&nbsp;
				<a href="/cab/AuthByMAC.EXE"><font color=red>이곳</font></a> 을 클릭하여
				수동으로 설치하시기 바랍니다.&nbsp;&nbsp;
			</FONT>
		</div>

	</OBJECT>

	<script>
		// 맥어드레스 배열 획득
		var macArr = "";
		
		if(auth.MAC){
			macArr = (auth.MAC).split('\r\n');
		}

		if (auth.MAC && macArr.length > 0) {
			var authYn = false;

			var option = {
				url : "main/getMacAddressAuth.do",
				async : false,
				param : 'macArr=' + macArr,
				callback : getMacAddressAuthCallback
			};

			callService(option);

		}

		function getMacAddressAuthCallback(json) {
			authYn = json.data.count > 0;

			if (authYn) {
				// 성공여부를 쿠키에 저장
				setCookie('macChk', 'success', 1);
				//alert('맥어드레스 확인 성공');
				location.href = '/';
			} else {
				alert('맥어드레스 등록이 필요합니다. ');
			}
		}
	</script>
</body>
</html>

