Merge branch 'master' of http://docs.nculture.org:30000/nculture/iams.nlib
This commit is contained in:
commit
f4ba387cc7
@ -12,6 +12,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.annotation.Secured;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
@ -79,6 +80,7 @@ public class InterestController extends NlibCommonController
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@Secured("ROLE_USER")
|
||||
@RequestMapping("/interest/listInterests.do")
|
||||
public String listInterests(HttpServletRequest req, HttpServletRequest request, Authentication authentication,
|
||||
@RequestParam Map<String, String> paramMap,
|
||||
|
||||
@ -496,8 +496,16 @@ public class MemberController extends NlibCommonController{
|
||||
replaceContents.put("${time}", time);
|
||||
replaceContents.put("${hostName}", hostName);
|
||||
replaceContents.put("${councilNm}", councilNm);
|
||||
replaceContents.put("${name}", StringUtil.getString(loginVO.getName(),""));
|
||||
|
||||
emailUtil.sendEmail(email,"온라인자료대출시스템 이메일 인증번호입니다.",replaceContents,certTemplate);
|
||||
String result = emailUtil.sendEmail(email,"온라인자료대출시스템 이메일 인증번호입니다.",replaceContents,certTemplate);
|
||||
|
||||
if(result == "templateFail")
|
||||
{
|
||||
map.put("msg","이메일 발송에 실패하였습니다. 관리자에게 문의하여 주시기 바랍니다.");
|
||||
map.put("emailCertYn","N");
|
||||
return map;
|
||||
}
|
||||
|
||||
map.put("msg","이메일 인증번호가 발송됐습니다.");
|
||||
map.put("emailCertYn","Y");
|
||||
@ -726,11 +734,23 @@ public class MemberController extends NlibCommonController{
|
||||
//내정보페이지, 회원가입시 핸드폰번호가 같을시 비밀번호 초기화
|
||||
String email = vo.getEmail();
|
||||
vo.setEmail("");
|
||||
|
||||
int count =0;
|
||||
//mbinfo를 이용해 조회
|
||||
NlibLoginVO loginVO=userInfoService.selectMyInfo(vo);
|
||||
NlibLoginVO loginVO = userInfoService.selectMyInfo(vo);
|
||||
|
||||
if(!email.equals(loginVO.getEmail()))
|
||||
//일치하는 이메일이 있는지 확인
|
||||
List<OAuthUniversalUser> snsLoginVO = userInfoService.selectSnsSignUpList(vo);
|
||||
if(email.equals(loginVO.getEmail()) || email.equals(loginVO.getLoginUserId()))
|
||||
{
|
||||
count +=1;
|
||||
}
|
||||
for(int i = 0; snsLoginVO.size() > i;i++)
|
||||
{
|
||||
if(email.equals(snsLoginVO.get(i).getSnsUserId()))
|
||||
count +=1;
|
||||
}
|
||||
|
||||
if(count == 0)
|
||||
{
|
||||
return "fail";
|
||||
}
|
||||
@ -772,9 +792,7 @@ public class MemberController extends NlibCommonController{
|
||||
replaceContents.put("${hostName}", hostName);
|
||||
replaceContents.put("${councilNm}", councilNm);
|
||||
replaceContents.put("${name}", name);
|
||||
emailUtil.sendEmail(email,"온라인자료대출시스템 비밀번호 초기화 메일입니다.",replaceContents,pwdTemplate);
|
||||
|
||||
message="success";
|
||||
message = emailUtil.sendEmail(email,"온라인자료대출시스템 비밀번호 초기화 메일입니다.",replaceContents,pwdTemplate);
|
||||
}else {
|
||||
message="fail";
|
||||
}
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package nlib.util;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
@ -13,11 +15,14 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import egovframework.com.cmm.EgovWebUtil;
|
||||
import egovframework.com.utl.fcc.service.EgovStringUtil;
|
||||
import nlib.bbs.service.impl.QnaServiceImpl;
|
||||
import nlib.mail.EmailSender;
|
||||
import nlib.mail.service.EmailVO;
|
||||
|
||||
@ -46,6 +51,8 @@ import nlib.mail.service.EmailVO;
|
||||
@Component("emailUtil")
|
||||
public class EmailUtil{
|
||||
|
||||
static Logger log = LoggerFactory.getLogger(EmailUtil.class);
|
||||
|
||||
@Autowired
|
||||
private EmailSender emailSender;
|
||||
|
||||
@ -57,9 +64,9 @@ public class EmailUtil{
|
||||
* @param templateFilePath
|
||||
* @throws Exception
|
||||
*/
|
||||
public void sendEmail(String reciverEmail, String subject, Map<String, Object> replaceContents, String templateFilePath) throws Exception {
|
||||
public String sendEmail(String reciverEmail, String subject, Map<String, Object> replaceContents, String templateFilePath) throws Exception {
|
||||
EmailVO email = new EmailVO();
|
||||
|
||||
String error="";
|
||||
Path path = Paths.get(templateFilePath);
|
||||
Charset cs = StandardCharsets.UTF_8;
|
||||
List<String> list = new ArrayList<String>();
|
||||
@ -67,9 +74,14 @@ public class EmailUtil{
|
||||
try {
|
||||
list = Files.readAllLines(path,cs);
|
||||
}catch(IOException e) {
|
||||
e.printStackTrace();
|
||||
error=getPrintStackTrace(e);
|
||||
}
|
||||
|
||||
if(!error.equals(""))
|
||||
{
|
||||
log.error(error);
|
||||
return "templateFail";
|
||||
}
|
||||
for(String readLine : list) {
|
||||
contents+=readLine;
|
||||
}
|
||||
@ -86,5 +98,14 @@ public class EmailUtil{
|
||||
email.setSubject(subject);
|
||||
email.setContent(contents);
|
||||
emailSender.SendEmail(email);
|
||||
return "success";
|
||||
}
|
||||
public static String getPrintStackTrace(Exception e) {
|
||||
|
||||
StringWriter errors = new StringWriter();
|
||||
e.printStackTrace(new PrintWriter(errors));
|
||||
|
||||
return errors.toString();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -84,9 +84,13 @@ function goFindPw(){
|
||||
{
|
||||
alert("일치하는 정보가 없습니다. 다시 확인해주세요.");
|
||||
}
|
||||
else if(result == "templateFail")
|
||||
{
|
||||
alert("이메일 발송에 실패하였습니다. 관리자에게 문의하여 주시기 바랍니다.");
|
||||
}
|
||||
|
||||
},error : function(){
|
||||
alert("이메일 발송에 실패하였습니다.");
|
||||
alert("이메일 발송에 실패하였습니다. 관리자에게 문의하여 주시기 바랍니다.");
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@ -196,13 +196,13 @@ $(document).ready(function() {
|
||||
$("#mobileCertYn").val("Y");
|
||||
$("#mobileCertSendBtn").css("display","none");
|
||||
$("#mobileReSend").css("display","none");
|
||||
$("#mobileCertForm").css("display","none");
|
||||
$("#mobileSuc").css("display","");
|
||||
$("[id^='mobileSuc']").css("display","inline-block");
|
||||
$("[id^='mobileVrfctNo']").css("display","none");
|
||||
}else{
|
||||
$("#mobileCertYn").val("N");
|
||||
$("#mobileCertSendBtn").css("display","");
|
||||
$("#mobileReSend").css("display","");
|
||||
$("#mobileSuc").css("display","none");
|
||||
$("[id^='mobileSuc']").css("display","none");
|
||||
}
|
||||
});
|
||||
<%
|
||||
@ -214,12 +214,26 @@ $(document).ready(function() {
|
||||
$("#emailCertYn").val("Y");
|
||||
$("#emailCertSendBtn").css("display","none");
|
||||
$("#emailReSend").css("display","none");
|
||||
$("#emailCertForm").css("display","none");
|
||||
|
||||
$("[id^='emailSuc']").css("display","inline-block");
|
||||
$("[id^='emailVrfctNo']").css("display","none");
|
||||
}else{
|
||||
$("#emailCertYn").val("N");
|
||||
$("#emailCertSendBtn").css("display","");
|
||||
$("#emailReSend").css("display","");
|
||||
$("[id^='emailSuc']").css("display","none");
|
||||
}
|
||||
});
|
||||
<%
|
||||
//비밀번호가 변하는것 실시간 감지
|
||||
%>
|
||||
$("#password,#passwordConfirm").on("propertychange change keyup paste input", function() {
|
||||
if($("#password").val() == $("#passwordConfirm").val())
|
||||
{
|
||||
$("#pwdSuc").css("display","inline-block");
|
||||
$("#pwdFail").css("display","none");
|
||||
}else{
|
||||
$("#pwdSuc").css("display","none");
|
||||
$("#pwdFail").css("display","inline-block");
|
||||
}
|
||||
});
|
||||
})
|
||||
@ -248,13 +262,13 @@ function emailCert(){
|
||||
if(result.emailCertYn=="Y")
|
||||
{
|
||||
$("#emailCertYn").val("N");
|
||||
$("#emailCertForm").css("display","")
|
||||
}
|
||||
if(result.emailCertYn=="N")
|
||||
{
|
||||
$("#emailCertYn").val("N");
|
||||
$("#emailCertForm").css("display","none")
|
||||
}
|
||||
$("[id^='emailSuc']").css("display","none");
|
||||
$("[id^='emailVrfctNo']").css("display","inline-block");
|
||||
},error : function(){
|
||||
}
|
||||
})
|
||||
@ -278,6 +292,10 @@ function certEmailCheck(){
|
||||
{
|
||||
alert("인증되었습니다.");
|
||||
$("#emailCertYn").val("Y");
|
||||
$("#emailCertSendBtn").css("display","none");
|
||||
$("#emailReSend").css("display","none");
|
||||
$("[id^='emailSuc']").css("display","inline-block");
|
||||
$("[id^='emailVrfctNo']").css("display","none");
|
||||
}else
|
||||
{
|
||||
alert("인증번호가 일치하지않습니다.");
|
||||
@ -312,8 +330,8 @@ function mobileCert(){
|
||||
success : function(result){
|
||||
alert("인증번호가 발송됐습니다.");
|
||||
$("#mobileCertYn").val("N");
|
||||
$("#mobileSuc").css("display","none");
|
||||
$("#mobileCertForm").css("display","")
|
||||
$("[id^='mobileSuc']").css("display","none");
|
||||
$("[id^='mobileVrfctNo']").css("display","inline-block");
|
||||
},error : function(){
|
||||
}
|
||||
})
|
||||
@ -337,7 +355,10 @@ function certMobileCheck(){
|
||||
{
|
||||
alert("인증되었습니다.");
|
||||
$("#mobileCertYn").val("Y");
|
||||
$("#mobileSuc").css("display","");
|
||||
$("#mobileCertSendBtn").css("display","none");
|
||||
$("#mobileReSend").css("display","none");
|
||||
$("[id^='mobileSuc']").css("display","inline-block");
|
||||
$("[id^='mobileVrfctNo']").css("display","none");
|
||||
document.joinForm.action="${pageContext.request.contextPath}/member/selectAlreadySignUpMobilePopup.do";
|
||||
fn_layerPopFormSubmit("joinForm",false);
|
||||
}else
|
||||
@ -530,10 +551,11 @@ function calcAge(birth) {
|
||||
<button type="button" class="btn-color" id="mobileCertSendBtn" name="mobileCertSendBtn" style="display:none;" onclick="mobileCert();">인증하기</button>
|
||||
<button type="button" class="btn-black" id="mobileReSend" style="display:none;" onclick="mobileCert();">재전송</button>
|
||||
</div>
|
||||
<div class="row" id="mobileCertForm" style="display:none;">
|
||||
<input class="form-control cer" type="text" id='mobileVrfctNo' name='mobileVrfctNo' placeholder=" SMS로 발송된 인증번호를 입력하세요"/>
|
||||
<button type="button" class="btn-gray" onclick='certMobileCheck();'>확인</button>
|
||||
<div class="row" id="mobileCertForm">
|
||||
<input class="form-control cer" type="text" id='mobileVrfctNo' name='mobileVrfctNo' style="display:none;" onKeyup="this.value=this.value.replace(/[^0-9]/g,'');" maxlength="6" placeholder=" SMS로 발송된 인증번호를 입력하세요"/>
|
||||
<button type="button" class="btn-gray" id='mobileVrfctNoBtn' style="display:none;" onclick='certMobileCheck();'>확인</button>
|
||||
<span id="mobileSuc" class="suc">인증이 완료되었습니다.</span>
|
||||
<span id="mobileSuc-chk" class="chk-suc"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -546,11 +568,11 @@ function calcAge(birth) {
|
||||
<button type="button" class="btn-color" id="emailCertSendBtn" name="emailCertSendBtn" style="display:none;" onclick="emailCert();">인증하기</button>
|
||||
<button type="button" class="btn-black" id="emailReSend" style="display:none;" onclick="emailCert();">재전송</button>
|
||||
</div>
|
||||
<div class="row" id="emailCertForm" style="display:none;">
|
||||
<input class="form-control cer" type="text" id='emailVrfctNo' name='emailVrfctNo' placeholder=" 이메일로 발송된 인증번호를 입력하세요"/>
|
||||
<button type="button" class="btn-gray" onclick='certEmailCheck()'>확인</button>
|
||||
<div class="row" id="emailCertForm">
|
||||
<input class="form-control cer" type="text" id='emailVrfctNo' name='emailVrfctNo' style="display:none;" placeholder=" 이메일로 발송된 인증번호를 입력하세요"/>
|
||||
<button type="button" class="btn-gray" id='emailVrfctNoBtn' style="display:none;" onclick='certEmailCheck()'>확인</button>
|
||||
<span id="emailSuc" class="suc">인증이 완료되었습니다.</span>
|
||||
<span class="chk-suc"></span>
|
||||
<span id="emailSuc-chk" class="chk-suc"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -575,8 +597,8 @@ function calcAge(birth) {
|
||||
<input class="form-control" type="password" id="password" name="password" placeholder="비밀번호" />
|
||||
<span>9자리 이상, 숫자/문자/특수문자를 혼합하여 입력</span>
|
||||
<input class="form-control" type="password" id="passwordConfirm" name="passwordConfirm" placeholder="비밀번호 확인" />
|
||||
<span class="suc">일치합니다.</span>
|
||||
<span class="fail">일치하지 않습니다.</span>
|
||||
<span class="suc" id="pwdSuc">일치합니다.</span>
|
||||
<span class="fail" id="pwdFail">일치하지 않습니다.</span>
|
||||
<span class="text">- 입력하신 비밀번호는 ‘계정 연결’, ‘내 정보 확인’, ‘회원탈퇴’ 시, 회원님의 정보보호 및 본인확인을 위해 사용됩니다.</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -34,7 +34,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
|
||||
<title>Insert title here</title>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
@ -43,7 +42,7 @@ if("${message}"!="")
|
||||
|
||||
});
|
||||
function goPutMyInfo(){
|
||||
if($("#password")=="")
|
||||
if($("#password").val() == "")
|
||||
{
|
||||
alert("비밀번호를 입력해주세요.");
|
||||
return false;
|
||||
@ -80,7 +79,7 @@ function goPutMyInfo(){
|
||||
<div class="icon"><img src="/images/icon/icon-myinfo-paswd.png" alt="체크 아이콘"></div>
|
||||
<div class="text">
|
||||
<p>회원님의 <span>소중한 정보보호를 위해 비밀번호를 다시 한 번 확인</span>합니다.</p>
|
||||
<p>(회원가입 시, 등록한 비밀번호를 입력해주세요.)</p>
|
||||
<p>(회원가입 시 등록한 비밀번호를 입력해주세요.)</p>
|
||||
</div>
|
||||
<div class="box">
|
||||
<p><input type="password" id="password" name="password" placeholder="비밀번호" onKeypress="javascript:if(event.keyCode==13) {goPutMyInfo();}"></p>
|
||||
|
||||
@ -430,7 +430,7 @@ var IMAGE_VIEW_URL = "https://port.nculture.org/nImageView.do?nImage=N";
|
||||
function gfn_showDocPdf(interfaceId,masterId,typeDivCd,dtlsTypeDivCd) {
|
||||
var url="";
|
||||
|
||||
if(typeDivCd == "IT_PHOTO" && (dtlsTypeDivCd == "C199" || dtlsTypeDivCd == "C01" || dtlsTypeDivCd == "C1"))
|
||||
if(typeDivCd == "IT_PHOTO" && (dtlsTypeDivCd == "C199" || dtlsTypeDivCd == "C01"))
|
||||
{
|
||||
url = IMG_VIEW_URL;
|
||||
}else if((typeDivCd == "IT_VIDEO") && (dtlsTypeDivCd == "C290" || dtlsTypeDivCd == "C02" || dtlsTypeDivCd == "C03"))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user