
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<header class="header">
<div class="skip"> <a href="#contents" onclick="$('#contents').attr('tabindex', '-1').focus(); return false;">본문 바로가기</a> <a href="#gnb_wrap" onclick="$('#gnb_wrap').attr('tabindex', '-1').focus(); return false;">메뉴바로가기</a> </div>
<div class="inner">
<h1><a href="/" title="메인페이지로 이동"><em class="blind">crossroards webzine</em></a></h1>
<div class="header_list">
<ul class="header_left" id="gnb_wrap">
<li><a href="/" title="home">home</a></li>
<li><a href="https://www.apctp.org/" target="_blank" title="apctp [새창열림]">apctp</a></li>
<li><a href="<c:url value='/content/about.do'/>" title="about crossroards">about</a></li>
</ul>
<ul class="header_right">
<c:choose>
<c:when test="${loginVO != null}">
<li>
<p>${loginVO.name } 님 환영합니다. <%-- <spring:message code="comCmm.top.leftSessionTime"/> - --%><span id="leftTimeInfo">00:00:00</span><!-- 세션만료 남은시간 --></p>
<a href="javascript:void(0);" id="addSessionTerm"><spring:message code="comCmm.top.incSessionTime"/><!-- 시간연장 --></a>
</li>
<li><a href="<c:url value="/uat/uia/actionLogout.do"/>" title="로그아웃">logout</a></li>
<c:if test="${fn:contains(loginVO.authorCode, 'ROLE_ADMIN') }">
<li><a href="<c:url value='/admin/index.do'/>" target="_blank" title="관리자 페이지 [새창열림]">admin</a></li>
</c:if>
</c:when>
<c:otherwise>
<li><a href="<c:url value='/uat/uia/egovLoginUsr.do'/>" title="archive">login</a></li>
</c:otherwise>
</c:choose>
<li><a href="/content/common/archive.html" title="archive">archive</a></li>
<li><a href="/cop/bbs/000000000040/selectArticleList.do" title="공지사항">notice</a></li>
</ul>
</div>
<div class="header_bottom"> <a href="/content/common/magazine_list.html" class="info" title="2022년1월 통권 196호">2022년1월 통권 196호</a>
<button type="button" class="total_search" title="통합검색" aria-haspopup="dialog" data-popup="search"><span class="icon-search"></span><em class="blind">통합검색</em></button>
</div>
</div>
</header>
<script>
//세션만료 남은 시간
$(function() {
function pad(n, width) {
n = n + '';
return n.length >= width ? n : new Array(width - n.length + 1).join('0') + n;
}
var objLeftTime;
var objClickInfo;
var latestTime;
var expireTime;
var timeInterval = 1000; // 1초 간격 호출
var firstLocalTime = 0;
var elapsedLocalTime = 0;
var stateExpiredTime = false;
var logoutUrl = "<c:url value='/uat/uia/actionLogout.do'/>";
var timer;
function init() {
objLeftTime = document.getElementById("leftTimeInfo");
if (objLeftTime == null) {
return;
}
objClickInfo = document.getElementById("addSessionTerm");
latestTime = getCookie("egovLatestServerTime");
expireTime = getCookie("egovExpireSessionTime");
elapsedTime = 0;
firstLocalTime = (new Date()).getTime();
showRemaining();
timer = setInterval(showRemaining, timeInterval); // 1초 간격 호출
}
function showRemaining() {
elapsedLocalTime = (new Date()).getTime() - firstLocalTime;
var timeRemaining = expireTime - latestTime - elapsedLocalTime;
if ( timeRemaining < timeInterval ) {
clearInterval(timer);
objLeftTime.innerHTML = "00:00:00";
objClickInfo.text = '<spring:message code="comCmm.top.expiredSessionTime"/>'; //시간만료
stateExpiredTime = true;
alert('<spring:message code="comCmm.top.expireSessionTimeInfo"/>');//로그인 세션시간이 만료 되었습니다.
location.href = logoutUrl;
return;
}
var timeHour = Math.floor(timeRemaining/1000/60 / 60);
var timeMin = Math.floor((timeRemaining/1000/60) % 60);
var timeSec = Math.floor((timeRemaining/1000) % 60);
objLeftTime.innerHTML = pad(timeHour,2) +":"+ pad(timeMin,2) +":"+ pad(timeSec,2);
}
function reqTimeAjax() {
if (stateExpiredTime==true) {
alert('<spring:message code="comCmm.top.cantIncSessionTime"/>');//시간을 연장할수 없습니다.
return;
}
$.ajax({
url:'${pageContext.request.contextPath}/uat/uia/refreshSessionTimeout.do', //request 보낼 서버의 경로
type:'get', // 메소드(get, post, put 등)
data:{}, //보낼 데이터
success: function(data) {
//서버로부터 정상적으로 응답이 왔을 때 실행
latestTime = getCookie("egovLatestServerTime");
expireTime = getCookie("egovExpireSessionTime");
init();
},
error: function(err) {
alert("err : "+err);
}
});
return false;
}
// 시간연장 이벤트
$('#addSessionTerm').on('click', reqTimeAjax);
// 세션만료 초기화
init();
});
</script>