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
<%--
Class Name : EgovLoginUsr.jsp
Description : 로그인화면
Modification Information
수정일 수정자 수정내용
------- -------- ---------------------------
2009.03.10 박지욱 최초 생성
2011.08.31 JJY 경량환경 버전 생성
author : 공통서비스 개발팀 박지욱
since : 2009.03.10
--%>
<%@ 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="ui" uri="http://egovframework.gov/ctl/ui"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html>
<html lang="ko">
<head>
<meta http-equiv="Content-Language" content="ko" >
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>로그인</title>
<link href="/css/post.css?ver=1" rel="stylesheet" >
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="/js/new_login.js"></script>
<!-- 암화화 순서에 유의 -->
<script type="text/javascript" src="/js/RSA/rsa.js"></script>
<script type="text/javascript" src="/js/RSA/jsbn.js"></script>
<script type="text/javascript" src="/js/RSA/prng4.js"></script>
<script type="text/javascript" src="/js/RSA/rng.js"></script>
<script type="text/javascript">
<c:if test="${!empty message}">
alert("${message}");
</c:if>
$( document ).ready(function(){
getid(document.loginForm);
//관리자비번저장 사용안함 처리 1
getpw(document.loginForm);
});
//모바일 여부 체크
function isMobileCheck() {
var UserAgent = navigator.userAgent;
if (UserAgent.match(/iPhone|iPod|Android|Windows CE|BlackBerry|Symbian|Windows Phone|webOS|Opera Mini|Opera Mobi|POLARIS|IEMobile|lgtelecom|nokia|SonyEricsson/i) != null || UserAgent.match(/LG|SAMSUNG|Samsung/) != null)
{
return true;
}else{
return false;
}
}
//비번 쿠키 생성 & 만료
function savepw(form) {
var expdate = new Date();
// 기본적으로 30일동안 기억하게 함. 일수를 조절하려면 * 30에서 숫자를 조절하면 됨
if (form.checkId.checked)
expdate.setTime(expdate.getTime() + 1000 * 3600 * 24 * 30); // 30일
else
expdate.setTime(expdate.getTime() - 1); // 쿠키 삭제조건
if (isMobileCheck() == true && form.checkId.checked) {
var emplyrId = form.id_text.value;
if (emplyrId != "") {
$.ajax({
type: "POST",
url: "/web/user/admMobilePwSaveCheckAjax.do",
data: {"emplyrId": emplyrId},
dataType:'json',
async: false,
success: function (data) {
if (data.isSuccess) {
if (data.mobilePwsaveYn == "Y") {
// Set 쿠키
setCookie("ncms_savepw", form.password_text.value, expdate);
}
else {
firepw(document.loginForm);
}
}
else {
//alert("Msg : " + data.msg);
}
},
error: function (e) {
//alert("ERROR : " + JSON.stringify(e));
}
});
}
}
else {
firepw(document.loginForm);
}
}
// 비번 쿠키 만료
function firepw(form) {
var expdate = new Date();
expdate.setTime(expdate.getTime() - 1); // 쿠키 삭제조건
setCookie("ncms_savepw", "", expdate);
}
//관리자 모바일환경 비번 저장여부
function getpw(form) {
if (isMobileCheck() == true && form.checkId.checked) {
var emplyrId = form.id_text.value;
if (emplyrId != "") {
$.ajax({
type: "POST",
url: "/web/user/admMobilePwSaveCheckAjax.do",
data: {"emplyrId": emplyrId},
dataType:'json',
async: false,
success: function (data) {
if (data.isSuccess) {
if (data.mobilePwsaveYn == "Y") {
// Get 쿠키
form.password_text.value = getCookie("ncms_savepw");
}
else {
firepw(document.loginForm);
}
}
else {
//alert("Msg : " + data.msg);
}
},
error: function (e) {
//alert("ERROR : " + JSON.stringify(e));
}
});
}
}
else {
firepw(document.loginForm);
}
}
//sms 문자인증
$( document ).ready(function(){
/*
* sms 문자인증 노출 Script
*/
<c:if test="${!empty mode}">
alert("${message_auth}");
$("#id_text").val("${id}");
$("#id_text").prop("readonly","readonly");
$("#password_text").prop("readonly","readonly");
timer();
</c:if>
});
function actionLogin() {
if (document.loginForm.id_text.value =="") {
alert("아이디를 입력하세요");
return false;
} else if (document.loginForm.password_text.value =="") {
alert("비밀번호를 입력하세요");
return false;
}
<c:if test="${!empty mode}">
else if (document.loginForm.checkNo.value ==""){
alert("인증번호를 입력하세요.");
return false;
}
</c:if>
else {
var rsa = new RSAKey();
rsa.setPublic($('#RSAModulus').val(),$('#RSAExponent').val());
var id = $("#id_text");
var pw = $("#password_text");
$("#id").val(rsa.encrypt(id.val()));
$("#password").val(rsa.encrypt(pw.val()));
$("#password2").val(pw.val());
document.loginForm.action="<c:url value='/uat/uia/actionSecurityLogin.do'/>";
saveid(document.loginForm);
//관리자비번저장 사용안함 처리 2
savepw(document.loginForm);
document.loginForm.submit();
}
}
function kmcActionLogin() {
document.loginForm.action="<c:url value='/uat/uia/actionSecurityLogin.do'/>";
// saveid(document.loginForm);
// document.loginForm.submit();
}
function setCookie (name, value, expires) {
document.cookie = name + "=" + escape (value) + "; path=/; expires=" + expires.toGMTString();
}
function getCookie(Name) {
var search = Name + "="
if (document.cookie.length > 0) { // 쿠키가 설정되어 있다면
offset = document.cookie.indexOf(search)
if (offset != -1) { // 쿠키가 존재하면
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset)
// 쿠키 값의 마지막 위치 인덱스 번호 설정
if (end == -1)
end = document.cookie.length
return unescape(document.cookie.substring(offset, end))
}
}
return "";
}
function saveid(form) {
var expdate = new Date();
// 기본적으로 30일동안 기억하게 함. 일수를 조절하려면 * 30에서 숫자를 조절하면 됨
if (form.checkId.checked)
expdate.setTime(expdate.getTime() + 1000 * 3600 * 24 * 30); // 30일
else
expdate.setTime(expdate.getTime() - 1); // 쿠키 삭제조건
setCookie("ncms_saveid", form.id_text.value, expdate);
}
function getid(form){
form.checkId.checked = ((form.id_text.value = getCookie("ncms_saveid")) != "");
}
// 1. 미허용 IP일 경우 로그인 페이지로 다시 redirect, 문자인증 입력칸 노출, 등록된 휴대폰 번호로 인증번호 전송
// * 인증번호 발송 부 참고 소스 -> /web/user/sendSysMsgDataAjax.do
// 2. 발송 후 인증가능 시간 timer(); 함수 호출
// 3. 인증번호 입력 후 로그인 시 ID/PW/인증번호로 로그인
//인증번호 발송 1분마다 한번씩 보내기
function sendMsgYn(){
document.checkForm.receive.value = $('#findPw_userPhone').val();
if ($('#findPw_userPhone').val()==''){
alert("휴대폰 번호를 입력해주세요.");
return;
}
var checkForm = $("form[name=checkForm]").serialize() ;
$.ajax({
url : "<c:url value='/web/user/sendSysMsgSelectAjax.do' />",
type : 'POST',
data : checkForm,
dataType:'json',
success : function(returnData, status){
if(status == "success") {
if(returnData.compare){
step1IdCheck();
}else{
alert("인증번호 발송은 1분마다 가능합니다.");
return;
}
}else{ alert("실패");return;}
},
error : function(request , status, error){
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
}
});
}
var time = 300; //기준시간 작성
var min = ""; //분
var sec = ""; //초
//인증번호 타이머
function timer(){
//setInterval(함수, 시간) : 주기적인 실행
var x = setInterval(function() {
//parseInt() : 정수를 반환
min = parseInt(time/60);
sec = time%60; //나머지를 계산
document.getElementById("timer").innerHTML = min + "분" + sec + "초";
time--;
//타임아웃 시
if (time < 0) {
clearInterval(x); //setInterval() 실행을 끝냄
document.getElementById("timer").innerHTML = "시간초과";
}
}, 1000);
if(time != 300){
time = 300;
clearInterval(x);
}
}
</script>
<link href="/css/post.css" rel="stylesheet" type="text/css" />
<style>
.login_left{position: relative;}
.ncms_title{position: absolute;bottom: 30px;left: 60px;font-size: 17px;font-weight: 600;color: #fff;letter-spacing: 1px}
caption, legend, label, .hidden {visibility:hidden;position:absolute;left:-9999em;width:1px;height:1px;margin:0;padding:0;background:none;font-size:0;line-height:0;text-indent:-9999em}
</style>
</head>
<body>
<form:form id="loginForm" name="loginForm" method="post">
<input type="hidden" name="userSe" value="USR"/>
<input type="hidden" id="RSAModulus" value="${RSAModulus}"/>
<input type="hidden" id="RSAExponent" value="${RSAExponent}"/>
<input type="hidden" id="id" name="id" value=""/>
<input type="hidden" id="password" name="password" value=""/>
<input type="hidden" id="password2" name="password2" value=""/>
<input name="j_username" type="hidden"/>
<div class="login_all_wrap">
<div class="login_wrap">
<div class="login_left_box"><img src="/img/adminLogo3.png" alt=""></div>
<div class="login_right_box">
<div class="content">
<div class="title">Sign in</div>
<div class="id_box">
<p>ID</p>
<label for="id_text">아이디 입력</label>
<input type="text" id="id_text" maxlength="13" placeholder="아이디를 입력해주세요" class="id" >
</div>
<div class="pw_box">
<p>Password</p>
<label for="password_text">패스워드 입력</label>
<c:if test="${empty mode}">
<input type="password" id="password_text" placeholder="비밀번호를 입력해주세요." class="pw" onkeydown="javascript:if (event.keyCode == 13) { actionLogin();return false; }">
</c:if>
<c:if test="${!empty mode}">
<input type="password" id="password_text" placeholder="비밀번호를 입력해주세요." value="<c:out value='${password}'/>" class="pw" onkeydown="javascript:if (event.keyCode == 13) { actionLogin();return false; }">
</c:if>
</div>
<c:if test="${!empty mode}">
<div class="pw_box" style="position:relative;">
<p>인증번호 입력</p>
<label for="checkNo" class="label">인증번호 입력</label>
<input type="text" name="checkNo" id="checkNo" class="list_inputType1 colorLight" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');" placeholder="인증번호를 입력하세요" onfocus="this.placeholder=''" onblur="this.placeholder='인증번호를 입력하세요'">
<div id="timer" style="position:absolute;right:10px;top:40px;"></div>
</div>
</c:if>
<div class="saveId">
<input type="checkbox" id="checkId" name="checkId"><label for="checkId">아이디저장</label> 아이디저장
</div>
<div class="submit_box"><input type="submit" value="로그인" class="submit" id="login_submit" onclick="javascript:actionLogin();return false;" ></div>
<div class="copyright"><span class="copy_text">Copyright 문자온 Co.,Ltd. All Rights Reserved.</span></div>
</div>
</div>
</div>
</div>
</form:form>
</body>
</html>