From b1bdb33a2343ceb8c807fbc3078615e524ee7474 Mon Sep 17 00:00:00 2001 From: Choins Date: Tue, 15 Sep 2026 17:54:28 +0900 Subject: [PATCH] =?UTF-8?q?20260907=20::=20=EA=B9=80=ED=98=84=EC=A0=95=20>?= =?UTF-8?q?=20260824=20PMS=20=EA=B0=9C=EC=84=A0=20=EC=9A=94=EC=B2=AD=5F?= =?UTF-8?q?=EA=B2=BD=EC=98=81=EB=AC=B8=ED=99=94=EB=B3=B8=EB=B6=80=204?= =?UTF-8?q?=EC=B0=A8=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- approval/doc_myun_pay_print2.asp | 6 +-- ess/doc_attach_add.asp | 93 ++++++++++++++++++++++++++++++++ ess/doc_attach_del.asp | 83 ++++++++++++++++++++++++++++ ess/doc_expense2_print_2014.asp | 9 ++-- ess/doc_expense_print_2014.asp | 9 ++-- 5 files changed, 191 insertions(+), 9 deletions(-) create mode 100644 ess/doc_attach_add.asp create mode 100644 ess/doc_attach_del.asp diff --git a/approval/doc_myun_pay_print2.asp b/approval/doc_myun_pay_print2.asp index be8d441..7f794d5 100644 --- a/approval/doc_myun_pay_print2.asp +++ b/approval/doc_myun_pay_print2.asp @@ -277,12 +277,12 @@ 'request("aa") query = "insert into 문서내용 (문서번호, 문서제목, target1, target2, target3, target4, target5, " - query = query & " target6, target7, target8, target9, target10, target11, target12, target13, target14, target15, target16, target17, target20, target21, target97,target98,target99,target100,p_sn, 발급일, 발급시각, login_p_no, login_이름,login_ip) values ( " + query = query & " target6, target7, target8, target9, target10, target11, target12, target13, target14, target15, target16, target17, target20, target21, target97,target98,target99,target100,p_sn, 발급일, 발급시각, login_p_no, login_이름,login_ip, remark1) values ( " query = query & "'" & krc_no & "', " query = query & "'" & replace(title, " ", "") & "', " query = query & "'" & gap(1) & "', " query = query & "'" & CheckWord(gap(2)) & "', " - query = query & "'" & gap(3) & "', " + query = query & "'" & year(date) & "-" & zeroformat(month(date),2) & "-" & zeroformat(day(date),2) & "', " query = query & "'" & gap(4) & "', " query = query & "'" & gap(5) & "', " query = query & "'" & gap(6) & "', " @@ -312,7 +312,7 @@ query = query & "'" & time() & "', " query = query & "'" & user_name(0) & "', " query = query & "'" & user_name(1) & "', " - query = query & "'" & Session("USERIP") & "') " + query = query & "'" & Session("USERIP") & "', '3') " 'Response.Write query & "
" adoconn.execute query diff --git a/ess/doc_attach_add.asp b/ess/doc_attach_add.asp new file mode 100644 index 0000000..64662a8 --- /dev/null +++ b/ess/doc_attach_add.asp @@ -0,0 +1,93 @@ + +<% +Response.CharSet = "euc-kr" +Response.AddHeader "Pragma","no-cache" +Response.Expires = -1 + +Dim attachClientIp +attachClientIp = Replace(Replace(Trim(Request.ServerVariables("REMOTE_ADDR")), "10.10.20.", "10.10.13."), "10.10.17.", "10.10.13.") + +If attachClientIp <> "10.10.13.47" And _ + attachClientIp <> "10.10.13.105" And _ + attachClientIp <> "10.10.13.48" And _ + attachClientIp <> "10.10.13.6" And _ + attachClientIp <> "10.10.13.29" Then + Response.Write "{""result"":""denied""}" + Response.End +End If + +Dim uploadform, fso, krc_no, folderPath, i, foundSlot, targetPath, fileName, ext +Dim allowedExt, folderObj, oneFile, us, dt, idxPart +Dim usedSlot(20) + +' PDFs are rasterized into jpg on the client (pdf.js) before upload, same as the +' registration page, so the server only ever needs to save the file as-is. +allowedExt = "|jpg|jpeg|png|gif|zip|pdf|hwp|doc|docx|xls|xlsx|ppt|pptx|" + +Set uploadform = Server.CreateObject("DEXT.FileUpload") +uploadform.Codepage = 949 + +krc_no = uploadform("krc_no") + +If krc_no = "" Or InStr(krc_no, "..") > 0 Or InStr(krc_no, "/") > 0 Or InStr(krc_no, "\") > 0 Then + Response.Write "{""result"":""fail""}" + Response.End +End If + +fileName = uploadform("attach_file")(1).FileName + +If fileName = "" Then + Response.Write "{""result"":""fail""}" + Response.End +End If + +ext = LCase(Mid(fileName, InStrRev(fileName, ".") + 1)) + +If InStr(allowedExt, "|" & ext & "|") = 0 Then + Response.Write "{""result"":""badtype""}" + Response.End +End If + +Set fso = Server.CreateObject("Scripting.FileSystemObject") +folderPath = Server.Mappath("/") & "/Upload/DOC_ATTACH/" & krc_no + +If fso.FolderExists(folderPath) = False Then + fso.CreateFolder folderPath +End If + +' find used index slots regardless of extension +Set folderObj = fso.GetFolder(folderPath) +For Each oneFile In folderObj.Files + us = InStrRev(oneFile.Name, "_") + dt = InStrRev(oneFile.Name, ".") + If us > 0 And dt > us Then + idxPart = Mid(oneFile.Name, us + 1, dt - us - 1) + If IsNumeric(idxPart) Then + If CInt(idxPart) >= 1 And CInt(idxPart) <= 20 Then + usedSlot(CInt(idxPart)) = 1 + End If + End If + End If +Next + +foundSlot = 0 +For i = 1 To 20 + If usedSlot(i) <> 1 Then + foundSlot = i + Exit For + End If +Next + +If foundSlot = 0 Then + Response.Write "{""result"":""full""}" + Response.End +End If + +targetPath = folderPath & "/" & krc_no & "_" & CStr(foundSlot) & "." & ext +uploadform("attach_file")(1).saveAs(targetPath) + +Response.Write "{""result"":""ok""}" + +Set fso = Nothing +Set uploadform = Nothing +%> diff --git a/ess/doc_attach_del.asp b/ess/doc_attach_del.asp new file mode 100644 index 0000000..a8e82dc --- /dev/null +++ b/ess/doc_attach_del.asp @@ -0,0 +1,83 @@ + +<% +Response.CharSet = "euc-kr" +Response.AddHeader "Pragma","no-cache" +Response.Expires = -1 + +Dim attachClientIp +attachClientIp = Replace(Replace(Trim(Request.ServerVariables("REMOTE_ADDR")), "10.10.20.", "10.10.13."), "10.10.17.", "10.10.13.") + +If attachClientIp <> "10.10.13.47" And _ + attachClientIp <> "10.10.13.105" And _ + attachClientIp <> "10.10.13.48" And _ + attachClientIp <> "10.10.13.6" And _ + attachClientIp <> "10.10.13.29" Then + Response.Write "{""result"":""denied""}" + Response.End +End If + +Dim fso, krc_no, delIdx, folderPath, i, writePos +Dim folderObj, oneFile, us, dt, idxPart, srcName, extPart +Dim fileMap(20) + +krc_no = Request.Form("krc_no") + +If krc_no = "" Or InStr(krc_no, "..") > 0 Or InStr(krc_no, "/") > 0 Or InStr(krc_no, "\") > 0 Then + Response.Write "{""result"":""fail""}" + Response.End +End If + +If Not IsNumeric(Request.Form("idx")) Then + Response.Write "{""result"":""fail""}" + Response.End +End If + +delIdx = CInt(Request.Form("idx")) + +If delIdx < 1 Or delIdx > 20 Then + Response.Write "{""result"":""fail""}" + Response.End +End If + +Set fso = Server.CreateObject("Scripting.FileSystemObject") +folderPath = Server.Mappath("/") & "/Upload/DOC_ATTACH/" & krc_no + +If fso.FolderExists(folderPath) = False Then + Response.Write "{""result"":""ok""}" + Response.End +End If + +Set folderObj = fso.GetFolder(folderPath) +For Each oneFile In folderObj.Files + us = InStrRev(oneFile.Name, "_") + dt = InStrRev(oneFile.Name, ".") + If us > 0 And dt > us Then + idxPart = Mid(oneFile.Name, us + 1, dt - us - 1) + If IsNumeric(idxPart) Then + If CInt(idxPart) >= 1 And CInt(idxPart) <= 20 Then + fileMap(CInt(idxPart)) = oneFile.Name + End If + End If + End If +Next + +If fileMap(delIdx) <> "" Then + fso.DeleteFile folderPath & "/" & fileMap(delIdx) + fileMap(delIdx) = "" +End If + +' close the numbering gap, preserving each remaining file's own extension +writePos = delIdx +For i = delIdx + 1 To 20 + If fileMap(i) <> "" Then + srcName = fileMap(i) + extPart = Mid(srcName, InStrRev(srcName, ".")) + fso.MoveFile folderPath & "/" & srcName, folderPath & "/" & krc_no & "_" & CStr(writePos) & extPart + writePos = writePos + 1 + End If +Next + +Response.Write "{""result"":""ok""}" + +Set fso = Nothing +%> diff --git a/ess/doc_expense2_print_2014.asp b/ess/doc_expense2_print_2014.asp index 6915767..6fd527c 100644 --- a/ess/doc_expense2_print_2014.asp +++ b/ess/doc_expense2_print_2014.asp @@ -30,6 +30,9 @@ '--------------- 추가(20170306)↓ ------------------------ dim xadmin : xadmin = request("xadmin") '-- 수정(edit) + dim attachClientIp, attachEditAllowed + attachClientIp = Replace(Replace(Trim(Request.ServerVariables("REMOTE_ADDR")), "10.10.20.", "10.10.13."), "10.10.17.", "10.10.13.") + attachEditAllowed = (attachClientIp = "10.10.13.47" Or attachClientIp = "10.10.13.105" Or attachClientIp = "10.10.13.48" Or attachClientIp = "10.10.13.6" Or attachClientIp = "10.10.13.29") 'response.write "[" & xadmin & "]" dim pay_type(4) @@ -915,7 +918,7 @@ if rsc.RecordCount > 0 then %>
" /> - <% If xadmin = "edit" And Session("N_depart") = "M" And Session("N_team") = "101" Then %> + <% If xadmin = "edit" And attachEditAllowed Then %> × <% End If %>
@@ -927,7 +930,7 @@ if rsc.RecordCount > 0 then <%=Ucase(Mid(attachFileMap(i), InStrRev(attachFileMap(i),".")+1))%> <%=attachFileMap(i)%> - <% If xadmin = "edit" And Session("N_depart") = "M" And Session("N_team") = "101" Then %> + <% If xadmin = "edit" And attachEditAllowed Then %> × <% End If %> @@ -936,7 +939,7 @@ if rsc.RecordCount > 0 then End If Next %> - <% If xadmin = "edit" And Session("N_depart") = "M" And Session("N_team") = "101" Then %> + <% If xadmin = "edit" And attachEditAllowed Then %>
+ 추가
<% End If %> diff --git a/ess/doc_expense_print_2014.asp b/ess/doc_expense_print_2014.asp index 942fa4d..7793fdd 100644 --- a/ess/doc_expense_print_2014.asp +++ b/ess/doc_expense_print_2014.asp @@ -28,6 +28,9 @@ Response.CharSet="euc-kr" '--------------- 추가(20170306)↓ ------------------------ dim xadmin : xadmin=request("xadmin") '-- 수정(edit) + dim attachClientIp, attachEditAllowed + attachClientIp = Replace(Replace(Trim(Request.ServerVariables("REMOTE_ADDR")), "10.10.20.", "10.10.13."), "10.10.17.", "10.10.13.") + attachEditAllowed = (attachClientIp = "10.10.13.47" Or attachClientIp = "10.10.13.105" Or attachClientIp = "10.10.13.48" Or attachClientIp = "10.10.13.6" Or attachClientIp = "10.10.13.29") dim pay_type(4) pay_type(1) = "카드/현금" pay_type(2) = "세금계산서" @@ -947,7 +950,7 @@ if rsc.RecordCount > 0 then %>
" /> - <% If xadmin = "edit" And Session("N_depart") = "M" And Session("N_team") = "101" Then %> + <% If xadmin = "edit" And attachEditAllowed Then %> × <% End If %>
@@ -959,7 +962,7 @@ if rsc.RecordCount > 0 then <%=Ucase(Mid(attachFileMap(i), InStrRev(attachFileMap(i),".")+1))%> <%=attachFileMap(i)%> - <% If xadmin = "edit" And Session("N_depart") = "M" And Session("N_team") = "101" Then %> + <% If xadmin = "edit" And attachEditAllowed Then %> × <% End If %> @@ -968,7 +971,7 @@ if rsc.RecordCount > 0 then End If Next %> - <% If xadmin = "edit" And Session("N_depart") = "M" And Session("N_team") = "101" Then %> + <% If xadmin = "edit" And attachEditAllowed Then %>
+ 추가
<% End If %>