웹시큐리티 코딩 적용

This commit is contained in:
KNKIM 2021-08-03 13:36:24 +09:00
parent 77f24fb2fa
commit 2db5dd9bb6

View File

@ -40,14 +40,14 @@
<script type="text/javaScript" language="javascript">
//선택한 게시글 상세 보기로 이동
// 이전글/다음글 상세 보기로 이동
function fn_view_detail(articleNo) {
$("#articleNo").val(articleNo);
$("#articleForm").attr("action", "${pageContext.request.contextPath}/board/selectQnA.do");
$("#articleForm").submit();
}
// 선택한 게시글 상세 보기로 이동
// 목록으로 이동
function fn_list() {
$("#articleForm").attr("action", "${pageContext.request.contextPath}/board/listQnAs.do");
$("#articleForm").submit();
@ -65,12 +65,12 @@ function fn_updateForm(passwd) {
$("#articleForm").submit();
}
// 게시글 수정위한 비밀번호 확인
// 수정위한 비밀번호 확인
function fn_updatePassword() {
fn_promptPassword("수정을 위한 글 비밀번호를 입력하여 주시기 바랍니다.", "111", "fn_updateForm")
}
// 게시글 삭제위한 비밀번호 확인
// 삭제위한 비밀번호 확인
function fn_deletePassword() {
fn_promptPassword("삭제를 위한 글 비밀번호를 입력하여 주시기 바랍니다.", "111", "fn_delete")
}
@ -86,6 +86,24 @@ function fn_delete(passwd) {
$("#articleForm").attr("action", "${pageContext.request.contextPath}/board/deleteQnA.do");
$("#articleForm").submit();
}
// 파일 다운로드
function fn_downloadFile(fid, fname) {
if(fid == null || fid.trim().length < 1) {
alert("파일정보를 확인해 주시기 바랍니다.[1]");
return;
}
if(fname == null || fname.trim().length < 1) {
alert("파일정보를 확인해 주시기 바랍니다.[2]");
return;
}
$("#fid").val(fid);
$("#fname").val(fname);
$("#downloadFileForm").submit();
}
</script>
</head>
@ -129,7 +147,7 @@ function fn_delete(passwd) {
<c:set var="contentQeustFileList" value="${fn:split(article.contentQeustFile,';')}" />
<c:forEach var="contentQuestFileItem" items="${contentQeustFileList }">
<c:set var="fInfo" value="${fn:split(contentQuestFileItem,'=')}" />
<a href="${pageContext.request.contextPath}/fileupload/downloadFiles.do?subPathKey=fileupload.bbs.qna.subpath&fid=${fInfo[0]}&fname=${fInfo[1]}">${fInfo[1]}</a><br/>
<a href="javascript:void(0);" onclick="fn_downloadFile('${fInfo[0]}', '${fInfo[1]}')">${fInfo[1]}</a><br/>
</c:forEach>
</td>
</tr>
@ -173,5 +191,16 @@ function fn_delete(passwd) {
</form>
<br />
<!-- 첨부파일 다운로드용 폼 -->
<form name="downloadFileForm" id="downloadFileForm"
action="${pageContext.request.contextPath}/fileupload/downloadFiles.do"
method="post">
<input type="text" name="subPathKey" id="subPathKey" value="fileupload.bbs.qna.subpath" readonly />
<input type="text" name="fid" id="fid" value="" readonly />
<input type="text" name="fname" id="fname" value="" readonly />
</form>
</body>
</html>