불필요 CSRF 제거
This commit is contained in:
parent
5338723ce2
commit
e89959a55f
@ -82,16 +82,6 @@ public class ReadController extends NlibCommonController {
|
|||||||
return retJsp;
|
return retJsp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isValidCsrfToken(request, csrfToken)) {
|
|
||||||
if(fromCart && StringUtil.getString(fromPage, "").equalsIgnoreCase("login")) {
|
|
||||||
// 비로그인자의 카트에서 신청을 실행하여 로그인 후 신청 진입으로 돌아온 경우
|
|
||||||
return "redirect:/cart/listCartItems.do?cartTypeCd=2";
|
|
||||||
} else {
|
|
||||||
model.addAttribute("message", "잘못된 접근입니다.");
|
|
||||||
return retJsp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(readVO == null || StringUtil.isEmpty(readVO.getSelItems())) {
|
if(readVO == null || StringUtil.isEmpty(readVO.getSelItems())) {
|
||||||
if(fromCart && StringUtil.getString(fromPage, "").equalsIgnoreCase("login")) {
|
if(fromCart && StringUtil.getString(fromPage, "").equalsIgnoreCase("login")) {
|
||||||
// 비로그인자의 카트에서 신청을 실행하여 로그인 후 신청 진입으로 돌아온 경우
|
// 비로그인자의 카트에서 신청을 실행하여 로그인 후 신청 진입으로 돌아온 경우
|
||||||
|
|||||||
@ -238,16 +238,6 @@ public class RentController extends NlibCommonController
|
|||||||
return "nlib/rent/confirmRent";
|
return "nlib/rent/confirmRent";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isValidCsrfToken(request, csrfToken)) {
|
|
||||||
if(fromCart && StringUtil.getString(fromPage, "").equalsIgnoreCase("login")) {
|
|
||||||
// 비로그인자의 카트에서 신청을 실행하여 로그인 후 신청 진입으로 돌아온 경우
|
|
||||||
return "redirect:/cart/listCartItems.do";
|
|
||||||
} else {
|
|
||||||
model.addAttribute("message", "잘못된 접근입니다.");
|
|
||||||
return "nlib/rent/confirmRent";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(rentVO == null || StringUtil.isEmpty(rentVO.getSelItems())) {
|
if(rentVO == null || StringUtil.isEmpty(rentVO.getSelItems())) {
|
||||||
if(fromCart && StringUtil.getString(fromPage, "").equalsIgnoreCase("login")) {
|
if(fromCart && StringUtil.getString(fromPage, "").equalsIgnoreCase("login")) {
|
||||||
// 비로그인자의 카트에서 신청을 실행하여 로그인 후 신청 진입으로 돌아온 경우
|
// 비로그인자의 카트에서 신청을 실행하여 로그인 후 신청 진입으로 돌아온 경우
|
||||||
|
|||||||
@ -225,7 +225,7 @@ public class NlibSearchController extends NlibCommonController {
|
|||||||
}
|
}
|
||||||
secondClassList.get(i).put("cnt", Integer.toString(count));
|
secondClassList.get(i).put("cnt", Integer.toString(count));
|
||||||
}
|
}
|
||||||
// CSRF 토큰 생성 (2021.12.02 KKN 추가)
|
// CSRF 토큰 생성
|
||||||
String token = generateCsrfToken(request);
|
String token = generateCsrfToken(request);
|
||||||
model.addAttribute("csrfToken", token);
|
model.addAttribute("csrfToken", token);
|
||||||
|
|
||||||
@ -374,10 +374,6 @@ public class NlibSearchController extends NlibCommonController {
|
|||||||
imagePath = StringUtil.getString(vo.getRprsThumbUrl(),"");
|
imagePath = StringUtil.getString(vo.getRprsThumbUrl(),"");
|
||||||
}
|
}
|
||||||
|
|
||||||
// CSRF 토큰 생성 (2021.12.02 KKN 추가)
|
|
||||||
String token = generateCsrfToken(request);
|
|
||||||
model.addAttribute("csrfToken", token);
|
|
||||||
|
|
||||||
model.addAttribute("imageType",imageType);
|
model.addAttribute("imageType",imageType);
|
||||||
model.addAttribute("imagePath",imagePath);
|
model.addAttribute("imagePath",imagePath);
|
||||||
model.addAttribute("keywordList",keywordList);
|
model.addAttribute("keywordList",keywordList);
|
||||||
@ -473,7 +469,7 @@ public class NlibSearchController extends NlibCommonController {
|
|||||||
model.addAttribute("firstClassList", codeService.listCodes(Constant.CODE_ID_MASTER_TYPE_DIV_CD));
|
model.addAttribute("firstClassList", codeService.listCodes(Constant.CODE_ID_MASTER_TYPE_DIV_CD));
|
||||||
model.addAttribute("secondClassList", codeService.listCodes(Constant.CODE_ID_DTLS_TYPE_DIV_CD));
|
model.addAttribute("secondClassList", codeService.listCodes(Constant.CODE_ID_DTLS_TYPE_DIV_CD));
|
||||||
|
|
||||||
// CSRF 토큰 생성 (2021.12.02 KKN 추가)
|
// CSRF 토큰 생성
|
||||||
String token = generateCsrfToken(request);
|
String token = generateCsrfToken(request);
|
||||||
model.addAttribute("csrfToken", token);
|
model.addAttribute("csrfToken", token);
|
||||||
return "nlib/search/getDetailedSearchFormPopup";
|
return "nlib/search/getDetailedSearchFormPopup";
|
||||||
|
|||||||
@ -322,10 +322,10 @@ function goList(){
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="b-btn">
|
<div class="b-btn">
|
||||||
<c:if test="${result.ableRentAppNow }"><button type="button" class="btn btn-color" title="새 창 열림" onclick="gfn_rentItem('${result.mngOrgCd}', '${result.masterId}', '${csrfToken }')">대출신청</button></c:if>
|
<c:if test="${result.ableRentAppNow }"><button type="button" class="btn btn-color" title="새 창 열림" onclick="gfn_rentItem('${result.mngOrgCd}', '${result.masterId}')">대출신청</button></c:if>
|
||||||
<c:if test="${not result.ableRentAppNow and result.ableRentResNow }"><button type="button" class="btn btn-color" title="새 창 열림" onclick="gfn_rentItem('${result.mngOrgCd}', '${result.masterId}', '${csrfToken }')">대출예약</button></c:if>
|
<c:if test="${not result.ableRentAppNow and result.ableRentResNow }"><button type="button" class="btn btn-color" title="새 창 열림" onclick="gfn_rentItem('${result.mngOrgCd}', '${result.masterId}')">대출예약</button></c:if>
|
||||||
|
|
||||||
<c:if test="${result.ableReadNow }"><button type="button" class="btn btn-green" title="새 창 열림" onclick="gfn_reserveReadItem('${result.mngOrgCd}', '${result.masterId}', '${csrfToken }')">방문열람신청</button></c:if>
|
<c:if test="${result.ableReadNow }"><button type="button" class="btn btn-green" title="새 창 열림" onclick="gfn_reserveReadItem('${result.mngOrgCd}', '${result.masterId}')">방문열람신청</button></c:if>
|
||||||
|
|
||||||
<c:if test="${result.ableRent or result.ableRead }">
|
<c:if test="${result.ableRent or result.ableRead }">
|
||||||
<button type="button" class="btn btn-orange" onclick="gfn_addRentCart('${result.masterId}', '${result.ableRent}', '${result.ableRead}')">카트담기</button>
|
<button type="button" class="btn btn-orange" onclick="gfn_addRentCart('${result.masterId}', '${result.ableRent}', '${result.ableRead}')">카트담기</button>
|
||||||
|
|||||||
@ -110,10 +110,6 @@ function fn_insertRentItems() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function fn_gotoDetail(masterId) {
|
|
||||||
alert("상세보기 준비중 : " + masterId);
|
|
||||||
}
|
|
||||||
|
|
||||||
function fn_searchHome() {
|
function fn_searchHome() {
|
||||||
location.href = "/search/searchList.do";
|
location.href = "/search/searchList.do";
|
||||||
}
|
}
|
||||||
@ -191,7 +187,7 @@ $(document).ready(function() {
|
|||||||
<!-- 행 : 시작 -->
|
<!-- 행 : 시작 -->
|
||||||
<div class="list list-content">
|
<div class="list list-content">
|
||||||
<div class="t-data">
|
<div class="t-data">
|
||||||
<div class="img"><a href="javascript:void(0)"><img src="${rent.rprsThumbUrlWithDefaultSmall }" alt="썸네일" width="60" height="91" title="상세보기" onclick="fn_gotoDetail('${rent.masterId }')"></a>
|
<div class="img"><a href="javascript:void(0)"><img src="${rent.rprsThumbUrlWithDefaultSmall }" alt="썸네일" width="60" height="91" title="상세보기" onclick="gfn_getDetail('${rent.masterId }')"></a>
|
||||||
<c:if test='${rent.MUseYn == "Y"}'>
|
<c:if test='${rent.MUseYn == "Y"}'>
|
||||||
<span id="favorites_${rent.masterId}" class="favorites" onclick="gfn_changeInterest('${rent.masterId }', 'off')" title="관심자료에서 삭제합니다.">
|
<span id="favorites_${rent.masterId}" class="favorites" onclick="gfn_changeInterest('${rent.masterId }', 'off')" title="관심자료에서 삭제합니다.">
|
||||||
<img src="/images/icon/icon-cart-Favorites-on.png" class="off" alt="즐겨찾기 아이콘">
|
<img src="/images/icon/icon-cart-Favorites-on.png" class="off" alt="즐겨찾기 아이콘">
|
||||||
@ -217,7 +213,7 @@ $(document).ready(function() {
|
|||||||
<span class="visit">방문열람</span>
|
<span class="visit">방문열람</span>
|
||||||
</c:if>
|
</c:if>
|
||||||
</div>
|
</div>
|
||||||
<div class="title"><a href="javascript:void(0)" onclick="fn_gotoDetail('${rent.masterId }')" title="상세보기">${rent.title }</a></div>
|
<div class="title"><a href="javascript:void(0)" onclick="gfn_getDetail('${rent.masterId }')" title="상세보기">${rent.title }</a></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="t-state"><p>${rent.useStatusNm }</p></div>
|
<div class="t-state"><p>${rent.useStatusNm }</p></div>
|
||||||
<div class="t-date">${rent.rtnExpctDd }</div>
|
<div class="t-date">${rent.rtnExpctDd }</div>
|
||||||
|
|||||||
@ -520,37 +520,27 @@ function gfn_getDetail(masterId, host) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function gfn_rentItem(mngOrgCd, masterId, token) {
|
function gfn_rentItem(mngOrgCd, masterId) {
|
||||||
|
|
||||||
if(gfn_isEmpty(masterId)) {
|
if(gfn_isEmpty(masterId)) {
|
||||||
alert("자료ID 정보가 없습니다.");
|
alert("자료ID 정보가 없습니다.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(gfn_isEmpty(token)) {
|
var url = "/rent/confirmRent.do?mngOrgCd=" + mngOrgCd + "&selItems=" + masterId;
|
||||||
alert("잘못된 접근입니다.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var url = "/rent/confirmRent.do?mngOrgCd=" + mngOrgCd + "&selItems=" + masterId + "&csrfToken=" + token;
|
|
||||||
gfn_openNewWindow(url);
|
gfn_openNewWindow(url);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function gfn_reserveReadItem(mngOrgCd, masterId, token) {
|
function gfn_reserveReadItem(mngOrgCd, masterId) {
|
||||||
|
|
||||||
if(gfn_isEmpty(masterId)) {
|
if(gfn_isEmpty(masterId)) {
|
||||||
alert("자료ID 정보가 없습니다.");
|
alert("자료ID 정보가 없습니다.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(gfn_isEmpty(token)) {
|
var url = "/read/confirmRead.do?mngOrgCd=" + mngOrgCd + "&selItems=" + masterId;
|
||||||
alert("잘못된 접근입니다.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var url = "/read/confirmRead.do?mngOrgCd=" + mngOrgCd + "&selItems=" + masterId + "&csrfToken=" + token;
|
|
||||||
gfn_openNewWindow(url);
|
gfn_openNewWindow(url);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user