에디터 라이센스 수정

강석 최 2022-12-21 09:37:18 +09:00
parent 71eebe500f
commit b00f24d127
81 changed files with 6373 additions and 293 deletions

View File

@ -158,17 +158,17 @@
<item>
<id>NAMO_CROSSUPLOADER_INFORMATION_COMPANY</id>
<ko>소속/회사 : 해양경찰청</ko>
<en>Company : Korea Coast Guard.</en>
<en>Company : 해양경찰청</en>
</item>
<item>
<id>NAMO_CROSSUPLOADER_INFORMATION_USE</id>
<ko>용도 : 보안정보관리시스템</ko>
<ko>용도 : 외사종합포탈</ko>
<en>Use : Intranet Version</en>
</item>
<item>
<id>NAMO_CROSSUPLOADER_INFORMATION_PRODUCT_NUMBER</id>
<ko>제품번호 : 16001-001201-000766</ko>
<en>Product Number : 16001-001201-000766</en>
<ko>제품번호 : 16001-001201-000796</ko>
<en>Product Number : 16001-001201-000796</en>
</item>
</items>

View File

@ -126,17 +126,17 @@
<item>
<id>NAMO_CROSSUPLOADER_INFORMATION_COMPANY</id>
<ko>소속/회사 : 해양경찰청</ko>
<en>Company : Korea Coast Guard.</en>
<en>Company : 해양경찰청</en>
</item>
<item>
<id>NAMO_CROSSUPLOADER_INFORMATION_USE</id>
<ko>용도 : 보안정보관리시스템</ko>
<ko>용도 : 외사종합포탈</ko>
<en>Use : Intranet Version</en>
</item>
<item>
<id>NAMO_CROSSUPLOADER_INFORMATION_PRODUCT_NUMBER</id>
<ko>제품번호 : 16001-001201-000766</ko>
<en>Product Number : 16001-001201-000766</en>
<ko>제품번호 : 16001-001201-000796</ko>
<en>Product Number : 16001-001201-000796</en>
</item>
</items>

View File

@ -2,13 +2,13 @@
<xsl:output method="html" />
<xsl:template match="/">
<table id='pe_aIr' class='editortable' cellspacing='0' cellpadding='0' style='border-collapse:separate; table-layout:fixed; text-align:left; border:0;'>
<table id='pe_aLS' class='editortable' cellspacing='0' cellpadding='0' style='border-collapse:separate; table-layout:fixed; text-align:left; border:0;'>
<tbody>
<tr onselectstart='return false;'>
<td class='NamoSE_skinLeft'><img id='pe_asy' name='skin_left.gif' style="width:0px;display:none;" alt=""/></td>
<td class='NamoSE_skinLeft'><img id='pe_asX' name='skin_left.gif' style="width:0px;display:none;" alt=""/></td>
<td class='NamoSE_skinBg'>
<table id='pe_aHi' cellspacing='0' cellpadding='0' style='border-collapse:separate; table-layout:auto;'>
<table id='pe_aJv' cellspacing='0' cellpadding='0' style='border-collapse:separate; table-layout:auto;'>
<tr>
<td class='NamoSE_skinLine ce-namo-menu'></td>
</tr>
@ -81,7 +81,7 @@
</table>
</td>
<td class='NamoSE_skinRight'><img id='pe_OZ' name='skin_right.gif' style="width:0px;display:none;" alt=""/></td>
<td class='NamoSE_skinRight'><img id='pe_ME' name='skin_right.gif' style="width:0px;display:none;" alt=""/></td>
</tr>
<tr>
<td colspan='3' class="NamoSE_skinEditor">
@ -91,14 +91,14 @@
</tr>
<tr>
<td style='width:5px' class="ce-ui-editor-margin-left"></td>
<td id='pe_aHT'></td>
<td id='pe_aKy'></td>
<td style='width:5px' class="ce-ui-editor-margin-right"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td id='pe_aHs' colspan='3' class='NamoSE_skinEditorButton'><img id='wysiwyg' name='btn_modebar_bk.gif' class='NamoSE_btn_modebar' /><img id='html' name='btn_modebar_bk.gif' class='NamoSE_btn_modebar NamoSE_btn_modebar_off' /><img id='preview' name='btn_modebar_bk.gif' class='NamoSE_btn_modebar NamoSE_btn_modebar_off' /></td>
<td id='pe_aJT' colspan='3' class='NamoSE_skinEditorButton'><img id='wysiwyg' name='btn_modebar_bk.gif' class='NamoSE_btn_modebar' /><img id='html' name='btn_modebar_bk.gif' class='NamoSE_btn_modebar NamoSE_btn_modebar_off' /><img id='preview' name='btn_modebar_bk.gif' class='NamoSE_btn_modebar NamoSE_btn_modebar_off' /></td>
</tr>
</tbody>
</table>

View File

@ -2,13 +2,13 @@
<xsl:output method="html" />
<xsl:template match="/">
<table id='pe_aIr' class='editortable' cellspacing='0' cellpadding='0' style='border-collapse:separate; table-layout:fixed; text-align:left; border:0;'>
<table id='pe_aLS' class='editortable' cellspacing='0' cellpadding='0' style='border-collapse:separate; table-layout:fixed; text-align:left; border:0;'>
<tbody>
<tr>
<td class='NamoSE_skinLeft'><img id='pe_asy' name='skin_left.gif' /></td>
<td class='NamoSE_skinLeft'><img id='pe_asX' name='skin_left.gif' /></td>
<td class='NamoSE_skinBg'>
<table id='pe_aHi' cellspacing='0' cellpadding='0' style='border-collapse:separate; table-layout:auto;'>
<table id='pe_aJv' cellspacing='0' cellpadding='0' style='border-collapse:separate; table-layout:auto;'>
<xsl:for-each select="ToolBar/Panel">
@ -72,7 +72,7 @@
</table>
</td>
<td class='NamoSE_skinRight'><img id='pe_OZ' name='skin_right.gif' /></td>
<td class='NamoSE_skinRight'><img id='pe_ME' name='skin_right.gif' /></td>
</tr>
<tr>
<td colspan='3' class="NamoSE_skinEditor">
@ -82,10 +82,10 @@
</tr>
<tr>
<td style='width:5px'></td>
<td id='pe_aHT'></td>
<td id='pe_aKy'></td>
</tr>
<tr>
<td id='pe_aHs' colspan='2' class='NamoSE_skinEditorButton'><img id='wysiwyg' name='btn_modebar_bk.gif' class='NamoSE_btn_modebar' /><img id='html' name='btn_modebar_bk.gif' class='NamoSE_btn_modebar NamoSE_btn_modebar_off' /><img id='preview' name='btn_modebar_bk.gif' class='NamoSE_btn_modebar NamoSE_btn_modebar_off' /></td>
<td id='pe_aJT' colspan='2' class='NamoSE_skinEditorButton'><img id='wysiwyg' name='btn_modebar_bk.gif' class='NamoSE_btn_modebar' /><img id='html' name='btn_modebar_bk.gif' class='NamoSE_btn_modebar NamoSE_btn_modebar_off' /><img id='preview' name='btn_modebar_bk.gif' class='NamoSE_btn_modebar NamoSE_btn_modebar_off' /></td>
</tr>
</table>
</td>

View File

@ -8,9 +8,11 @@
<script type="text/javascript">
var ce$ = namo$.noConflict(true);
var ebdi = location.search;
if(new RegExp('script', 'i').test(ebdi) || new RegExp('<').test(ebdi) ){
ebdi = "";
}
ebdi = ebdi.replace("?","namo_data_char1");
ebdi = ebdi.replace("=","namo_data_char2");
ebdi = encodeURIComponent(ebdi);
ebdi = ebdi.replace("namo_data_char1","?");
ebdi = ebdi.replace("namo_data_char2","=");
document.write('<scr'+'ipt type="text/javascript" src="' + '../../js/namo_cengine.js'+ebdi+'"></scr'+'ipt>');
</script>

View File

@ -9,7 +9,7 @@
var ce$ = namo$.noConflict(true);
</script>
<script type="text/javascript" src="../../lib/jquery.mCustomScrollbar.concat.min.js"></script>
<link id="pe_aQJ" href="../../css/namose_general.css" rel="stylesheet" type="text/css">
<link id="pe_aNs" href="../../css/namose_general.css" rel="stylesheet" type="text/css">
</head>
<body>
</body>

View File

@ -7,9 +7,9 @@
<Info></Info>
</Product>
<General>
<WebServerOS>WINDOW</WebServerOS>
<WebServerOS>LINUX</WebServerOS>
<WebServerInfo>Tomcat</WebServerInfo>
<WebLanguage>HTML</WebLanguage>
<WebLanguage>JSP</WebLanguage>
<ImageSavePath></ImageSavePath>
<Width>730</Width>
<Height>450</Height>
@ -102,7 +102,7 @@
<Version>1.0.0.23</Version>
<Version_daemon>1.0.0.3</Version_daemon>
<Version_com>1.0.0.19</Version_com>
<SupportBrowser></SupportBrowser>
<SupportBrowser>1</SupportBrowser>
<AutoInstall></AutoInstall>
</Plugins>
<Mime>

View File

@ -75,8 +75,8 @@
<item name="underline" type="image" src="underline.gif"/>
<item name="strikethrough" type="image" src="strikethrough.gif"/>
<item name="space" type="image" src="space.gif"/>
<item name="fontcolor" type="image" src="fontcolor.gif"/>
<item name="fontbackgroundcolor" type="image" src="fontbackgroundcolor.gif"/>
<item name="fontcolor" type="image" src="numbersettype.gif"/>
<item name="fontbackgroundcolor" type="image" src="numbersettype.gif"/>
<item name="cancelattribute" type="image" src="cancelattribute.gif"/>
<item name="spacebar" type="image" src="spacebar.gif"/>
<item name="subscript" type="image" src="subscript.gif"/>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
div.header{width:100%;background-color:#131313;height:35px;text-align:center;color:white;padding-top:7px;}div.footer{width:100%;height:60px;background-color:#e4e4e4;position:fixed;bottom:0;text-align:center;background-repeat:no-repeat;background-position:19px;background-size:154px;background-position:19px;line-height:60px;}div.footer span{font-family:'sans-serif';font-size:11px;color:gray;}div.contents{margin:auto;display:table-cell;vertical-align:middle;text-align:center;}div.pe_aAA{display:inline-block;margin-top:4px;overflow:hidden;position:relative;box-shadow:10px 10px 5px #888888;}div.pe_adA{width:2000px;text-align:left;position:absolute;}div{padding:0px;margin:0px;}body{padding:0px;margin:0px;}.ui-dialog-title{text-align:center;}#pe_bSh{position:relative;width:125px;height:125px;margin:auto;margin-top:165px;transform:scale(0.6); -o-transform:scale(0.6); -ms-transform:scale(0.6); -webkit-transform:scale(0.6); -moz-transform:scale(0.6);}.pe_ack{position:absolute;background-color:rgb(255,255,255);height:22px;width:22px;border-radius:12px; -o-border-radius:12px; -ms-border-radius:12px; -webkit-border-radius:12px; -moz-border-radius:12px;animation-name:f_fadeG; -o-animation-name:f_fadeG; -ms-animation-name:f_fadeG; -webkit-animation-name:f_fadeG; -moz-animation-name:f_fadeG;animation-duration:1.2s; -o-animation-duration:1.2s; -ms-animation-duration:1.2s; -webkit-animation-duration:1.2s; -moz-animation-duration:1.2s;animation-iteration-count:infinite; -o-animation-iteration-count:infinite; -ms-animation-iteration-count:infinite; -webkit-animation-iteration-count:infinite; -moz-animation-iteration-count:infinite;animation-direction:normal; -o-animation-direction:normal; -ms-animation-direction:normal; -webkit-animation-direction:normal; -moz-animation-direction:normal;}#pe_bRe{left:0;top:51px;animation-delay:0.45s; -o-animation-delay:0.45s; -ms-animation-delay:0.45s; -webkit-animation-delay:0.45s; -moz-animation-delay:0.45s;}#pe_bQF{left:15px;top:15px;animation-delay:0.6s; -o-animation-delay:0.6s; -ms-animation-delay:0.6s; -webkit-animation-delay:0.6s; -moz-animation-delay:0.6s;}#pe_bQQ{left:51px;top:0;animation-delay:0.75s; -o-animation-delay:0.75s; -ms-animation-delay:0.75s; -webkit-animation-delay:0.75s; -moz-animation-delay:0.75s;}#pe_bRH{right:15px;top:15px;animation-delay:0.9s; -o-animation-delay:0.9s; -ms-animation-delay:0.9s; -webkit-animation-delay:0.9s; -moz-animation-delay:0.9s;}#pe_bSf{right:0;top:51px;animation-delay:1.05s; -o-animation-delay:1.05s; -ms-animation-delay:1.05s; -webkit-animation-delay:1.05s; -moz-animation-delay:1.05s;}#pe_bQy{right:15px;bottom:15px;animation-delay:1.2s; -o-animation-delay:1.2s; -ms-animation-delay:1.2s; -webkit-animation-delay:1.2s; -moz-animation-delay:1.2s;}#pe_bQN{left:51px;bottom:0;animation-delay:1.35s; -o-animation-delay:1.35s; -ms-animation-delay:1.35s; -webkit-animation-delay:1.35s; -moz-animation-delay:1.35s;}#pe_bRc{left:15px;bottom:15px;animation-delay:1.5s; -o-animation-delay:1.5s; -ms-animation-delay:1.5s; -webkit-animation-delay:1.5s; -moz-animation-delay:1.5s;}@keyframes f_fadeG{0%{background-color:rgb(0,0,0);}100%{background-color:rgb(255,255,255);}}@-o-keyframes f_fadeG{0%{background-color:rgb(0,0,0);}100%{background-color:rgb(255,255,255);}}@-ms-keyframes f_fadeG{0%{background-color:rgb(0,0,0);}100%{background-color:rgb(255,255,255);}}@-webkit-keyframes f_fadeG{0%{background-color:rgb(0,0,0);}100%{background-color:rgb(255,255,255);}}@-moz-keyframes f_fadeG{0%{background-color:rgb(0,0,0);}100%{background-color:rgb(255,255,255);}}
div.header{width:100%;background-color:#131313;height:35px;text-align:center;color:white;padding-top:7px;}div.footer{width:100%;height:60px;background-color:#e4e4e4;position:fixed;bottom:0;text-align:center;background-repeat:no-repeat;background-position:19px;background-size:154px;background-position:19px;line-height:60px;}div.footer span{font-family:'sans-serif';font-size:11px;color:gray;}div.contents{margin:auto;display:table-cell;vertical-align:middle;text-align:center;}div.pe_aBR{display:inline-block;margin-top:4px;overflow:hidden;position:relative;box-shadow:10px 10px 5px #888888;}div.pe_XI{width:2000px;text-align:left;position:absolute;}div{padding:0px;margin:0px;}body{padding:0px;margin:0px;}.ui-dialog-title{text-align:center;}#pe_bNe{position:relative;width:125px;height:125px;margin:auto;margin-top:165px;transform:scale(0.6); -o-transform:scale(0.6); -ms-transform:scale(0.6); -webkit-transform:scale(0.6); -moz-transform:scale(0.6);}.pe_abp{position:absolute;background-color:rgb(255,255,255);height:22px;width:22px;border-radius:12px; -o-border-radius:12px; -ms-border-radius:12px; -webkit-border-radius:12px; -moz-border-radius:12px;animation-name:f_fadeG; -o-animation-name:f_fadeG; -ms-animation-name:f_fadeG; -webkit-animation-name:f_fadeG; -moz-animation-name:f_fadeG;animation-duration:1.2s; -o-animation-duration:1.2s; -ms-animation-duration:1.2s; -webkit-animation-duration:1.2s; -moz-animation-duration:1.2s;animation-iteration-count:infinite; -o-animation-iteration-count:infinite; -ms-animation-iteration-count:infinite; -webkit-animation-iteration-count:infinite; -moz-animation-iteration-count:infinite;animation-direction:normal; -o-animation-direction:normal; -ms-animation-direction:normal; -webkit-animation-direction:normal; -moz-animation-direction:normal;}#pe_bKR{left:0;top:51px;animation-delay:0.45s; -o-animation-delay:0.45s; -ms-animation-delay:0.45s; -webkit-animation-delay:0.45s; -moz-animation-delay:0.45s;}#pe_bKN{left:15px;top:15px;animation-delay:0.6s; -o-animation-delay:0.6s; -ms-animation-delay:0.6s; -webkit-animation-delay:0.6s; -moz-animation-delay:0.6s;}#pe_bLe{left:51px;top:0;animation-delay:0.75s; -o-animation-delay:0.75s; -ms-animation-delay:0.75s; -webkit-animation-delay:0.75s; -moz-animation-delay:0.75s;}#pe_bLT{right:15px;top:15px;animation-delay:0.9s; -o-animation-delay:0.9s; -ms-animation-delay:0.9s; -webkit-animation-delay:0.9s; -moz-animation-delay:0.9s;}#pe_bKY{right:0;top:51px;animation-delay:1.05s; -o-animation-delay:1.05s; -ms-animation-delay:1.05s; -webkit-animation-delay:1.05s; -moz-animation-delay:1.05s;}#pe_bMo{right:15px;bottom:15px;animation-delay:1.2s; -o-animation-delay:1.2s; -ms-animation-delay:1.2s; -webkit-animation-delay:1.2s; -moz-animation-delay:1.2s;}#pe_bLQ{left:51px;bottom:0;animation-delay:1.35s; -o-animation-delay:1.35s; -ms-animation-delay:1.35s; -webkit-animation-delay:1.35s; -moz-animation-delay:1.35s;}#pe_bLv{left:15px;bottom:15px;animation-delay:1.5s; -o-animation-delay:1.5s; -ms-animation-delay:1.5s; -webkit-animation-delay:1.5s; -moz-animation-delay:1.5s;}@keyframes f_fadeG{0%{background-color:rgb(0,0,0);}100%{background-color:rgb(255,255,255);}}@-o-keyframes f_fadeG{0%{background-color:rgb(0,0,0);}100%{background-color:rgb(255,255,255);}}@-ms-keyframes f_fadeG{0%{background-color:rgb(0,0,0);}100%{background-color:rgb(255,255,255);}}@-webkit-keyframes f_fadeG{0%{background-color:rgb(0,0,0);}100%{background-color:rgb(255,255,255);}}@-moz-keyframes f_fadeG{0%{background-color:rgb(0,0,0);}100%{background-color:rgb(255,255,255);}}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -13,15 +13,15 @@
$(function() {
var Profanitystr = "초딩,깡패,꺼벙이,멍청이,바보,사이비";
$("#pe_aII").val(Profanitystr);
$("#pe_bSx").click(function(){
$("#pe_aGZ").val(Profanitystr);
$("#pe_bQX").click(function(){
if (CrossEditor.IsPrivacyInfo(true,true,true)) {
alert('개인정보 발견');
} else {
alert('개인정보가 발견되지 않았습니다.');
}
});
$("#pe_bTH").click(function(){
$("#pe_bSo").click(function(){
if (CrossEditor.IsProhibitProfanity()) {
var arr = CrossEditor.GetProhibitProfanity();
alert("욕설단어가 발견되었습니다. " + "\n [" + arr.toString() + "]");
@ -29,33 +29,33 @@
alert('욕설단어가 발견되지 않았습니다.');
}
});
$("#pe_bIM").click(function(){
$("#pe_bMj").click(function(){
var len = CrossEditor.GetTextValueLength();
alert(len);
});
$("#pe_bTG").click(function(){
CrossEditor.params.ProfanityStr = $("#pe_aII").val();
$("#pe_bTP").click(function(){
CrossEditor.params.ProfanityStr = $("#pe_aGZ").val();
});
$("#pe_bSp").click(function(){
$("#pe_aII").val(Profanitystr);
$("#pe_bTw").click(function(){
$("#pe_aGZ").val(Profanitystr);
CrossEditor.params.ProfanityStr = Profanitystr;
});
$(".pe_bEK").click(function(){
$(".pe_bIW").click(function(){
if (CrossEditor) {
pe_by({Csslist:$("#pe_boG").val()});
pe_as({Csslist:$("#pe_bBh").val()});
}
});
$(".pe_bGP").click(function(){
$(".pe_bIy").click(function(){
if (CrossEditor) {
pe_by ({Placeholder:$("#pe_boC").val()});
pe_as ({Placeholder:$("#pe_bCD").val()});
}
});
$(".pe_bZD").click(function(){
$(".pe_bSW").click(function(){
if (CrossEditor) {
var serverURL = 2;
var id = $("input:radio[name=pe_bsL]:checked").attr("id");
var id = $("input:radio[name=pe_bot]:checked").attr("id");
switch (id) {
case "pe_bnm":
case "pe_brn":
serverURL = 1;
break;
case "serverURL":
@ -63,13 +63,13 @@
break;
}
pe_by ({ServerUrl :serverURL});
pe_as ({ServerUrl :serverURL});
}
});
});
function pe_by(obj)
function pe_as(obj)
{
if (CrossEditor) {
CrossEditor.destroyEditor();
@ -81,7 +81,7 @@
}
function pe_fg(obj){
function pe_ev(obj){
if (obj.value == "ShowTab(false)"){
CrossEditor.ShowTab(false);
obj.value = "ShowTab(true)";
@ -91,7 +91,7 @@
}
}
function pe_bZ(obj){
function pe_dx(obj){
if (obj.value == "ShowToolbar(Hide All)"){
CrossEditor.ShowToolbar(0, 0);
CrossEditor.ShowToolbar(1, 0);
@ -107,7 +107,7 @@
}
}
function pe_ex(obj){
function pe_ek(obj){
if (obj.value == "SetUISize(800,600)"){
CrossEditor.SetUISize("800", "600");
obj.value = "SetUISize(100%,600)";
@ -136,26 +136,25 @@
<table>
<tr>
<td><h3><span id="pe_ajc"></span>&nbsp;Sample Page - <span id="pe_bBo"></span></h3></td>
<td><h3><span id="pe_aja"></span>&nbsp;Sample Page - <span id="pe_bEp"></span></h3></td>
</tr>
<tr>
<td id="ce-parent-node" style="width:980px;">
<textarea id="pe_bhr" name="pe_bhr" alt="initText" title="initText" Style="width:730px; height:450px; font-size:10pt"><p>Welcome to <span style="font-weight: bold;">CrossEditor 4.0</span> sample page</p></textarea>
<textarea id="pe_bgm" name="pe_bgm" alt="initText" title="initText" Style="width:730px; height:450px; font-size:10pt"><p>Welcome to <span style="font-weight: bold;">CrossEditor 4.0</span> sample page</p></textarea>
<script type="text/javascript" language="javascript">
var CrossEditor = new NamoSE('pe_bhr');
var CrossEditor = new NamoSE('pe_bgm');
CrossEditor.params.Width = "100%";
CrossEditor.params.UserLang = "auto";
CrossEditor.params.NewToolbar = true;
CrossEditor.params.FullScreen = false;
CrossEditor.EditorStart();
function OnInitCompleted(e){
e.editorTarget.SetBodyValue(document.getElementById("pe_bhr").value);
e.editorTarget.SetBodyValue(document.getElementById("pe_bgm").value);
}
</script>
@ -167,17 +166,17 @@
<div style="width:724px;border:none;padding:5px;">
<input id="pe_bYm" type="radio" checked name="pe_bsL" /><label for="pe_bYm" style="margin-right:13px">도메인 제외 URL</label>
<input id="pe_bnm" type="radio" name="pe_bsL"/><label for="pe_bnm" style="margin-right:13px">전체 URL</label>
<button class="pe_bZD" style="margin-left:448px">적용</button>
<input id="pe_bSz" type="radio" checked name="pe_bot" /><label for="pe_bSz" style="margin-right:13px">도메인 제외 URL</label>
<input id="pe_brn" type="radio" name="pe_bot"/><label for="pe_brn" style="margin-right:13px">전체 URL</label>
<button class="pe_bSW" style="margin-left:448px">적용</button>
</div>
<div style="width:724px;border:none;padding:5px;">
<label for="pe_boG" style="margin-right:13px">css file url </label><input style="width:584px" id="pe_boG" type="text" value="" placeholder="css파일간의 구분자 ',' (예 - test.css,test1.css)" />
<button class="pe_bEK">적용</button>
<label for="pe_bBh" style="margin-right:13px">css file url </label><input style="width:584px" id="pe_bBh" type="text" value="" placeholder="css파일간의 구분자 ',' (예 - test.css,test1.css)" />
<button class="pe_bIW">적용</button>
</div>
<div style="width:724px;border:none;padding:5px;">
<label for="pe_boC" style="margin-right:10px">placeholder</label><input style="width:584px" id="pe_boC" type="text" value="" placeholder="placeholder문자열 (예 - 여기에 내용을 입력하세요.)" />
<button class="pe_bGP">적용</button>
<label for="pe_bCD" style="margin-right:10px">placeholder</label><input style="width:584px" id="pe_bCD" type="text" value="" placeholder="placeholder문자열 (예 - 여기에 내용을 입력하세요.)" />
<button class="pe_bIy">적용</button>
</div>
<div style="width:724px;border:none;padding:5px;">
<div style="width:100%;border-bottom: 1px dotted rgb(100,100,100);padding-bottom: 9px;text-align: center;">
@ -187,15 +186,15 @@
<input type="button" style="width:162px;background-color: rgb(100,100,255);color:rgb(255,255,255)"id="setBodyValue" name="setBodyValue" value="SetBodyValue()" onclick="CrossEditor.SetBodyValue(document.getElementById('value').value)">
</div>
<div style="width:100%;padding-top:9px;border-bottom: 1px dotted rgb(100,100,100);padding-bottom: 9px;text-align: center;">
<label style="margin-right:5px" for="pe_aII">금지어설정</label>
<input style="width:531px" type="text" id="pe_aII" />
<input id="pe_bTG" style="margin-left:5px" type="button" name="" value="적용" />
<input id="pe_bSp" style="margin-left:3px" type="button" name="" value="초기화" />
<label style="margin-right:5px" for="pe_aGZ">금지어설정</label>
<input style="width:531px" type="text" id="pe_aGZ" />
<input id="pe_bTP" style="margin-left:5px" type="button" name="" value="적용" />
<input id="pe_bTw" style="margin-left:3px" type="button" name="" value="초기화" />
</div>
<div style="width:100%;padding-top:9px;">
<button id="pe_bSx">개인정보 유무 검사</button>
<button id="pe_bTH">금지어 유무 검사</button>
<button id="pe_bIM">본문 내용의 문자 길이</button>
<button id="pe_bQX">개인정보 유무 검사</button>
<button id="pe_bSo">금지어 유무 검사</button>
<button id="pe_bMj">본문 내용의 문자 길이</button>
</div>
</div>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
var pe_wc={Upload:function(form,pe_amx,pe_GV,pe_apj,pe_aog,pe_auD){ce$(form).ajaxForm({formData:pe_auD,url:pe_amx,beforeSend:function(e){pe_GV();},complete:function(xhr){pe_apj(xhr);},pe_bxn:function(event,position,total,pe_aVo){var pe_bXD=pe_aVo+'\x25';},error:function(response,status,request){pe_aog();}}).submit();},pe_bvu:function(fd,pe_amx,pe_GV,pe_apj,pe_aog){ce$.ajax({url:pe_amx,data:fd,processData:false,contentType:false,type:'\x50\x4f\x53\x54',beforeSend:function(e){pe_GV();},complete:function(xhr){pe_apj(xhr);},error:function(response,status,request){pe_aog();}});},pe_VD:function(form,pe_amx,pe_GV,pe_apj,pe_aog,pe_auD){var fd=null;if(pe_auD){fd=pe_auD;}else{fd=new FormData(form);}ce$.ajax({url:pe_amx,data:fd,processData:false,contentType:false,type:'\x50\x4f\x53\x54',xhrFields:{withCredentials:true},beforeSend:function(e){pe_GV();},complete:function(xhr){pe_apj(xhr);},pe_bxn:function(event,position,total,pe_aVo){var pe_bXD=pe_aVo+'\x25';},error:function(response,status,request){pe_aog();}});}};
var pe_vp={Upload:function(form,pe_agm,pe_Mq,pe_amP,pe_aoR,pe_arP){ce$(form).ajaxForm({formData:pe_arP,url:pe_agm,beforeSend:function(e){pe_Mq();},complete:function(xhr){pe_amP(xhr);},pe_bjn:function(event,position,total,pe_aVC){var pe_bEP=pe_aVC+'\x25';},error:function(response,status,request){pe_aoR();}}).submit();},pe_byk:function(fd,pe_agm,pe_Mq,pe_amP,pe_aoR){ce$.ajax({url:pe_agm,data:fd,processData:false,contentType:false,type:'\x50\x4f\x53\x54',beforeSend:function(e){pe_Mq();},complete:function(xhr){pe_amP(xhr);},error:function(response,status,request){pe_aoR();}});},pe_Ua:function(form,pe_agm,pe_Mq,pe_amP,pe_aoR,pe_arP){var fd=null;if(pe_arP){fd=pe_arP;}else{fd=new FormData(form);}ce$.ajax({url:pe_agm,data:fd,processData:false,contentType:false,type:'\x50\x4f\x53\x54',xhrFields:{withCredentials:true},beforeSend:function(e){pe_Mq();},complete:function(xhr){pe_amP(xhr);},pe_bjn:function(event,position,total,pe_aVC){var pe_bEP=pe_aVC+'\x25';},error:function(response,status,request){pe_aoR();}});}};

View File

@ -1 +1 @@
var pe_bzK={pe_bQM:function(pe_wW,t){function toDataURL(url,callback){var xhr=new XMLHttpRequest();xhr.onload=function(){var pe_pZ=new FileReader();pe_pZ.onloadend=function(){callback(pe_pZ.result);};pe_pZ.readAsDataURL(xhr.response);};xhr.onerror=function(){callback(url);};if(url){xhr.open('\x47\x45\x54',url);xhr.responseType='\x62\x6c\x6f\x62';xhr.send();}else{callback(null);}};var pe_LS=[];var imgs=t.getDocument().getElementsByTagName("\x69\x6d\x67");for(var i=0;imgs.length>i;i++){var pe_lX=new Promise(function(resolve,reject){toDataURL(imgs[i].src,function(pe_bfb){resolve(pe_bfb);});});pe_LS.push(pe_lX);}var pe_aqw=t.GetValue("\x77\x6f\x72\x64");Promise.all(pe_LS).then(function(values){var i=0;pe_aqw=pe_aqw.replace(t.pe_hA.pe_hb,function(str,tagName,rest,pe_hp){if(tagName.toLowerCase()=="\x69\x6d\x67"){var pe_hF=[];rest.replace(t.pe_hA.attr,function(match,name){name=name.toLowerCase();if(name!="\x73\x72\x63"){pe_hF.push(match);}else{if(values[i]){pe_hF.push('\x73\x72\x63\x3d\x22'+values[i]+'\x22');}}});i++;return "\x3c"+tagName+"\x20"+pe_hF.join("\x20")+(pe_hp?"\x2f\x3e":"\x3e");}else{return str;}});pe_wW(pe_aqw);}).catch(function(values){pe_wW(pe_aqw);});},pe_ayj:function(pe_wW,t){function toDataURL(url,callback){try{var xhr=new XMLHttpRequest();xhr.onload=function(){var pe_pZ=new FileReader();pe_pZ.onloadend=function(){callback(pe_pZ.result);};pe_pZ.readAsDataURL(xhr.response);};xhr.onerror=function(){callback("\x66\x61\x69\x6c");};if(url){xhr.open('\x47\x45\x54',url);xhr.responseType='\x62\x6c\x6f\x62';xhr.send();}else{callback(null);}}catch(e){callback("\x66\x61\x69\x6c");}};var pe_LS=[];var imgs=t.getDocument().getElementsByTagName("\x69\x6d\x67");var pe_XC=[];for(var i=0;imgs.length>i;i++){if(imgs[i].getAttribute("\x64\x61\x74\x61\x2d\x75\x70\x6c\x6f\x61\x64\x2d\x74\x61\x72\x67\x65\x74")){pe_XC.push(imgs[i]);var pe_lX=new Promise(function(resolve,reject){toDataURL(imgs[i].src,function(pe_bfb){resolve(pe_bfb);});});pe_LS.push(pe_lX);}}Promise.all(pe_LS).then(function(values){var pe_XS=false;for(var i=0;pe_XC.length>i;i++){if(values[i]){if(values[i]=="\x66\x61\x69\x6c"){pe_XC[i].style.width=pe_XC[i].offsetWidth+"\x70\x78";pe_XC[i].style.height=pe_XC[i].offsetHeight+"\x70\x78";pe_XC[i].src=t.baseURL+t.config.ImagePath+"\x4e\x6f\x5f\x49\x6d\x61\x67\x65\x2e\x67\x69\x66";pe_XS=true;}else{pe_XC[i].src=values[i];}}}if(pe_XS){alert(NamoSELang.pe_ahI);}pe_wW(true);}).catch(function(values){pe_wW(false);});}};
var pe_bEl={pe_cgJ:function(pe_wt,t){function toDataURL(url,callback){var xhr=new XMLHttpRequest();xhr.onload=function(){var pe_qv=new FileReader();pe_qv.onloadend=function(){callback(pe_qv.result);};pe_qv.readAsDataURL(xhr.response);};xhr.onerror=function(){callback(url);};if(url){xhr.open('\x47\x45\x54',url);xhr.responseType='\x62\x6c\x6f\x62';xhr.send();}else{callback(null);}};var pe_Ls=[];var imgs=t.getDocument().getElementsByTagName("\x69\x6d\x67");for(var i=0;imgs.length>i;i++){var pe_mI=new Promise(function(resolve,reject){toDataURL(imgs[i].src,function(pe_aUa){resolve(pe_aUa);});});pe_Ls.push(pe_mI);}var pe_arg=t.GetValue("\x77\x6f\x72\x64");Promise.all(pe_Ls).then(function(values){var i=0;pe_arg=pe_arg.replace(t.pe_hG.pe_hc,function(str,tagName,rest,pe_gd){if(tagName.toLowerCase()=="\x69\x6d\x67"){var pe_jy=[];rest.replace(t.pe_hG.attr,function(match,name){name=name.toLowerCase();if(name!="\x73\x72\x63"){pe_jy.push(match);}else{if(values[i]){pe_jy.push('\x73\x72\x63\x3d\x22'+values[i]+'\x22');}}});i++;return "\x3c"+tagName+"\x20"+pe_jy.join("\x20")+(pe_gd?"\x2f\x3e":"\x3e");}else{return str;}});pe_wt(pe_arg);}).catch(function(values){pe_wt(pe_arg);});},pe_axH:function(pe_wt,t){function toDataURL(url,callback){try{var xhr=new XMLHttpRequest();xhr.onload=function(){var pe_qv=new FileReader();pe_qv.onloadend=function(){callback(pe_qv.result);};pe_qv.readAsDataURL(xhr.response);};xhr.onerror=function(){callback("\x66\x61\x69\x6c");};if(url){xhr.open('\x47\x45\x54',url);xhr.responseType='\x62\x6c\x6f\x62';xhr.send();}else{callback(null);}}catch(e){callback("\x66\x61\x69\x6c");}};var pe_Ls=[];var imgs=t.getDocument().getElementsByTagName("\x69\x6d\x67");var pe_aaA=[];for(var i=0;imgs.length>i;i++){if(imgs[i].getAttribute("\x64\x61\x74\x61\x2d\x75\x70\x6c\x6f\x61\x64\x2d\x74\x61\x72\x67\x65\x74")){pe_aaA.push(imgs[i]);var pe_mI=new Promise(function(resolve,reject){toDataURL(imgs[i].src,function(pe_aUa){resolve(pe_aUa);});});pe_Ls.push(pe_mI);}}Promise.all(pe_Ls).then(function(values){var pe_acv=false;for(var i=0;pe_aaA.length>i;i++){if(values[i]){if(values[i]=="\x66\x61\x69\x6c"){pe_aaA[i].style.width=pe_aaA[i].offsetWidth+"\x70\x78";pe_aaA[i].style.height=pe_aaA[i].offsetHeight+"\x70\x78";pe_aaA[i].src=t.baseURL+t.config.ImagePath+"\x4e\x6f\x5f\x49\x6d\x61\x67\x65\x2e\x67\x69\x66";pe_acv=true;}else{pe_aaA[i].src=values[i];}}}if(pe_acv){alert(NamoSELang.pe_aie);}pe_wt(true);}).catch(function(values){pe_wt(false);});}};

View File

@ -1 +1 @@
var editorInformationEXT={pe_biB:"\ud574\uc591\uacbd\ucc30\uccad\x7c\x49\x6e\x74\x72\x61\x6e\x65\x74\x7c\x39\x35\x30\x34\x2d\x30\x30\x31\x31\x2d\x32\x32\x30\x31\x39\x39\x7c\x43\x44\x48\x4d\x54",pe_bsm:"\x54\x58\x68\x46\x4e\x45\x78\x71\x53\x56\x52\x50\x55\x7a\x52\x55\x57\x56\x64\x55\x62\x7a\x49\x7a\x54\x6a\x42\x4d\x5a\x55\x56\x35\x54\x6e\x68\x42\x64\x55\x31\x61\x63\x6c\x59\x79\x59\x54\x6c\x71\x54\x6e\x6b\x30\x64\x30\x78\x71\x51\x58\x56\x4e\x63\x6a\x30\x39",pe_TA:"\x54\x57\x70\x42\x4e\x30\x31\x6d\x4d\x46\x70\x50\x55\x7a\x42\x55\x54\x58\x49\x39\x50\x51\x3b",pe_caT:"\x56\x6c\x42\x4a\x54\x6a\x54\x46\x56\x51\x4f\x56\x42\x49\x52\x6b\x74\x53\x42\x4f\x4e\x6a\x52\x44",pe_apq:"\x54\x57\x70\x42\x65\x55\x31\x6e\x56\x45\x31\x61\x52\x57\x70\x46\x64\x30\x31\x71\x4d\x30\x31\x34\x62\x54\x30\x3a",pe_Kg:"\x4d\x6c\x55\x34\x59\x6a\x6c\x7a\x62\x54\x30\x3a"}
var editorInformationEXT={pe_bbe:"\ud574\uc591\uacbd\ucc30\uccad\x7c\x49\x6e\x74\x72\x61\x6e\x65\x74\x7c\x39\x35\x30\x34\x2d\x30\x30\x31\x31\x2d\x32\x32\x30\x32\x32\x35\x7c\x43\x44\x48\x4d\x54\x7c\x54\x57\x70\x42\x4e\x30\x31\x6d\x4d\x46\x70\x50\x55\x7a\x42\x55\x54\x58\x49\x39\x50\x51\x3b",pe_biS:"\x54\x58\x68\x42\x64\x55\x31\x34\x5a\x7a\x4e\x4d\x61\x6d\x30\x30\x54\x47\x70\x79\x4d\x30\x78\x6c\x52\x58\x64\x4e\x61\x6b\x55\x33\x54\x47\x70\x46\x4d\x55\x31\x44\x4e\x46\x70\x4f\x51\x31\x52\x57\x4d\x6d\x4a\x4f\x61\x45\x78\x71\x52\x54\x52\x4f\x65\x54\x51\x78\x54\x30\x4d\x30\x4d\x45\x39\x44\x64\x31\x52\x4e\x65\x47\x64\x31\x4d\x6d\x46\x6f\x55\x44\x67\x7a\x63\x6c\x5a\x4e\x65\x45\x6b\x7a\x54\x47\x70\x42\x64\x55\x31\x44\x4e\x46\x51\x3a",pe_Qr:"\x54\x57\x70\x42\x4e\x30\x31\x6d\x4d\x46\x70\x50\x55\x7a\x42\x55\x54\x58\x49\x39\x50\x51\x3b",pe_caW:"\x52\x6c\x5a\x46\x4e\x45\x57\x45\x39\x45\x57\x6b\x59\x30\x52\x6b\x70\x44\x70\x58\x4e\x6b\x4e\x5a",pe_alX:"\x54\x57\x70\x42\x65\x55\x31\x6e\x56\x45\x35\x71\x63\x6d\x70\x46\x65\x55\x31\x6c\x4d\x45\x31\x71\x61\x7a\x30\x3a",pe_Lq:"\x4d\x6c\x55\x34\x59\x6a\x6c\x7a\x62\x54\x30\x3a"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
function photoEditorUpload(){getFlashObject("\x49\x6d\x61\x67\x65\x45\x64\x69\x74\x6f\x72").upload();};function photoEditorCancel(){getFlashObject("\x49\x6d\x61\x67\x65\x45\x64\x69\x74\x6f\x72").close();};var pe_aVN=true;function photoEditorImageUploadCompleteHandler(result,pe_bFw,pe_bIq,pe_buQ,response){pe_aVN=false;eval("\x76\x61\x72\x20\x70\x65\x5f\x65\x4e\x20\x3d\x20"+response);var pe_bGu="\x63\x6c\x6f\x73\x65";if(pe_buQ>1&&pe_bFw+pe_bIq!=pe_buQ)pe_bGu="\x63\x6f\x6e\x74\x69\x6e\x75\x65";opener.setInsertImageFile(pe_eN.result,pe_eN.addmsg,pe_bGu);pe_aVN=true;};function photoEditorSlideshowUploadCompleteHandler(result,response,flashVars){if(result=="\x73\x75\x63\x63\x65\x73\x73"){var addmsg={};addmsg.imageURL=opener.editorBaseURL+opener.NamoSE.pe_eJ.pe_cdH;addmsg.imageTitle="\x73\x6c\x69\x64\x65\x73\x68\x6f\x77";addmsg.imageKind="\x70\x68\x6f\x74\x6f\x45\x64\x69\x74\x6f\x72\x53\x6c\x69\x64\x65\x73\x68\x6f\x77";addmsg.imageWidth="\x38\x30\x30";addmsg.imageHeight="\x36\x30\x30";addmsg.imageOrgPath="";addmsg.flashVars=(typeof flashVars=="\x73\x74\x72\x69\x6e\x67")?flashVars:"";addmsg.editorFrame=opener.pe_buz;opener.setInsertImageFile(result,addmsg);}else{eval("\x76\x61\x72\x20\x70\x65\x5f\x65\x4e\x20\x3d\x20"+response);opener.setInsertImageFile(pe_eN.result,pe_eN.addmsg);}return;};var pe_btt;function closePhotoEditor(){var pe_bMV=function(){if(pe_aVN)window.close();};var pe_bMC=function(){window.clearInterval(pe_btt);window.close();};window.setTimeout(pe_bMC,1000);pe_btt=window.setInterval(pe_bMV,50);};function getFlashObject(pe_bmW){if(navigator.appName.indexOf("\x4d\x69\x63\x72\x6f\x73\x6f\x66\x74")!= -1&&parseInt(navigator.userAgent.toLowerCase().match(/msie (\d+)/)[1],10)<9){return window[pe_bmW];}else{return document[pe_bmW];}}
function photoEditorUpload(){getFlashObject("\x49\x6d\x61\x67\x65\x45\x64\x69\x74\x6f\x72").upload();};function photoEditorCancel(){getFlashObject("\x49\x6d\x61\x67\x65\x45\x64\x69\x74\x6f\x72").close();};var pe_aSu=true;function photoEditorImageUploadCompleteHandler(result,pe_cbb,pe_cbo,pe_bsm,response){pe_aSu=false;eval("\x76\x61\x72\x20\x70\x65\x5f\x66\x6e\x20\x3d\x20"+response);var pe_bGl="\x63\x6c\x6f\x73\x65";if(pe_bsm>1&&pe_cbb+pe_cbo!=pe_bsm)pe_bGl="\x63\x6f\x6e\x74\x69\x6e\x75\x65";opener.setInsertImageFile(pe_fn.result,pe_fn.addmsg,pe_bGl);pe_aSu=true;};function photoEditorSlideshowUploadCompleteHandler(result,response,flashVars){if(result=="\x73\x75\x63\x63\x65\x73\x73"){var addmsg={};addmsg.imageURL=opener.editorBaseURL+opener.NamoSE.pe_fL.pe_caX;addmsg.imageTitle="\x73\x6c\x69\x64\x65\x73\x68\x6f\x77";addmsg.imageKind="\x70\x68\x6f\x74\x6f\x45\x64\x69\x74\x6f\x72\x53\x6c\x69\x64\x65\x73\x68\x6f\x77";addmsg.imageWidth="\x38\x30\x30";addmsg.imageHeight="\x36\x30\x30";addmsg.imageOrgPath="";addmsg.flashVars=(typeof flashVars=="\x73\x74\x72\x69\x6e\x67")?flashVars:"";addmsg.editorFrame=opener.pe_blc;opener.setInsertImageFile(result,addmsg);}else{eval("\x76\x61\x72\x20\x70\x65\x5f\x66\x6e\x20\x3d\x20"+response);opener.setInsertImageFile(pe_fn.result,pe_fn.addmsg);}return;};var pe_bzt;function closePhotoEditor(){var pe_cef=function(){if(pe_aSu)window.close();};var pe_cdt=function(){window.clearInterval(pe_bzt);window.close();};window.setTimeout(pe_cdt,1000);pe_bzt=window.setInterval(pe_cef,50);};function getFlashObject(pe_brL){if(navigator.appName.indexOf("\x4d\x69\x63\x72\x6f\x73\x6f\x66\x74")!= -1&&parseInt(navigator.userAgent.toLowerCase().match(/msie (\d+)/)[1],10)<9){return window[pe_brL];}else{return document[pe_brL];}}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
<table class="pe_eX">
<table class="pe_ei">
<tr>
<td style="height:20px;">&nbsp;</td>
</tr>

View File

@ -1,4 +1,4 @@
<table id="pe_bjk" width="100%" height="43" background="../images/table_navi_bg.gif" border="0" cellspacing="0" cellpadding="0">
<table id="pe_bgC" width="100%" height="43" background="../images/table_navi_bg.gif" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center">
@ -7,14 +7,14 @@
<td width="200" align="left"><img src="../images/title_bi_en.gif" border="0" /></td>
<td width="470" align="center">
<div align="center" style="width:470px;">
<ul class="pe_BF">
<li><span><a id="pe_OE" href="javascript:;">&nbsp;</a></span></li>
<li class="pe_Is"><span><a id="pe_Sm" href="javascript:;">&nbsp;</a></span></li>
<li><span><a id="pe_WR" href="javascript:;">&nbsp;</a></span></li>
<ul class="pe_Cb">
<li><span><a id="pe_Ml" href="javascript:;">&nbsp;</a></span></li>
<li class="pe_Ja"><span><a id="pe_VD" href="javascript:;">&nbsp;</a></span></li>
<li><span><a id="pe_UQ" href="javascript:;">&nbsp;</a></span></li>
</ul>
</div>
</td>
<td width="150" align="right"><a id="pe_bUM" href="http://www.namoeditor.co.kr/" target="_blank" style="display:none;"><img src="../images/title_ci.gif" border="0" /></a></td>
<td width="150" align="right"><a id="pe_cdJ" href="http://www.namoeditor.co.kr/" target="_blank" style="display:none;"><img src="../images/title_ci.gif" border="0" /></a></td>
</tr>
</table>
@ -28,8 +28,8 @@
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="400" align="left" style="padding:0 0 0 10px"><span id="pe_ajc"></span> </td>
<td width="400" align="right" style="padding:0 10px 0 0"><a id="pe_aPG" href="javascript:;" style="font-weight:bold; display:none;">&nbsp;</a>&nbsp;&nbsp;&nbsp;&nbsp;<a id="pe_aJp" href="javascript:;" style="font-weight:bold;">&nbsp;</a></td>
<td width="400" align="left" style="padding:0 0 0 10px"><span id="pe_aja"></span> </td>
<td width="400" align="right" style="padding:0 10px 0 0"><a id="pe_aNz" href="javascript:;" style="font-weight:bold; display:none;">&nbsp;</a>&nbsp;&nbsp;&nbsp;&nbsp;<a id="pe_aRA" href="javascript:;" style="font-weight:bold;">&nbsp;</a></td>
</tr>
</table>

View File

@ -7,26 +7,26 @@
<script type="text/javascript" src="../lib/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
var ce$ = namo$.noConflict(true);
function addEvent(elm, pe_nD, fn) {
function addEvent(elm, pe_pt, fn) {
if (elm.addEventListener) {
elm.addEventListener(pe_nD, fn, false);
elm.addEventListener(pe_pt, fn, false);
} else if (elm.attachEvent) {
elm.attachEvent('on' + pe_nD, fn);
elm.attachEvent('on' + pe_pt, fn);
} else {
elm['on' + pe_nD] = fn;
elm['on' + pe_pt] = fn;
}
}
function pe_aG(){
var pe_aKY = document.getElementById("pe_aKY");
addEvent(pe_aKY, 'keydown', function(e){
function pe_aH(){
var pe_aGW = document.getElementById("pe_aGW");
addEvent(pe_aGW, 'keydown', function(e){
if(e.keyCode == "13"){
login.pe_bdO.click();
login.pe_aUD.click();
}
});
var pe_bYw = document.getElementById("pe_bfv");
addEvent(pe_bYw, 'click', function(e){
login.pe_bdO.click();
var pe_bYs = document.getElementById("pe_aSE");
addEvent(pe_bYs, 'click', function(e){
login.pe_aUD.click();
});
}
@ -37,7 +37,7 @@
<script type="text/javascript" src="./manager.js"></script>
</head>
<body style="background-color:#eeeff0" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="pe_aG()">
<body style="background-color:#eeeff0" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="pe_aH()">
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td background="images/intro_bg.gif">
@ -51,38 +51,38 @@
</tr>
<tr>
<td height="180" background="images/login_bg.jpg">
<table class="pe_eX">
<table class="pe_ei">
<tr>
<td id="pe_bWi">&nbsp;</td>
<td id="pe_bYq">&nbsp;</td>
<td style="text-align:center">
<table id="pe_aKY">
<table id="pe_aGW">
<tr>
<td class="pe_bxO" >&nbsp;&nbsp;&nbsp;<span id="pe_Up" style="font-weight: bold;"></span></td>
<td class="pe_bxC" ><input type="text" class="pe_bxH" name="m_id2" id="m_id2" /></td>
<td class="pe_byD" >&nbsp;&nbsp;&nbsp;<span id="pe_Ra" style="font-weight: bold;"></span></td>
<td class="pe_bAa" ><input type="text" class="pe_bxr" name="m_id2" id="m_id2" /></td>
<td></td>
</tr>
<tr>
<td class="pe_bYo" colspan="3"></td>
<td class="pe_bZd" colspan="3"></td>
<tr>
<tr>
<td class="pe_bxO">&nbsp;&nbsp;&nbsp;<span id="pe_FJ" style="font-weight: bold;"></span></td>
<td class="pe_bxC"><input type="password" class="pe_bxH" name="pe_bzY" id="pe_bzY" autocomplete="off"/></td>
<td class="pe_byD">&nbsp;&nbsp;&nbsp;<span id="pe_Hs" style="font-weight: bold;"></span></td>
<td class="pe_bAa"><input type="password" class="pe_bxr" name="pe_bEU" id="pe_bEU" autocomplete="off"/></td>
<td>
<ul>
<li class="pe_ld">
<input type="submit" id="pe_bfv" value="" class="pe_ln pe_iz" style="width:66px; height:26px;"/>
<li class="pe_kO">
<input type="submit" id="pe_aSE" value="" class="pe_jP pe_iy" style="width:66px; height:26px;"/>
</li>
</ul>
</td>
</tr>
<tr>
<td></td>
<td class="pe_kS">
<td class="pe_jX">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td><input type="checkbox" id="pe_aNf" name="pe_aNf" /></td>
<td><span id="pe_bMz"></span></td>
<td><input type="checkbox" id="pe_aQO" name="pe_aQO" /></td>
<td><span id="pe_bRD"></span></td>
</tr>
</table>
</td>
@ -91,22 +91,22 @@
</table>
</td>
<td id="pe_bVp">&nbsp;</td>
<td id="pe_bXX">&nbsp;</td>
</tr>
</table>
<form method="post" id="login" name="login" action="" onsubmit="return pe_dl(this);" style='display:inline'>
<form method="post" id="login" name="login" action="" onsubmit="return pe_cE(this);" style='display:inline'>
<input type="hidden" name="m_id" id="m_id" value="" />
<input type="hidden" name="passwd" id="passwd" />
<input type="hidden" name="webPageKind" id="webPageKind" value="" />
<input type="hidden" name="pe_beS" id="pe_beS" />
<input type="hidden" name="pe_bfK" id="pe_bfK" />
<input type="submit" id="pe_bdO" name="pe_bdO" value="" class="pe_ln pe_iz" style="width:0px; height:0px; display:none;"/>
<input type="hidden" name="pe_bav" id="pe_bav" />
<input type="hidden" name="pe_aVw" id="pe_aVw" />
<input type="submit" id="pe_aUD" name="pe_aUD" value="" class="pe_jP pe_iy" style="width:0px; height:0px; display:none;"/>
</form>
</td>
</tr>
<tr>
<td height="106" style="position: relative;"><img src="images/login_bottom.jpg" border="0"><div style="position: absolute; top: 80px; left:132px; width:375px; background-color: #eeeff0;">Copyright (c) 2009-<span id="pe_cdF"></span> JIRANSOFT Co., Ltd. All rights reserved.</div></td>
<td height="106" style="position: relative;"><img src="images/login_bottom.jpg" border="0"><div style="position: absolute; top: 80px; left:132px; width:375px; background-color: #eeeff0;">Copyright (c) 2009-<span id="pe_bIk"></span> JIRANSOFT Co., Ltd. All rights reserved.</div></td>
</tr>
</table>
@ -114,49 +114,49 @@
</tr>
</table>
<div id="pe_aUk">
<div id="pe_aZS">
<table border="0" style="width:610px;">
<tr style="height:40px;">
<td style="width:10px"><img src="images/popup_top_left.gif" /></td>
<td id="pe_bTr"><span id="pe_UB" style="color:#FFFFFF"></span></td>
<td id="pe_bVF"><span id="pe_Wt" style="color:#FFFFFF"></span></td>
<td style="width:10px"><img src="images/popup_top_right.gif" /></td>
</tr>
<tr>
<td id="pe_bTS"></td>
<td id="pe_bTU">
<td id="pe_bTA"></td>
<td id="pe_bTS">
<table class="pe_bSG">
<table class="pe_bSQ">
<tr>
<td style="padding:10px;">
<b><span id="pe_Xm"></span></b>
&nbsp;&nbsp;&nbsp;<input type="text" class="pe_bCw" name="contextPath" id="contextPath" /><br />
<span id="pe_Ww" class="pe_bzi"></span>
<b><span id="pe_TY"></span></b>
&nbsp;&nbsp;&nbsp;<input type="text" class="pe_bzf" name="contextPath" id="contextPath" /><br />
<span id="pe_SA" class="pe_bzJ"></span>
</td>
</tr>
<tr>
<td class="pe_bBi"></td>
<td class="pe_bzo"></td>
</tr>
<tr style="height:">
<td style="padding:10px;">
<b><span id="pe_UX"></span></b>
&nbsp;&nbsp;&nbsp;<input type="text" class="pe_bCw" name="pe_bwH" id="pe_bwH" /><br />
<span id="pe_VY" class="pe_bzi"></span>
<b><span id="pe_Vj"></span></b>
&nbsp;&nbsp;&nbsp;<input type="text" class="pe_bzf" name="pe_boU" id="pe_boU" /><br />
<span id="pe_VO" class="pe_bzJ"></span>
</td>
</tr>
<tr>
<td class="pe_bBi"></td>
<td class="pe_bzo"></td>
</tr>
</table>
</td>
<td id="pe_bSZ"></td>
<td id="pe_bVu"></td>
</tr>
<tr style="height:50px">
<td style="width:10px"><img src="images/popup_bot_left.gif" /></td>
<td id="pe_bTa">
<td id="pe_bUa">
<ul style="margin:0 auto; width:80px;">
<li class="pe_ld">
<input type="submit" id="pe_bAE" value="" class="pe_ln pe_iz" style="width:66px; height:26px;" />
<li class="pe_kO">
<input type="submit" id="pe_boG" value="" class="pe_jP pe_iy" style="width:66px; height:26px;" />
</li>
</ul>
</td>
@ -168,11 +168,11 @@
<div id="bgDiv"></div>
<script type="text/javascript" language="javascript">
pe_cY();
pe_cM();
var pe_VU = new Date();
var year = pe_VU.getFullYear();
document.getElementById("pe_cdF").innerHTML = year;
var pe_SK = new Date();
var year = pe_SK.getFullYear();
document.getElementById("pe_bIk").innerHTML = year;
</script>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,90 @@
<%@page contentType="text/html;charset=utf-8" %>
<%@include file = "./include/session_check.jsp"%>
<%@include file="manager_util.jsp"%>
<%
String encrypt = encrypt("SHA-256", detectXSSEx(request.getParameter("passwd")));
String fileName = " (manageInfo.jsp)";
String result_sc = "";
String fileRealFolder = "";
String ContextPath = request.getContextPath();
String urlPath = rootFolderPath(request.getRequestURI());
ServletContext context = getServletConfig().getServletContext();
fileRealFolder = context.getRealPath(urlPath);
//2013.08.26 [2.0.5.23] mwhong tomcat8.0 에서 getRealPath가 null을 리턴하여 수정
if(fileRealFolder == null && urlPath != null && ContextPath != null){
fileRealFolder = context.getRealPath(urlPath.substring(ContextPath.length()));
}
if (ContextPath != null && !ContextPath.equals("") && !ContextPath.equals("/")){
File tempFileRealDIR = new File(fileRealFolder);
if(!tempFileRealDIR.exists()){
if (urlPath != null && urlPath.indexOf(ContextPath) != -1){
String rename_image_temp = urlPath.substring(ContextPath.length());
fileRealFolder = context.getRealPath(rename_image_temp);
}
}
}
if (fileRealFolder.lastIndexOf(File.separator) != fileRealFolder.length() - 1){
fileRealFolder = fileRealFolder + File.separator;
}
String manageInfoStr = manageInFo_text(fileRealFolder);
String u_pass = manageInfoStr.substring(manageInfoStr.indexOf(";"));
u_pass = u_pass.substring(u_pass.indexOf("\"") + 1, u_pass.lastIndexOf("\""));
encrypt = encrypt.toLowerCase();
u_pass = u_pass.toLowerCase();
String login_id = encrypt("SHA-256", detectXSSEx(request.getParameter("u_id")));
String enc_id = encrypt("SHA-256", detectXSSEx("admin"));
if(encrypt.equals(u_pass) && login_id.equals(enc_id))
{
//encrypt = encrypt("SHA1", request.getParameter("newPasswd").replaceAll(" ",""));
encrypt = encrypt("SHA-256", detectXSSEx(request.getParameter("newPasswd")));
encrypt = encrypt.toLowerCase();
String filenames = fileRealFolder + "manageInfo.jsp";
String xmlText = "<%\n";
xmlText += " String u_id =\"" + enc_id + "\";\n";
xmlText += " String u_pass =\"" + encrypt + "\";\n";
xmlText += "%" + ">";
boolean check = xmlCreate(xmlText,filenames);
if(check)
{
session.invalidate();
result_sc = "<script>alert(NamoSELang.pe_EH);window.document.location.href='../index.html';</script>";
}
else
{
result_sc = "<script>alert(NamoSELang.pe_wx+'" + fileName + "');history.back();</script> ";
}
}
else{
result_sc = "<script>alert(NamoSELang.pe_Db);location.href='account_setting.jsp';</script>";
}
%>
<html>
<head>
<script type="text/javascript" src="../../lib/jquery-1.7.2.min.js"> </script>
<script type="text/javascript">var ce$=namo$.noConflict(true); </script>
<script type="text/javascript" src="../manage_common.js"> </script>
<script type="text/javascript" src="../../js/namo_cengine.js"> </script>
</head>
<body>
<%
out.println(result_sc);
%>
</body>
</html>

View File

@ -0,0 +1,117 @@
<%@page contentType="text/html;charset=utf-8" %>
<%@include file = "./include/session_check.jsp"%>
<%@include file = "manager_util.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Namo CrossEditor : Admin</title>
<script type="text/javascript">var pe_Cq="pe_UQ"; </script>
<script type="text/javascript" src="../../lib/jquery-1.7.2.min.js"> </script>
<script type="text/javascript">var ce$=namo$.noConflict(true); </script>
<script type="text/javascript" src="../manage_common.js"> </script>
<script type="text/javascript" language="javascript" src="../../js/namo_cengine.js"> </script>
<script type="text/javascript" language="javascript" src="../manager.js"> </script>
<link href="../css/common.css" rel="stylesheet" type="text/css">
</head>
<body>
<%@include file = "../include/top.html"%>
<div id="pe_aJG" class="pe_jM">
<table class="pe_Ax">
<tr>
<td class="pe_jM">
<table id="Info">
<tr>
<td style="padding:0 0 0 10px;height:30px;text-align:left">
<font style="font-size:14pt;color:#3e77c1;font-weight:bold;text-decoration:none;"><span id="pe_Hd"></span></font></td>
<td id="InfoText"><span id="pe_Cz"></span></td>
</tr>
<tr>
<td colspan="2"><img id="pe_Mc" src="../images/title_line.jpg" alt="" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="pe_jM">
<form method="post" id="pe_bjx" action="account_proc.jsp" onsubmit="return pe_bp(this);">
<table class="pe_sg" >
<tr>
<td>
<table class="pe_ei">
<tr><td class="pe_iT" colspan="3"></td></tr>
</table>
<table class="pe_ei" >
<tr>
<td class="pe_fk">&nbsp;&nbsp;&nbsp;&nbsp;<b><span id="pe_Hs"></span></b></td>
<td class="pe_em"></td>
<td class="pe_eq">
<input type="hidden" name="u_id" id="u_id" value="<%=detectXSSEx(session.getAttribute("memId").toString())%>" autocomplete="off"/>
<input type="password" name="passwd" id="passwd" value="" class="pe_sm" autocomplete="off"/>
</td>
</tr>
<tr>
<td class="pe_fi" colspan="3"></td>
</tr>
<tr>
<td class="pe_fk">&nbsp;&nbsp;&nbsp;&nbsp;<b><span id="pe_NB"></span></b></td>
<td class="pe_em"></td>
<td class="pe_eq">
<input type="password" name="newPasswd" id="newPasswd" value="" class="pe_sm" autocomplete="off"/>
</td>
</tr>
<tr>
<td class="pe_fi" colspan="3"></td>
</tr>
<tr>
<td class="pe_fk">&nbsp;&nbsp;&nbsp;&nbsp;<b><span id="pe_Mj"></span></b></td>
<td class="pe_em"></td>
<td class="pe_eq">
<input type="password" name="newPasswdCheck" id="newPasswdCheck" value="" class="pe_sm" autocomplete="off"/>
</td>
</tr>
</table>
<table class="pe_ei">
<tr><td class="pe_iT" colspan="3"></td></tr>
</table>
</td>
</tr>
<tr id="pe_abM">
<td id="pe_abs">
<ul style="margin:0 auto;width:170px;">
<li class="pe_kO">
<input type="submit" id="pe_XV" value="" class="pe_jP pe_iy" style="width:66px;height:26px;" />
</li>
<li class="pe_kO"><input type="button" id="pe_Gq" value="" class="pe_jP pe_iy" style="width:66px;height:26px;"></li>
</ul>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</div>
<%@include file = "../include/bottom.html"%>
</body>
<script>var webPageKind='<%=detectXSSEx(session.getAttribute("webPageKind").toString())%>';topInit();pe_aJ(); </script>
</html>

View File

@ -0,0 +1,24 @@
<%
if(session.getAttribute("memId") == null){response.sendRedirect("../index.html");return;}
if(request.getHeader("referer") == null){response.sendRedirect("../index.html");return;}
if(request.getHeader("referer").length() > 0){
String referer = request.getHeader("referer");
String requestURL = request.getRequestURL().toString();
referer = referer.replaceAll("http://","");
referer = referer.replaceAll("https://","");
referer = referer.substring(0, referer.indexOf("/"));
requestURL = requestURL.replaceAll("http://","");
requestURL = requestURL.replaceAll("https://","");
requestURL = requestURL.substring(0, requestURL.indexOf("/"));
//System.out.println("new referer: " + referer);
//System.out.println("new requestURL: " + requestURL);
if(!referer.equalsIgnoreCase(requestURL)){
response.sendRedirect("../index.html");
return;
}
}
%>

View File

@ -0,0 +1,112 @@
<%@page contentType="text/html;charset=utf-8" %>
<%@include file="manager_util.jsp"%>
<%
/*
String id = detectXSSEx(request.getParameter("m_id"));
String passwd = detectXSSEx(encrypt("SHA-256", request.getParameter("passwd")));
*/
sun.misc.BASE64Decoder decoder = new sun.misc.BASE64Decoder();
byte[] b1 = decoder.decodeBuffer(detectXSSEx(request.getParameter("passwd")));
String pwval = new String(b1);
byte[] b2 = decoder.decodeBuffer(detectXSSEx(request.getParameter("m_id")));
String idval = new String(b2);
String id = encrypt("SHA-256", idval);
String passwd = encrypt("SHA-256", pwval);
String webPageKind = detectXSSEx(request.getParameter("webPageKind"));
String result_sc = "";
String fileRealFolder = "";
String ContextPath = request.getContextPath();
String urlPath = rootFolderPath(request.getRequestURI());
ServletContext context = getServletConfig().getServletContext();
fileRealFolder = context.getRealPath(urlPath);
//2013.08.26 [2.0.5.23] mwhong tomcat8.0 에서 getRealPath가 null을 리턴하여 수정
if(fileRealFolder == null && urlPath != null && ContextPath != null){
fileRealFolder = context.getRealPath(urlPath.substring(ContextPath.length()));
}
if (ContextPath != null && !ContextPath.equalsIgnoreCase("") && !ContextPath.equalsIgnoreCase("/")){
File tempFileRealDIR = new File(fileRealFolder);
if(!tempFileRealDIR.exists()){
if (urlPath != null && urlPath.indexOf(ContextPath) != -1){
String rename_image_temp = urlPath.substring(ContextPath.length());
fileRealFolder = context.getRealPath(rename_image_temp);
}
}
}
if (fileRealFolder != null && fileRealFolder.lastIndexOf(File.separator) != fileRealFolder.length() - 1){
fileRealFolder = fileRealFolder + File.separator;
}
String manageInfoStr = manageInFo_text(fileRealFolder);
String u_id = "";
String u_pass = null;
String sep = ";";
String sep_sub = "=";
String manageArr[] = manageInfoStr.split(sep);
for (int i = 0; i < manageArr.length; i++)
{
if(manageArr[i].indexOf("u_id") != -1){
if (manageArr[i].indexOf("\"") != -1){
u_id = manageArr[i].substring(manageArr[i].indexOf("u_id"), manageArr[i].lastIndexOf("\""));
String[] uIDArr = u_id.split(sep_sub);
if (!uIDArr[1].equalsIgnoreCase("")){
u_id = uIDArr[1];
if (u_id.indexOf("\"") != -1) u_id = u_id.substring(u_id.indexOf("\"") + 1);
u_id = u_id.trim();
}
}
}
else if(manageArr[i].indexOf("u_pass") != -1){
if (manageArr[i].indexOf("\"") != -1){
u_pass = manageArr[i].substring(manageArr[i].indexOf("u_pass"), manageArr[i].lastIndexOf("\""));
String[] uIDArr = u_pass.split("=");
if (!uIDArr[1].equalsIgnoreCase("")){
u_pass = uIDArr[1];
if (u_pass.indexOf("\"") != -1) u_pass = u_pass.substring(u_pass.indexOf("\"") + 1);
u_pass = u_pass.trim();
}
}
}
}
if(id.equalsIgnoreCase(u_id) || id.equalsIgnoreCase(encrypt("SHA-256", u_id))){
passwd = passwd.toLowerCase();
if(passwd.equalsIgnoreCase(u_pass)){
session.setAttribute("memId",idval);
session.setAttribute("webPageKind",webPageKind);
result_sc = "<script>window.document.location.href='update_check.jsp';</script>";
}
else{
result_sc = "<script>alert(NamoSELang.pe_Db);history.back();</script>";
}
}
else{
result_sc = "<script>alert(NamoSELang.pe_Rz);history.back();</script>";
}
%>
<html>
<head>
<script type="text/javascript" src="../../lib/jquery-1.7.2.min.js"> </script>
<script type="text/javascript">var ce$=namo$.noConflict(true); </script>
<script type="text/javascript" src="../manage_common.js"> </script>
<script type="text/javascript" language="javascript" src="../../js/namo_cengine.js"> </script>
</head>
<body>
<%= result_sc%>
</body>
</html>

View File

@ -0,0 +1,6 @@
<%@page contentType="text/html;charset=utf-8" %>
<%@include file = "./include/session_check.jsp"%>
<%
session.invalidate();
response.sendRedirect("../index.html");
%>

View File

@ -0,0 +1,4 @@
<%
String u_id="admin";
String u_pass="3ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4";
%>

View File

@ -0,0 +1,62 @@
<%@page contentType="text/html;charset=utf-8" %>
<%@include file = "./include/session_check.jsp"%>
<%@include file = "manager_util.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Namo CrossEditor : Admin</title>
<script type="text/javascript">var pe_ass="True";var pe_Cq="pe_Ml"; </script>
<script type="text/javascript" src="../manage_common.js"> </script>
<script type="text/javascript" src="../../js/namo_scripteditor.js"> </script>
<script type="text/javascript" src="../manager.js"> </script>
<link href="../css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<%@include file = "../include/top.html"%>
<div id="preview" class="pe_jM">
<table class="pe_Ax">
<tr>
<td class="pe_jM">
<table id="Info">
<tr>
<td style="padding:0 0 0 10px;height:30px;text-align:left">
<font style="font-size:14pt;color:#3e77c1;font-weight:bold;text-decoration:none;"><span id="pe_azz">&nbsp;</span></font></td>
<td id="InfoText">&nbsp;</td>
</tr>
<tr>
<td colspan="2"><img id="pe_Mc" src="../images/title_line.jpg" alt="" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="pe_jM">
<table class="pe_sg">
<tr>
<td class="pe_jX">
<script>var CrossEditor=new NamoSE('namoeditor1');CrossEditor.params.ManageMode=true;CrossEditor.params.UserLang="auto";CrossEditor.params.Width="100%";if(pe_rY!="")CrossEditor.params.UserDomain=pe_rY;CrossEditor.editorStart(); </script>
</td>
</tr>
<tr>
<td id="pe_agL" style="height:20px"></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<%@include file = "../include/bottom.html"%>
<script>var webPageKind='<%= detectXSSEx(session.getAttribute("webPageKind").toString()) %>';topInit(); </script>
</body>
</html>

View File

@ -0,0 +1,101 @@
<%@page contentType="text/html;charset=utf-8" %>
<%@include file = "./include/session_check.jsp"%>
<%@include file="manager_util.jsp"%>
<%
request.setCharacterEncoding("utf-8");
String fileRealFolder = "";
String ContextPath = request.getContextPath();
String urlPath = rootFolderPath(request.getRequestURI());
urlPath = urlPath.substring(0, urlPath.indexOf("manage/jsp"));
ServletContext context = getServletConfig().getServletContext();
fileRealFolder = context.getRealPath(urlPath);
//2013.08.26 [2.0.5.23] mwhong tomcat8.0 에서 getRealPath가 null을 리턴하여 수정
if(/*fileRealFolder == null &&*/ urlPath != null && ContextPath != null){
fileRealFolder = context.getRealPath(urlPath.substring(ContextPath.length()));
}
if (!ContextPath.equals("") && !ContextPath.equals("/")){
File tempFileRealDIR = new File(fileRealFolder);
if(!tempFileRealDIR.exists()){
if (urlPath.indexOf(ContextPath) != -1){
String rename_image_temp = urlPath.substring(ContextPath.length());
fileRealFolder = context.getRealPath(rename_image_temp);
}
}
}
if (fileRealFolder.lastIndexOf(File.separator) != fileRealFolder.length() - 1){
fileRealFolder = fileRealFolder + File.separator;
}
String filenames = xmlUrl(fileRealFolder);
int count = 0;
Element root = configXMlLoad(filenames);
String xmlText = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
String StartTag = root.getNodeName();
String userAddMenu = detectXSSEx(request.getParameter("UserAddMenu"));
userAddMenu = userAddMenu.trim();
List parent = childrenList(root);
xmlText += "<" + StartTag + ">\n";
for(int i=0;i<parent.size();i++){
xmlText += " <" + parent.get(i) + ">\n";
NodeList child = root.getElementsByTagName((String)parent.get(i));
Node node = child.item(0);
List children = childrenList(node);
for(int j=0;j<children.size();j++){
if(children.get(j).equals("AddMenu")){
if (userAddMenu.length() <= 0) {
xmlText += " <" + children.get(j) + "></" + children.get(j) + ">\n";
} else {
xmlText += " <" + children.get(j) + ">" + userAddMenu + "</" + children.get(j) + ">\n";
}
}
else if(detectXSSEx(request.getParameter((String)children.get(j))) == null){
xmlText += " <" + children.get(j) + "></" + children.get(j) + ">\n";
}
else{
xmlText += " <" + children.get(j) + ">" + detectXSSEx(request.getParameter((String)children.get(j))) + "</" + children.get(j) + ">\n";
}
}
xmlText += " </" + parent.get(i) + ">\n";
}
xmlText += "</" + StartTag + ">\n";
String result_sc = "";
String fileName = " (config/xmls/Config.xml)";
boolean check = xmlCreate(xmlText,filenames);
if(check){
result_sc = "<script type='text/javascript' language='javascript'>alert(NamoSELang.pe_EH);window.document.location.href='manager_setting.jsp?Tab=" + detectXSSEx(request.getParameter("Tab")) + "';</script>";
}
else{
result_sc = "<script>alert(NamoSELang.pe_wx+'" + fileName + "');history.back();</script> ";
}
%>
<html>
<head>
<script type="text/javascript" src="../../lib/jquery-1.7.2.min.js"> </script>
<script type="text/javascript">var ce$=namo$.noConflict(true); </script>
<script type="text/javascript" src="../manage_common.js"> </script>
<script type="text/javascript" src="../../js/namo_cengine.js"> </script>
</head>
<body>
<%
out.println(result_sc);
%>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,459 @@
<%@page import="java.util.*"%>
<%@page import="java.util.regex.PatternSyntaxException"%>
<%@page import="java.io.*"%>
<%@page import ="javax.xml.parsers.*"%>
<%@page import ="javax.xml.parsers.DocumentBuilder"%>
<%@page import ="javax.xml.parsers.DocumentBuilderFactory"%>
<%@page import ="org.w3c.dom.Document"%>
<%@page import ="org.w3c.dom.Element"%>
<%@page import ="org.w3c.dom.Node"%>
<%@page import ="org.w3c.dom.NodeList"%>
<%@page import ="org.xml.sax.SAXException"%>
<%@page import ="org.xml.sax.SAXParseException"%>
<%@page import ="org.xml.sax.SAXException"%>
<%@page import ="java.security.*"%>
<%@include file="../../websource/jsp/Util.jsp"%>
<%@include file="../../websource/jsp/SecurityTool.jsp"%>
<%!
public String rootFolderPath(String urlPath)
{
String fileRealFolder = "";
fileRealFolder = urlPath.substring(0, urlPath.lastIndexOf("/") + 1);
return fileRealFolder;
}
public String xmlUrl(String urlPPath)
{
return urlPPath + "config" + File.separator + "xmls" + File.separator + "Config.xml";
}
public static Element configXMlLoad(String configValue)
{
File severXml = new File(configValue);
Document doc = null;
try{
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
/*
dbf.setValidating(true);
dbf.setFeature("http://javax.xml.XMLConstants/feature/secure-processing",true);
dbf.setFeature("http://xml.org/sax/features/external-general-entities",false);
dbf.setFeature("http://xml.org/sax/features/external-parameter-entities",false);
dbf.setFeature("http://xml.org/sax/features/validation", true);
*/
DocumentBuilder db = dbf.newDocumentBuilder();
doc = db.parse(severXml);
Element root = doc.getDocumentElement();
root.normalize();
return root;
}catch (SAXParseException err) {
//System.out.println("System Error 1");
} catch (SAXException e) {
//System.out.println("System Error 2");
} catch (java.net.MalformedURLException mfx) {
//System.out.println("System Error 3");
} catch (java.io.IOException e) {
//System.out.println("System Error 4");
} catch (javax.xml.parsers.ParserConfigurationException e) {
//System.out.println("System Error 5");
}
return null;
}
public Hashtable childValueList(Element root)
{
Hashtable settingValue = new Hashtable();
List addMenuList = new ArrayList();
NodeList nodeList = root.getChildNodes();
Node node;
Node cNode;
NodeList childNodes;
settingValue.put("AddMenuCheck", "false");
try{
for(int i=0; i<nodeList.getLength(); i++){
node = nodeList.item(i);
if(node.getNodeType() == Node.ELEMENT_NODE){
childNodes = node.getChildNodes();
for(int j=0; j<childNodes.getLength();j++){
cNode = childNodes.item(j);
if(cNode.getNodeType() == Node.ELEMENT_NODE){
if(cNode.getNodeName().equalsIgnoreCase("AddMenu")) settingValue.put("AddMenuCheck", "true");
if(cNode.getFirstChild() != null){
if(cNode.getNodeName().equalsIgnoreCase("AddMenu")){
addMenuList.add(cNode.getFirstChild().getNodeValue());
settingValue.put(cNode.getNodeName(),addMenuList);
}
else {
settingValue.put(cNode.getNodeName(),cNode.getFirstChild().getNodeValue());
}
}
else{
if(cNode.getNodeName().equalsIgnoreCase("AddMenu")){
addMenuList.add("");
settingValue.put(cNode.getNodeName(),addMenuList);
}else{
settingValue.put(cNode.getNodeName(),"");
}
}
}
}
}
}
return settingValue;
}
catch (RuntimeException e) {
//System.out.println("System Error 6");
return settingValue;
}
}
public List childrenList(Node root)
{
NodeList nodeList = root.getChildNodes();
List childrenList = new ArrayList();
Node node;
for(int i=0; i<nodeList.getLength(); i++){
node = nodeList.item(i);
if(node.getNodeType() == Node.ELEMENT_NODE){
childrenList.add(node.getNodeName());
}
}
return childrenList;
}
public String skinDirectory(String urlPPath,String xmlInfo)
{
urlPPath = detectXSSEx(urlPPath);
xmlInfo = detectXSSEx(xmlInfo);
String skinValue = "";
String skinDirUrl = urlPPath + "template";
File skinDir = new File(skinDirUrl);
String contents[] = skinDir.list();
if(contents != null){
for(int i=0;i<contents.length;i++){
File dirCheck = new File(skinDirUrl+File.separator+contents[i]);
try{
if(dirCheck.isDirectory()){
if(skinValue.equalsIgnoreCase("")) skinValue = contents[i];
else skinValue = skinValue + "," + contents[i];
}
}
catch(NumberFormatException e){
continue;
}
}
}
String skinValues[] = skinValue.split(",");
String optionTag = "<select name='Skin' id='Skin' class='inputSelectStyle'>";
String selectCheck = "";
for(int i=0; i<skinValues.length; i++){
if(skinValues[i] != null && skinValues[i].equalsIgnoreCase("webtree")){
continue;
}
if(xmlInfo.equalsIgnoreCase(skinValues[i])){
selectCheck = "selected=\"selected\"";
optionTag = optionTag + "<option value='"+skinValues[i]+"' "+selectCheck+" >"+skinValues[i]+"</option>";
}
else{
optionTag = optionTag + ("<option value='"+skinValues[i]+"'>"+skinValues[i]+"</option>");
}
selectCheck = "";
}
optionTag = optionTag + "</select>";
return optionTag ;
}
public String iconColorSelect(String xmlInfo)
{
xmlInfo = detectXSSEx(xmlInfo);
String iconValues[] = {"default", "black", "blue", "bluegreen"};
String optionTag = "<select name='IconColor' id='IconColor' class='inputSelectStyle'>";
String selectCheck = "";
for(int i=0; i<iconValues.length; i++){
if(iconValues[i] != null && iconValues[i].equalsIgnoreCase("webtree")){
continue;
}
if(xmlInfo.equalsIgnoreCase(iconValues[i])){
selectCheck = "selected=\"selected\"";
optionTag = optionTag + "<option value='"+iconValues[i]+"' "+selectCheck+" >"+iconValues[i]+"</option>";
}
else{
optionTag = optionTag + ("<option value='"+iconValues[i]+"'>"+iconValues[i]+"</option>");
}
selectCheck = "";
}
optionTag = optionTag + "</select>";
return optionTag ;
}
public boolean xmlCreate(String xmlText, String filenames)
{
boolean check = true;
Writer fout = null;
OutputStream fos = null;
try{
File f = new File(filenames);
if(f.canWrite()){
fos = new FileOutputStream(f);
fout = new OutputStreamWriter(fos, "UTF-8");
fout.write(detectXSSEx2(xmlText));
}
else{
check = false;
}
}
catch (java.io.IOException e) {
//System.out.println("System Error 8");
}
finally{
try{
if( fout != null){
fout.close();
fout = null;
}
if( fos != null){
fos.close();
fos = null;
}
}catch(java.io.IOException err1){
//System.out.println("An internal exception occured!!");
}catch(Exception err){
//System.out.println("An internal exception occured!!");
}
}
return check;
}
public String encrypt(String EncMthd,String strData)
{
MessageDigest md;
String strENCData = "";
try{
md = MessageDigest.getInstance(EncMthd);
byte[] byBytes = strData.getBytes();
md.update(byBytes);
byte[] digest = md.digest();
for(int i=0; i<digest.length; i++){
strENCData = strENCData + Integer.toHexString(digest[i] & 0xFF).toUpperCase();
}
return strENCData;
}
catch(NoSuchAlgorithmException e){
//System.out.println("System Error 9");
return strENCData = "";
}
}
public String manageInFo_text(String urlPPath)
{
String manageInfoPath = urlPPath + "manageInfo.jsp";
String manageInfoStr = "";
BufferedReader manageInfoText = null;
FileReader fr = null;
try{
fr = new FileReader(manageInfoPath);
manageInfoText = new BufferedReader(fr);
char[] buffer = new char[1024];
manageInfoText.read(buffer,0,1024);
for (int i=0; buffer.length>i; i++)
{
if(buffer[i] != (char)0)
{
manageInfoStr += buffer[i];
}
}
manageInfoText.close();
fr.close();
}catch(java.io.FileNotFoundException e1){
//System.out.println("System Error 10");
}catch(java.io.IOException e2){
//System.out.println("System Error 11");
}finally{
try{
if( manageInfoText != null){
manageInfoText.close();
manageInfoText = null;
}
if( fr != null){
fr.close();
fr = null;
}
}catch(java.io.IOException err1){
//System.out.println("An internal exception occured!!!");
}catch(Exception err){
//System.out.println("An internal exception occured!!!");
}
}
return manageInfoStr;
}
public List xmlField_list(Element root){
List parent = childrenList(root);
List children;
List xmlField_list = new ArrayList();
for (int i=0; i<parent.size(); i++){
NodeList child = root.getElementsByTagName((String)parent.get(i));
Node node = child.item(0);
children = childrenList(node);
for (int j=0; j<children.size(); j++){
xmlField_list.add(children.get(j));
}
}
return xmlField_list;
}
public boolean update_check(String update_xml_url,String before_xml_url){
boolean update_check = false;
Element update_xml_root = configXMlLoad(update_xml_url);
List update_xml = xmlField_list(update_xml_root);
Element before_xml_root = configXMlLoad(before_xml_url);
List before_xml= xmlField_list(before_xml_root);
Hashtable update_xml_settingValue = childValueList(update_xml_root);
Hashtable before_xml_settingValue = childValueList(before_xml_root);
String getValue1 = "";
String getValue2 = "";
boolean check = false;
for (int i=0; i<update_xml.size(); i++){
check = false;
for (int j=0; j<before_xml.size(); j++){
if(update_xml.get(i).toString().equalsIgnoreCase(before_xml.get(j).toString())){
if(update_xml.get(i).toString() == "Version" || update_xml.get(i).toString() == "Version_daemon" || update_xml.get(i).toString() == "Version_com") {
getValue1 = update_xml_settingValue.get(update_xml.get(i)).toString();
getValue2 = before_xml_settingValue.get(before_xml.get(j)).toString();
if(getValue1.equals(getValue2)) {
check = true;
break;
}
} else {
check = true;
break;
}
}
}
if(check == false)
{
update_check = true;
break;
}
}
return update_check;
}
public String update_xml(String update_xml_url,String before_xml_url){
Element update_xml_root = configXMlLoad(update_xml_url);
Element before_xml_root = configXMlLoad(before_xml_url);
Hashtable update_xml_settingValue = childValueList(update_xml_root);
Hashtable before_xml_settingValue = childValueList(before_xml_root);
String StartTag = update_xml_root.getNodeName();
String xml_Text = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
xml_Text += "<" + StartTag + ">\n";
List parent = childrenList(update_xml_root);
boolean chkForce = false;
for(int i=0;i<parent.size();i++){
xml_Text +=" <" + parent.get(i) + ">\n";
NodeList child = update_xml_root.getElementsByTagName((String)parent.get(i));
Node node = child.item(0);
List children = childrenList(node);
for(int j=0;j<children.size();j++){
// node 이름이 Version, Version_daemon, Version_com 이면 강제 업데이트
String getNode_Name = children.get(j).toString();
if( getNode_Name.equals("Version") || getNode_Name.equals("Version_daemon") || getNode_Name.equals("Version_com") ) {
chkForce = true;
}
if(chkForce) {
String getNode_Value = " " + update_xml_settingValue.get(children.get(j)) + " ";
getNode_Value = getNode_Value.trim();
if(getNode_Value.equalsIgnoreCase("[]")) getNode_Value = "";
xml_Text += " <" + children.get(j) + ">" + getNode_Value + "</" + children.get(j) + ">\n";
// 강제 수정 후 조건 false
chkForce = false;
} else {
if(children.get(j).toString().equalsIgnoreCase("AddMenu") && before_xml_settingValue.get("AddMenuCheck").toString().equalsIgnoreCase("true")) {
List addMenuListValue = (List)before_xml_settingValue.get("AddMenu");
for(int k=0; k<addMenuListValue.size(); k++){
xml_Text += " <" + children.get(j) + ">" + addMenuListValue.get(k) + "</" + children.get(j) + ">\n";
}
}
else if(before_xml_settingValue.get(children.get(j)) != null){
xml_Text += " <" + children.get(j) + ">" + before_xml_settingValue.get(children.get(j)) + "</" + children.get(j) + ">\n";
}
else{
String getXmlSettingValue = " " + update_xml_settingValue.get(children.get(j)) + " ";
getXmlSettingValue = getXmlSettingValue.trim();
if(getXmlSettingValue.equalsIgnoreCase("[]")) getXmlSettingValue = "";
xml_Text += " <" + children.get(j) + ">" + getXmlSettingValue + "</" + children.get(j) + ">\n";
}
}
}
xml_Text +=" </" + parent.get(i) + ">\n";
}
xml_Text += "</" + StartTag + ">\n";
boolean check_save = xmlCreate(xml_Text,before_xml_url);
if(check_save)return "sucess";
else return "fail";
}
%>

View File

@ -0,0 +1,73 @@
<%@page contentType="text/html;charset=utf-8" %>
<%@include file = "manager_util.jsp"%>
<%@include file = "./include/session_check.jsp"%>
<%
String result_sc = "";
String result_pop = "";
String fileRealFolder = "";
String ContextPath = request.getContextPath();
String urlPath = rootFolderPath(request.getRequestURI());
urlPath = urlPath.substring(0, urlPath.indexOf("manage/jsp"));
ServletContext context = getServletConfig().getServletContext();
fileRealFolder = context.getRealPath(urlPath);
//2013.08.26 [2.0.5.23] mwhong tomcat8.0 에서 getRealPath가 null을 리턴하여 수정
if(fileRealFolder == null && urlPath != null && ContextPath != null){
fileRealFolder = context.getRealPath(urlPath.substring(ContextPath.length()));
}
if (ContextPath != null && !ContextPath.equals("") && !ContextPath.equals("/")){
File tempFileRealDIR = new File(fileRealFolder);
if(!tempFileRealDIR.exists()){
if (urlPath != null && urlPath.indexOf(ContextPath) != -1){
String rename_image_temp = urlPath.substring(ContextPath.length());
fileRealFolder = context.getRealPath(rename_image_temp);
}
}
}
if (fileRealFolder.lastIndexOf(File.separator) != fileRealFolder.length() - 1){
fileRealFolder = fileRealFolder + File.separator;
}
String update_xml_url = fileRealFolder + "update/config/config.xml";
String before_xml_url = fileRealFolder + "config/xmls/config.xml";
String resultStrSc = "<script language=\"javascript\">window.document.location.href='manager_setting.jsp';</script>";
File update_xml = new File(update_xml_url);
if(update_xml.exists()){
boolean update_check_value = update_check(update_xml_url,before_xml_url);
if(update_check_value){
result_pop = "<script language=\"javascript\">alert(NamoSELang.pe_TC)</script>";
String saveCheck = update_xml(update_xml_url,before_xml_url);
if(saveCheck.equals("sucess")){
result_sc = resultStrSc;
}
else{
result_sc = "<script language=\"javascript\">alert(NamoSELang.pe_Kc+NamoSELang.pe_wx);window.document.location.href='manager_setting.jsp';</script>";
}
}
else{
result_sc = resultStrSc;
}
}
else{
result_sc = resultStrSc;
}
%>
<html>
<head>
<script type="text/javascript" src="../../lib/jquery-1.7.2.min.js"> </script>
<script type="text/javascript">var ce$=namo$.noConflict(true); </script>
<script type="text/javascript" src="../manage_common.js"> </script>
<script type="text/javascript" language="javascript" src="../../js/namo_cengine.js"> </script>
</head>
<body>
<%= result_pop%>
<%= result_sc%>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@
<General>
<WebServerOS>LINUX</WebServerOS>
<WebServerInfo>Tomcat</WebServerInfo>
<WebLanguage>ETC</WebLanguage>
<WebLanguage>JSP</WebLanguage>
<ImageSavePath></ImageSavePath>
<Width>300</Width>
<Height>350</Height>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -20,15 +20,15 @@
<input type="text" class="form-control" id="name" name="name" placeholder="Name">
</div>
<div class="col-xs-6">
<input type="text" class="form-control" id="pe_zM" name="pe_zM" placeholder="Email">
<input type="text" class="form-control" id="pe_zC" name="pe_zC" placeholder="Email">
</div>
</div>
<div class="form-group" id="pe_aOx">
<div class="form-group" id="pe_aPm">
<div class="col-xs-12">
<textarea id="pe_bgh" name="pe_bgh" alt="initText" title="initText" Style="width:730px; height:450px; font-size:10pt"><p>Welcome to <span style="font-weight: bold;">CrossEditor 4.0</span> sample page</p></textarea>
<textarea id="pe_bgZ" name="pe_bgZ" alt="initText" title="initText" Style="width:730px; height:450px; font-size:10pt"><p>Welcome to <span style="font-weight: bold;">CrossEditor 4.0</span> sample page</p></textarea>
<script type="text/javascript" language="javascript">
var CrossEditor = new NamoSE('pe_bgh');
var CrossEditor = new NamoSE('pe_bgZ');
CrossEditor.params.Width = "100%";
CrossEditor.params.ConfigXmlURL = "mobile/config/Config_mobile.xml";
CrossEditor.params.CreateTab = "9|9|9";
@ -41,18 +41,18 @@
CrossEditor.EditorStart();
function OnInitCompleted(e){
e.editorTarget.SetBodyValue(document.getElementById("pe_bgh").value);
e.editorTarget.SetBodyValue(document.getElementById("pe_bgZ").value);
var pe_aOx = document.getElementById("pe_aOx");
pe_aOx.style.marginBottom = "0px";
var pe_caH = window.innerHeight - pe_aOx.offsetTop - 60;
CrossEditor.SetUISize("100%", pe_caH);
var pe_aPm = document.getElementById("pe_aPm");
pe_aPm.style.marginBottom = "0px";
var pe_chj = window.innerHeight - pe_aPm.offsetTop - 60;
CrossEditor.SetUISize("100%", pe_chj);
}
</script>
</div>
</div>
<div class="text-center">
<button class="btn btn-info" id="pe_cie" onclick="alert('[내용]\n' + CrossEditor.GetBodyValue('XHTML'));">등록하기</button>
<button class="btn btn-info" id="pe_ckS" onclick="alert('[내용]\n' + CrossEditor.GetBodyValue('XHTML'));">등록하기</button>
</div>
</div>
</body>

View File

@ -1 +1 @@
.dialog-responsive-custom-resolution-config{width:450px;}.dialog-responsive-custom-resolution-config button.ce-dialog-btn{border:1px solid #aaa;background-color:#ccc;text-align:center;padding:3px 5px;cursor:pointer;}.dialog-responsive-custom-resolution-config .custom-resolution-list{width:200px;height:160px;margin:10px 0 0 10px;float:left;position:relative;box-sizing:border-box;}.dialog-responsive-custom-resolution-config .custom-resolution-list>button.ce-dialog-btn{width:200px;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.device-resolution-items{border:1px solid #ccc;height:120px;overflow-y:scroll;margin:10px 0 0 0;padding:0;position:relative;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.device-resolution-items li.device-resolution-item{margin:0;padding:0 8px;height:30px;line-height:30px;position:relative;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.device-resolution-items li.device-resolution-item.empty-item{display:none;color:#ccc;font-size:11px;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.device-resolution-items.empty li.device-resolution-item.empty-item{display:block;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.device-resolution-items li.device-resolution-item.empty-item:hover{background-color:inherit;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.device-resolution-items li.device-resolution-item:hover{background-color:#ccc;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.device-resolution-items li.device-resolution-item span.device-name{font-size:12px;color:#888;margin-left:15px;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.device-resolution-items li.device-resolution-item span.pe_ko{position:absolute;top:0px;right:0px;width:180px;height:30px;display:none;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.device-resolution-items li.device-resolution-item:hover span.pe_ko{display:block;width:180px;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.device-resolution-items li.device-resolution-item span.pe_ko button.tool{display:block;cursor:pointer;border:0;float:left;width:20px;height:30px;margin:0;padding:0;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.device-resolution-items li.device-resolution-item span.pe_ko button.tool[data-action=edit-item]{background:url('plugins/responsive-ui/images/icon-btn-edit.png') 3px 50% no-repeat;width:155px;height:30px;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.device-resolution-items li.device-resolution-item span.pe_ko button.tool[data-action=remove-item]{background:url('plugins/responsive-ui/images/icon-btn-delete.png') 50% 50% no-repeat;}.dialog-responsive-custom-resolution-config .form-custom-resolution{position:relative;width:220px;float:right;clear:right;margin-right:5px;margin-top:50px;}.dialog-responsive-custom-resolution-config .form-custom-resolution fieldset{width:220px;}.dialog-responsive-custom-resolution-config .form-custom-resolution fieldset label{width:220px;display:block;margin:0px 0 5px;}.dialog-responsive-custom-resolution-config .form-custom-resolution fieldset label>span{display:inline-block;width:85px;}.dialog-responsive-custom-resolution-config .form-custom-resolution fieldset label>input{width:120px;height:20px;padding:1px;border:1px solid #ccc;}.dialog-responsive-custom-resolution-config .form-custom-resolution fieldset .pe_ko{width:220px;text-align:center;margin-top:8px;position:relative;top:0px;}.dialog-responsive-custom-resolution-config .form-custom-resolution fieldset .pe_ko .ce-dialog-btn{width:100px;display:inline-block;}.dialog-responsive-custom-resolution-config .custom-resolution-list.disabled{opacity:0.5;}.dialog-responsive-custom-resolution-config .custom-resolution-list.disabled:before{content:' ';position:absolute;left:0;top:0;width:100%;height:100%;background-color:rgba(0,0,0,0);z-index:1;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.disabled{opacity:0.5;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.disabled:before{content:' ';position:absolute;left:0;top:0;width:100%;height:100%;background-color:rgba(0,0,0,0);z-index:1;}.dialog-responsive-custom-resolution-config .form-custom-resolution.disabled{opacity:0.5;}.dialog-responsive-custom-resolution-config .form-custom-resolution.disabled:before{content:' ';position:absolute;left:0;top:0;width:100%;height:100%;background-color:rgba(0,0,0,0);z-index:1;}
.dialog-responsive-custom-resolution-config{width:450px;}.dialog-responsive-custom-resolution-config button.ce-dialog-btn{border:1px solid #aaa;background-color:#ccc;text-align:center;padding:3px 5px;cursor:pointer;}.dialog-responsive-custom-resolution-config .custom-resolution-list{width:200px;height:160px;margin:10px 0 0 10px;float:left;position:relative;box-sizing:border-box;}.dialog-responsive-custom-resolution-config .custom-resolution-list>button.ce-dialog-btn{width:200px;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.device-resolution-items{border:1px solid #ccc;height:120px;overflow-y:scroll;margin:10px 0 0 0;padding:0;position:relative;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.device-resolution-items li.device-resolution-item{margin:0;padding:0 8px;height:30px;line-height:30px;position:relative;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.device-resolution-items li.device-resolution-item.empty-item{display:none;color:#ccc;font-size:11px;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.device-resolution-items.empty li.device-resolution-item.empty-item{display:block;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.device-resolution-items li.device-resolution-item.empty-item:hover{background-color:inherit;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.device-resolution-items li.device-resolution-item:hover{background-color:#ccc;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.device-resolution-items li.device-resolution-item span.device-name{font-size:12px;color:#888;margin-left:15px;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.device-resolution-items li.device-resolution-item span.pe_lp{position:absolute;top:0px;right:0px;width:180px;height:30px;display:none;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.device-resolution-items li.device-resolution-item:hover span.pe_lp{display:block;width:180px;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.device-resolution-items li.device-resolution-item span.pe_lp button.tool{display:block;cursor:pointer;border:0;float:left;width:20px;height:30px;margin:0;padding:0;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.device-resolution-items li.device-resolution-item span.pe_lp button.tool[data-action=edit-item]{background:url('plugins/responsive-ui/images/icon-btn-edit.png') 3px 50% no-repeat;width:155px;height:30px;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.device-resolution-items li.device-resolution-item span.pe_lp button.tool[data-action=remove-item]{background:url('plugins/responsive-ui/images/icon-btn-delete.png') 50% 50% no-repeat;}.dialog-responsive-custom-resolution-config .form-custom-resolution{position:relative;width:220px;float:right;clear:right;margin-right:5px;margin-top:50px;}.dialog-responsive-custom-resolution-config .form-custom-resolution fieldset{width:220px;}.dialog-responsive-custom-resolution-config .form-custom-resolution fieldset label{width:220px;display:block;margin:0px 0 5px;}.dialog-responsive-custom-resolution-config .form-custom-resolution fieldset label>span{display:inline-block;width:85px;}.dialog-responsive-custom-resolution-config .form-custom-resolution fieldset label>input{width:120px;height:20px;padding:1px;border:1px solid #ccc;}.dialog-responsive-custom-resolution-config .form-custom-resolution fieldset .pe_lp{width:220px;text-align:center;margin-top:8px;position:relative;top:0px;}.dialog-responsive-custom-resolution-config .form-custom-resolution fieldset .pe_lp .ce-dialog-btn{width:100px;display:inline-block;}.dialog-responsive-custom-resolution-config .custom-resolution-list.disabled{opacity:0.5;}.dialog-responsive-custom-resolution-config .custom-resolution-list.disabled:before{content:' ';position:absolute;left:0;top:0;width:100%;height:100%;background-color:rgba(0,0,0,0);z-index:1;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.disabled{opacity:0.5;}.dialog-responsive-custom-resolution-config .custom-resolution-list ul.disabled:before{content:' ';position:absolute;left:0;top:0;width:100%;height:100%;background-color:rgba(0,0,0,0);z-index:1;}.dialog-responsive-custom-resolution-config .form-custom-resolution.disabled{opacity:0.5;}.dialog-responsive-custom-resolution-config .form-custom-resolution.disabled:before{content:' ';position:absolute;left:0;top:0;width:100%;height:100%;background-color:rgba(0,0,0,0);z-index:1;}

View File

@ -1 +1 @@
table.responsive-bar-visible{background-color:#fff;box-shadow:0 30px 20px 10px rgba(0,0,0,0.2);}.responsive-pe_ko-pe_ft{display:none;}.responsive-bar-visible .responsive-pe_ko-pe_ft{display:table-row!important;height:31px;}.responsive-pe_ko{position:relative;height:30px;border-bottom:1px solid #b6b6b6;position:absolute;width:100%;left:0px;top:0px;background-color:#ccc;user-select:none;}.responsive-pe_ko[data-active-tool=basic] .responsive-tool-basic{display:block;}.responsive-pe_ko[data-active-tool=detail] .responsive-tool-detail{display:block;}.responsive-tool{height:30px;line-height:30px;display:none;}.responsive-tool.responsive-tool-common{display:block;position:absolute;top:0px;right:0px;margin-right:20px;user-select:none;}.responsive-tool.responsive-tool-common label{font-size:12px;line-height:30px;cursor:pointer;}.responsive-tool.responsive-tool-common input{margin:0px 3px;vertical-align:middle;}.responsive-tool.responsive-tool-basic .tabs{width:120px;margin:0px auto;text-align:center;}.responsive-tool.responsive-tool-basic .tabs .tab-item{width:40px;height:30px;float:left;text-indent:-100px;font-size:0px;overflow:hidden;cursor:pointer;opacity:0.5;}.responsive-tool.responsive-tool-basic .tabs .tab-item:hover{opacity:1;}.responsive-tool.responsive-tool-basic .tabs .tab-item[data-item-type]:before{content:' ';display:block;width:27px;height:28px;background-repeat:no-repeat;background-image:url('../../plugins/responsive-ui/images/icon-devices.png');margin:1px auto;}.responsive-tool.responsive-tool-basic .tabs .tab-item[data-item-type='tablet']:before{background-position:-54px 50%;}.responsive-tool.responsive-tool-basic .tabs .tab-item[data-item-type='mobile']:before{background-position:0px 50%;}.responsive-tool.responsive-tool-basic .tabs .tab-item[data-item-type='pc']:before{background-position:-27px 50%;}.responsive-tool.responsive-tool-basic .tabs .tab-item.active{background-color:#eee;opacity:1;}.responsive-tool.responsive-tool-detail .tool-detail-pe_ft{width:360px;min-width:360px;margin:0px auto;text-align:center;}.responsive-tool-detail{line-height:28px;}.responsive-tool-detail .tool-detail-pe_ft select{height:24px;vertical-align:middle;font-size:12px;}.responsive-tool-detail .tool-detail-pe_ft input{height:20px;vertical-align:middle;font-size:12px;padding:0px;}.responsive-tool-detail .tool-detail-pe_ft .panelselect_span{display:inline-block;position:relative;top:3px;text-align:left;}.responsive-tool-detail .tool-detail-pe_ft select#responsive-device-list{width:130px;}.responsive-tool-detail .tool-detail-pe_ft select#responsive-zoom-list{width:80px;}.responsive-tool-detail .tool-detail-pe_ft .responsive-resolution{display:inline-block;border:1px solid #ccc;background:#eee;height:22px;margin:0 5px;padding:0 5px 0 3px;vertical-align:middle;line-height:22px;}.responsive-tool-detail .tool-detail-pe_ft label{position:relative;display:inline-block;opacity:0.5;}.responsive-tool-detail .tool-detail-pe_ft label input{width:35px;text-align:center;padding-right:10px;border:0;background:transparent;}.responsive-tool-detail .tool-detail-pe_ft label span.unit-size{display:inline-block;position:absolute;width:12px;height:20px;top:0px;right:2px;}.responsive-tool-detail .tool-detail-pe_ft>button.rotate-device{width:24px;height:22px;margin:0 3px;border:0;outline:0;vertical-align:middle;background:url('../../plugins/responsive-ui/images/icon-btn-rotate.png') 50% 50% no-repeat;background-size:20px;opacity:0.7;cursor:pointer;transform:rotate(45deg);transition:transform 0.2s;}.ce-browser-ie11 .responsive-tool-detail .tool-detail-pe_ft>button.rotate-device{transition:none!important;}.responsive-tool-detail .tool-detail-pe_ft>button.rotate-device[data-state=vertical]{transform:rotate(45deg);}.responsive-tool-detail .tool-detail-pe_ft>button.rotate-device[data-state=horizontal]{transform:rotate(135deg);}.responsive-tool-detail .tool-detail-pe_ft>button.rotate-device:hover{opacity:1;}.responsive-tool-detail .tool-detail-pe_ft .sbOptions li a{height:15px;line-height:15px;font-size:12px;}.responsive-tool-detail .tool-detail-pe_ft .sbGroup{height:15px;opacity:0.5;font-size:11px;}#responsive-zoom-list+ .sbHolder ul{width:100px;}#responsive-device-list+ .sbHolder ul{max-height:230px!important;}#responsive-device-list+ .sbHolder ul li span.sbDisabled{cursor:pointer;color:#444;background:#ddd;border:1px solid #aaa;height:15px;line-height:15px;margin:5px;padding:5px;text-align:center;}#responsive-device-list+ .sbHolder ul li span.sbDisabled:hover{border:1px solid #444;}@media screen and (max-width:520px){ .responsive-tool-detail button.rotate-device{display:none;}}@media screen and (max-width:490px){ .responsive-tool-detail span.panelselect_span:nth-child(3){display:none;}}.responsive-bar-visible.pe_bCF .handle-margin-right{display:none;}
table.responsive-bar-visible{background-color:#fff;box-shadow:0 30px 20px 10px rgba(0,0,0,0.2);}.responsive-pe_lp-pe_ew{display:none;}.responsive-bar-visible .responsive-pe_lp-pe_ew{display:table-row!important;height:31px;}.responsive-pe_lp{position:relative;height:30px;border-bottom:1px solid #b6b6b6;position:absolute;width:100%;left:0px;top:0px;background-color:#ccc;user-select:none;}.responsive-pe_lp[data-active-tool=basic] .responsive-tool-basic{display:block;}.responsive-pe_lp[data-active-tool=detail] .responsive-tool-detail{display:block;}.responsive-tool{height:30px;line-height:30px;display:none;}.responsive-tool.responsive-tool-common{display:block;position:absolute;top:0px;right:0px;margin-right:20px;user-select:none;}.responsive-tool.responsive-tool-common label{font-size:12px;line-height:30px;cursor:pointer;}.responsive-tool.responsive-tool-common input{margin:0px 3px;vertical-align:middle;}.responsive-tool.responsive-tool-basic .tabs{width:120px;margin:0px auto;text-align:center;}.responsive-tool.responsive-tool-basic .tabs .tab-item{width:40px;height:30px;float:left;text-indent:-100px;font-size:0px;overflow:hidden;cursor:pointer;opacity:0.5;}.responsive-tool.responsive-tool-basic .tabs .tab-item:hover{opacity:1;}.responsive-tool.responsive-tool-basic .tabs .tab-item[data-item-type]:before{content:' ';display:block;width:27px;height:28px;background-repeat:no-repeat;background-image:url('../../plugins/responsive-ui/images/icon-devices.png');margin:1px auto;}.responsive-tool.responsive-tool-basic .tabs .tab-item[data-item-type='tablet']:before{background-position:-54px 50%;}.responsive-tool.responsive-tool-basic .tabs .tab-item[data-item-type='mobile']:before{background-position:0px 50%;}.responsive-tool.responsive-tool-basic .tabs .tab-item[data-item-type='pc']:before{background-position:-27px 50%;}.responsive-tool.responsive-tool-basic .tabs .tab-item.active{background-color:#eee;opacity:1;}.responsive-tool.responsive-tool-detail .tool-detail-pe_ew{width:360px;min-width:360px;margin:0px auto;text-align:center;}.responsive-tool-detail{line-height:28px;}.responsive-tool-detail .tool-detail-pe_ew select{height:24px;vertical-align:middle;font-size:12px;}.responsive-tool-detail .tool-detail-pe_ew input{height:20px;vertical-align:middle;font-size:12px;padding:0px;}.responsive-tool-detail .tool-detail-pe_ew .panelselect_span{display:inline-block;position:relative;top:3px;text-align:left;}.responsive-tool-detail .tool-detail-pe_ew select#responsive-device-list{width:130px;}.responsive-tool-detail .tool-detail-pe_ew select#responsive-zoom-list{width:80px;}.responsive-tool-detail .tool-detail-pe_ew .responsive-resolution{display:inline-block;border:1px solid #ccc;background:#eee;height:22px;margin:0 5px;padding:0 5px 0 3px;vertical-align:middle;line-height:22px;}.responsive-tool-detail .tool-detail-pe_ew label{position:relative;display:inline-block;opacity:0.5;}.responsive-tool-detail .tool-detail-pe_ew label input{width:35px;text-align:center;padding-right:10px;border:0;background:transparent;}.responsive-tool-detail .tool-detail-pe_ew label span.unit-size{display:inline-block;position:absolute;width:12px;height:20px;top:0px;right:2px;}.responsive-tool-detail .tool-detail-pe_ew>button.rotate-device{width:24px;height:22px;margin:0 3px;border:0;outline:0;vertical-align:middle;background:url('../../plugins/responsive-ui/images/icon-btn-rotate.png') 50% 50% no-repeat;background-size:20px;opacity:0.7;cursor:pointer;transform:rotate(45deg);transition:transform 0.2s;}.ce-browser-ie11 .responsive-tool-detail .tool-detail-pe_ew>button.rotate-device{transition:none!important;}.responsive-tool-detail .tool-detail-pe_ew>button.rotate-device[data-state=vertical]{transform:rotate(45deg);}.responsive-tool-detail .tool-detail-pe_ew>button.rotate-device[data-state=horizontal]{transform:rotate(135deg);}.responsive-tool-detail .tool-detail-pe_ew>button.rotate-device:hover{opacity:1;}.responsive-tool-detail .tool-detail-pe_ew .sbOptions li a{height:15px;line-height:15px;font-size:12px;}.responsive-tool-detail .tool-detail-pe_ew .sbGroup{height:15px;opacity:0.5;font-size:11px;}#responsive-zoom-list+ .sbHolder ul{width:100px;}#responsive-device-list+ .sbHolder ul{max-height:230px!important;}#responsive-device-list+ .sbHolder ul li span.sbDisabled{cursor:pointer;color:#444;background:#ddd;border:1px solid #aaa;height:15px;line-height:15px;margin:5px;padding:5px;text-align:center;}#responsive-device-list+ .sbHolder ul li span.sbDisabled:hover{border:1px solid #444;}@media screen and (max-width:520px){ .responsive-tool-detail button.rotate-device{display:none;}}@media screen and (max-width:490px){ .responsive-tool-detail span.panelselect_span:nth-child(3){display:none;}}.responsive-bar-visible.pe_bym .handle-margin-right{display:none;}

File diff suppressed because one or more lines are too long

View File

@ -23,7 +23,7 @@
<span class="field-label">${NamoSELang.responsive_device_config_height}(px):</span>
<input type="number" id="responsive-custom-resolution-height" />
</label>
<div class="pe_ko">
<div class="pe_lp">
<button class="ce-dialog-btn" data-action="save-custom-resolution">${NamoSELang.PluginBtnSave}</button>
<button class="ce-dialog-btn" data-action="reset-custom-resolution">${NamoSELang.PluginBtnCancel}</button>
</div>

View File

@ -1,4 +1,4 @@
<div class="responsive-pe_ko">
<div class="responsive-pe_lp">
<div class="responsive-tool responsive-tool-basic">
<div class="tabs">
<div class="tab-item" data-item-type="mobile" title="${NamoSELang.responsive_basic_mobile}">mobile</div>
@ -7,7 +7,7 @@
</div>
</div>
<div class="responsive-tool responsive-tool-detail">
<div class="tool-detail-pe_ft">
<div class="tool-detail-pe_ew">
<span>
<select id="responsive-device-list"></select>
</span>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,111 @@
<%@page contentType="text/html; charset=utf-8" %>
<%@page import="java.io.*"%>
<%@page import="java.net.*"%>
<%@page import="java.util.regex.PatternSyntaxException"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.security.MessageDigest"%>
<%@page import="java.security.NoSuchAlgorithmException"%>
<% String ce_domain = ""; String ce_exp = ""; String ce_pm_exp = ""; String ce_serial_encrypt = ""; String ce_pm_key = ""; %>
<%@include file="EditorInformation.jsp"%>
<%@include file="Util.jsp"%>
<%@include file="SecurityTool.jsp"%>
<%!
static public String getEncMD5(String str) {
String MD5 = "";
try{
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(str.getBytes());
byte byteData[] = md.digest();
StringBuffer sb = new StringBuffer();
for(int i = 0 ; i < byteData.length ; i++){
sb.append(Integer.toString((byteData[i]&0xff) + 0x100, 16).substring(1));
}
MD5 = sb.toString();
}catch(NoSuchAlgorithmException e){
//e.printStackTrace();
MD5 = null;
}
return MD5;
}
static public String getKey(String strExpire, String strSerial) {
return strExpire + "|" + strSerial;
}
%>
<%
String check_uri = "http://crosseditor.namoeditor.co.kr/application/CELicenseCheck.php";
String authHostInfo = "";
/*
String conkey = detectXSSEx(request.getParameter("connection"));
if(conkey != null && conkey.equalsIgnoreCase("ServerGr")){
authHostInfo = InetAddress.getLocalHost().getHostAddress();
}
else {
authHostInfo = request.getHeader("host");
}
*/
authHostInfo = request.getHeader("host");
check_uri += "?editordomain=" + authHostInfo;
check_uri += "&serial=" + ce_serial;
check_uri += "&editorkey=" + ce_editorkey;
String editorkey = request.getParameter("editorkey");
String conval = ce_domain + "|" + ce_use + "|" + ce_exp + "|" + authHostInfo;
String exp_check = "true";
if(ce_exp.length() > 0){
String exp_date = new String(getBase64Decode(ce_exp), "ISO-8859-1");
SimpleDateFormat simpleDate = new SimpleDateFormat("yyyy-MM-dd");
Date expDate = simpleDate.parse(exp_date);
Date currentTime = new Date();
String today = simpleDate.format(currentTime);
Date currentDate = simpleDate.parse(today);
if(currentDate.compareTo( expDate ) > 0) {
exp_check = "false";
}
}else{
exp_check = "false";
}
String strPluginModeKey = getEncMD5 (getKey (ce_pm_exp, ce_serial_encrypt));
String strReturnVal = "";
Date d1 = new Date();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
String formattedDate = df.format(d1);
if (strPluginModeKey != null && strPluginModeKey.equalsIgnoreCase(ce_pm_key)) {
String strPluginModeExpire = ce_pm_exp;
strReturnVal = "{\"pm_exp\":\"" + strPluginModeExpire + "\",\"cur_date\":\"" + formattedDate + "\"}";
}
if (!"".equals(editorkey) && editorkey != null){
if (editorkey.equalsIgnoreCase("ProductInfo")){
String returnParam = ce_company + "|";
returnParam += ce_use + "|";
returnParam += ce_serial + "|";
returnParam += ce_lkt;
if(!"".equalsIgnoreCase(strReturnVal)){
returnParam += "|" + strReturnVal;
}
out.println(detectXSSEx(returnParam));
}else{
if("false".equalsIgnoreCase(exp_check)){
out.println("EXPIRE");
}else if (createEncodeEditorKey(ce_editorkey).equalsIgnoreCase(editorkey)){
out.println("SUCCESS");
}else{
out.println("NULL");
}
}
}else{
conval = ce_domain + "|" + exp_check + "|" + authHostInfo + "|" + createEncodeEditorKey(ce_editorkey);
//conval = ce_domain + "|" + ce_exp + "|" + authHostInfo + "|" + createEncodeEditorKey(ce_editorkey);
out.println(detectXSSEx(conval));
}
%>

View File

@ -0,0 +1,12 @@
<%
String ce_editorkey="FVE4JW6CYXODZF4FJC";
String ce_company="%uD574%uC591%uACBD%uCC30%uCCAD";
String ce_use="Intranet";
String ce_serial="9504-0011-220225";
String ce_lkt="CDHMT";
ce_domain="TXhBdU14ZzNMam00TGpyM0xlRXdNakU3TGpFMU1DNFpOQ1RWMmJOaExqRTROeTQxT0M0ME9Dd1RNeGd1MmFoUDgzclZNeEkzTGpBdU1DNFQ:";
ce_exp="MjA5OS0xMi0zMQ==";
ce_pm_exp="TWpBN01mMFpPUzBUTXI9PQ;";
ce_serial_encrypt="T3htd05DTHhJeU1lMHdNZUVUSXlOcj09";
ce_pm_key="1a27dca7229fdd3c09ef8057125a561b";
%>

View File

@ -0,0 +1,589 @@
<%@page contentType="text/html;charset=utf-8" %>
<%@page import="java.io.*"%>
<%@page import="java.util.regex.PatternSyntaxException"%>
<%@page import="java.net.*"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Iterator"%>
<%@page import="org.apache.commons.fileupload.servlet.ServletFileUpload"%>
<%@page import="org.apache.commons.fileupload.disk.DiskFileItemFactory"%>
<%@page import="org.apache.commons.fileupload.FileItem"%>
<%@page import="org.apache.commons.fileupload.FileUploadBase"%>
<%@page import="org.apache.commons.codec.binary.Base64"%>
<%@include file="Util.jsp"%>
<%@include file="SecurityTool.jsp"%>
<%@page import="java.util.Calendar"%>
<%--@include file="Vaccine.jsp"--%>
<%
/*
if(detectXSSEx(request.getParameter("licenseCheck")) != null){
if(detectXSSEx(request.getParameter("licenseCheck")).toLowerCase().equalsIgnoreCase("true")){
out.println(InetAddress.getLocalHost().getHostAddress());
return;
}
}
*/
boolean isMultipart = ServletFileUpload.isMultipartContent(request);
DiskFileItemFactory factory = null;
ServletFileUpload upload = null;
List items = null;
//try {
if (isMultipart) {
factory = new DiskFileItemFactory();
factory.setSizeThreshold(2 * 1024 * 1024);
upload = new ServletFileUpload(factory);
upload.setSizeMax(-1);
upload.setHeaderEncoding("utf-8");
items = upload.parseRequest(request);
}else{
response.getWriter().println("not encoding type multipart/form-data");
}
//} catch (Exception e) {
// response.getWriter().println("not encoding type multipart/form-data");
// return;
//}
String messageText = "";
int maxSize = Integer.parseInt(detectXSSEx(request.getParameter("fileSizeLimit")));
String defaultUPath = detectXSSEx(request.getParameter("defaultUPath"));
String imageUPath = detectXSSEx(request.getParameter("fileUPath"));
String protocol = "http://";
//if(request.isSecure()){
// protocol = "https://";
//}
String requestUrl = request.getRequestURL().toString();
if(requestUrl.indexOf("https://") == 0){
protocol = "https://";
}
String fileUPathHost = protocol + detectXSSEx(request.getHeader("host"));
String imagePhysicalPath = "";
String imageSubDirName = "";
String useExternalServer = detectXSSEx(request.getParameter("useExternalServer"));
String uploadFileExtBlockList = "";
//2018-11-20[4.2.0.12]vaccine로직 주석(수정된 빌드로 나갈 때 추가)
//String strVaccinePath = "";
%>
<%--@include file="VaccinePath.jsp"--%>
<%@include file="ImagePath.jsp"%>
<%@include file="UploadFileExtBlockList.jsp"%>
<%
String fileModify = "";
if ( detectXSSEx(request.getParameter("filemodify")) != null)
fileModify = detectXSSEx(request.getParameter("filemodify"));
String fileEditorFlag = "";
if ( detectXSSEx(request.getParameter("fileEditorFlag")) != null)
fileEditorFlag = detectXSSEx(request.getParameter("fileEditorFlag"));
String uploadFileSubDir = "";
if ( detectXSSEx(request.getParameter("uploadFileSubDir")) != null)
uploadFileSubDir = detectXSSEx(request.getParameter("uploadFileSubDir"));
String fileDomain = "";
if ( detectXSSEx(request.getParameter("fileDomain")) != null)
fileDomain = detectXSSEx(request.getParameter("fileDomain"));
/*
String useExternalServer = "";
if ( detectXSSEx(request.getParameter("useExternalServer")) != null)
useExternalServer = detectXSSEx(request.getParameter("useExternalServer"));
*/
String checkPlugin = "false";
String fileTemp = "";
String scriptValue = "";
String saveFolder = "";
String returnParam ="";
String ContextPath = request.getContextPath();
String fileSize = "";
String tempFileName = "";
boolean diFlag = false;
ServletContext context = getServletConfig().getServletContext();
if (!imageUPath.equalsIgnoreCase("")) {
if (imageUPath.length() > 7) {
if (imageUPath.substring(0, 7).equalsIgnoreCase("http://")) {
fileTemp = imageUPath.substring(7);
imageUPath = fileTemp.substring(fileTemp.indexOf("/"));
fileUPathHost = "http://" + fileTemp.substring(0, fileTemp.indexOf("/"));
}
else if (imageUPath.substring(0, 8).equalsIgnoreCase("https://")) {
fileTemp = imageUPath.substring(8);
imageUPath = fileTemp.substring(fileTemp.indexOf("/"));
fileUPathHost = "https://" + fileTemp.substring(0, fileTemp.indexOf("/"));
}
else if (!imageUPath.substring(0, 1).equalsIgnoreCase("/")) {
scriptValue = executeFileScript(response, "invalid_path", "", useExternalServer, fileDomain, fileEditorFlag, checkPlugin);
response.getWriter().println(scriptValue);
return;
}
} else {
if (!imageUPath.substring(0, 1).equalsIgnoreCase("/")) {
scriptValue = executeFileScript(response, "invalid_path", "" , useExternalServer, fileDomain, fileEditorFlag, checkPlugin);
response.getWriter().println(scriptValue);
return;
}
}
} else {
diFlag = true;
if (defaultUPath.length() > 7) {
if (defaultUPath.substring(0, 7).equalsIgnoreCase("http://")) {
fileTemp = defaultUPath.substring(7);
imageUPath = fileTemp.substring(fileTemp.indexOf("/"));
}
else if (defaultUPath.substring(0, 8).equalsIgnoreCase("https://")) {
fileTemp = defaultUPath.substring(8);
imageUPath = fileTemp.substring(fileTemp.indexOf("/"));
} else if (defaultUPath.substring(0, 1).equalsIgnoreCase("/"))
imageUPath = defaultUPath;
else {
scriptValue = executeFileScript(response, "invalid_path", "" , useExternalServer, fileDomain, fileEditorFlag, checkPlugin);
response.getWriter().println(scriptValue);
return;
}
} else {
if (defaultUPath.substring(0, 1).equalsIgnoreCase("/"))
imageUPath = defaultUPath;
else {
scriptValue = executeFileScript(response, "invalid_path", "", useExternalServer, fileDomain, fileEditorFlag, checkPlugin);
response.getWriter().println(scriptValue);
return;
}
}
}
if (imageUPath.length() > 0 && imageUPath.lastIndexOf("/") != imageUPath.length() - 1)
imageUPath = imageUPath + "/";
if (imagePhysicalPath.equalsIgnoreCase("")) {
String DompaserValue = dompaser(imageUPath);
if (DompaserValue.equalsIgnoreCase("")) {
imagePhysicalPath = context.getRealPath(imageUPath);
// 2013.08.26 [2.0.5.23] mwhong tomcat8.0
if(imagePhysicalPath == null && imageUPath != null && ContextPath != null){
imagePhysicalPath = context.getRealPath(imageUPath.substring(ContextPath.length()));
}
if (!ContextPath.equalsIgnoreCase("") && !ContextPath.equalsIgnoreCase("/")) {
File tempFileRealDIR = new File(imagePhysicalPath);
if (!tempFileRealDIR.exists()){
if (imageUPath.indexOf(ContextPath) != -1)
imagePhysicalPath = context.getRealPath(imageUPath.substring(ContextPath.length()));
}
}
}
else
imagePhysicalPath = DompaserValue;
}
File fileRealFolderWriteCheck = new File(imagePhysicalPath);
if (!fileRealFolderWriteCheck.exists()) {
scriptValue = executeFileScript(response, "invalid_path", "" , useExternalServer, fileDomain, fileEditorFlag, checkPlugin);
response.getWriter().println(scriptValue);
return;
}
if (!fileRealFolderWriteCheck.canWrite()) {
scriptValue = executeFileScript(response, "canWriteErr", "", useExternalServer, fileDomain, fileEditorFlag, checkPlugin);
response.getWriter().println(scriptValue);
return;
}
if (imagePhysicalPath.length() > 0 && imagePhysicalPath.lastIndexOf(File.separator) != imagePhysicalPath.length() - 1)
imagePhysicalPath += File.separator;
String filePhysicalPathsubFolder = imagePhysicalPath;
File SaveSubFolder = new File(filePhysicalPathsubFolder + "upload");
if(!SaveSubFolder.exists()){
SaveSubFolder.setExecutable(false, true);
SaveSubFolder.setReadable(true);
SaveSubFolder.setWritable(false, true);
boolean returnRes = SaveSubFolder.mkdir();
if(returnRes == false && !SaveSubFolder.exists()){
scriptValue = executeFileScript(response, "invalid_path", "", useExternalServer, fileDomain, fileEditorFlag, checkPlugin);
response.getWriter().println(scriptValue);
return;
}
}
filePhysicalPathsubFolder += "upload" + File.separator;
File DeleteTempFolder = null;
try {
String tempFileFolder = "";
if (uploadFileSubDir.equalsIgnoreCase("false") && !imageUPath.equalsIgnoreCase(""))
tempFileFolder = tempFolderCreate(imagePhysicalPath);
else
tempFileFolder = imagePhysicalPath;
//boolean isMultipart = ServletFileUpload.isMultipartContent(request);
if (isMultipart) {
String realDir = filePhysicalPathsubFolder;
//DiskFileItemFactory factory = new DiskFileItemFactory();
//factory.setSizeThreshold(2 * 1024 * 1024);
//ServletFileUpload upload = new ServletFileUpload(factory);
//upload.setSizeMax(-1);
//upload.setHeaderEncoding("utf-8");
//List items = upload.parseRequest(request);
Iterator iter=items.iterator();
String fileMaxCount = "";
String fileTitle = "";
String fileId = "";
String fileClass = "";
String fileKind = "";
String fileTempFName = "";
String fileUNameType = "";
String editorFrame = "";
String filename = "";
String type = "";
while(iter.hasNext()){
FileItem fileItem = (FileItem) iter.next();
if(fileItem.isFormField()){
if( fileItem.getFieldName().equalsIgnoreCase("fileMaxCount") ) fileMaxCount = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("fileTitle") ) fileTitle = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("fileId") ) fileId = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("fileClass") ) fileClass = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("fileKind") ) fileKind = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("fileTempFName") ) fileTempFName = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("fileUNameType") ) fileUNameType = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("editorFrame") ) editorFrame = detectXSSEx(toString(fileItem.getString("utf-8")));
} else {
if(fileItem.getSize()>0) {
fileSize = Long.toString(fileItem.getSize());
if(fileItem.getSize() > maxSize){
scriptValue = executeFileScript(response, "invalid_size", Integer.toString(maxSize), useExternalServer, fileDomain, fileEditorFlag, checkPlugin);
response.getWriter().println(scriptValue);
return;
}
filename = fileItem.getName();
//filename = detectXSSEx(filename);
filename = detectXSSEx2(filename);
if (filename.lastIndexOf("\\") != -1) {
filename = filename.substring(filename.lastIndexOf("\\"), filename.length());
}
type = fileItem.getContentType();
if (filename.toLowerCase().indexOf(".") == -1 || filename.toLowerCase().indexOf(".jar") != -1 || filename.toLowerCase().indexOf(".war") != -1 || filename.toLowerCase().indexOf(".jsp") != -1 || filename.toLowerCase().indexOf(".jspx") != -1 || filename.toLowerCase().indexOf(".js") != -1 || filename.toLowerCase().indexOf(".html") != -1 || filename.toLowerCase().indexOf(".htm") != -1) {
//scriptValue = executeFileScript(response, "fail_image", "", useExternalServer, fileDomain, fileEditorFlag, checkPlugin);
//scriptValue = executeFileScript(response, "invalid_file", "prohibited : jsp, js, html, htm", useExternalServer, fileDomain, fileEditorFlag, checkPlugin);
// [4.0.0.22] [한국인터넷진흥원 보안 취약점] 제한된 확장자 목록 alert에 보이지 않도록 처리
//scriptValue = executeFileScript(response, "fail_image", "", useExternalServer, fileDomain, fileEditorFlag, checkPlugin);
scriptValue = executeFileScript(response, "UploadFileExtBlock", "", useExternalServer, fileDomain, fileEditorFlag, checkPlugin);
response.getWriter().println(scriptValue);
return;
}
try{
tempFileName = filename;
File uploadedFile = new File(realDir + tempFileName);
if(uploadedFile.exists()){
tempFileName = fileNameTimeSetting();
uploadedFile = new File(realDir,tempFileName);
}
//File uploadedFile=new File(realDir,filename);
fileItem.write(uploadedFile);
fileItem.delete();
DeleteTempFolder = uploadedFile;
}catch(IOException ex) {
//System.out.println("An internal exception occured!");
messageText = "upload fail";
}
}
}
}
String fileTempName = "";
String fileKindSubFolder = "";
fileKindSubFolder = "files";
if (fileUNameType.equalsIgnoreCase("real"))
fileTempName = filename.substring(0, filename.lastIndexOf("."));
else if(fileUNameType.equalsIgnoreCase("random"))
fileTempName = fileNameTimeSetting();
else {
//fileTempName = fileTempFName;
fileTempName = filename.substring(0, filename.lastIndexOf("."));
//sun.misc.BASE64Encoder encoder = new sun.misc.BASE64Encoder();
//byte[] keyByte = fileTempName.getBytes("utf-8");
//fileTempName = encoder.encode(keyByte);
//라이브러리 추가 요함 -> https://commons.apache.org/proper/commons-codec/download_codec.cgi
byte[] encoded = Base64.encodeBase64(fileTempName.getBytes());
fileTempName = new String(encoded, "ISO-8859-1");
if (fileTempName.indexOf("/") != -1)
fileTempName = fileTempName.replaceAll("/", "==NamOSeSlaSH==");
}
String realFileName = fileTempName.replace(' ', '_');
String fileCheck =filename.substring(filename.lastIndexOf(".") + 1).toLowerCase();
fileCheck = detectXSSEx(fileCheck);
if(uploadFileExtBlockList.length() > 0 && !isArray(uploadFileExtBlockList, fileCheck)){
scriptValue = executeFileScript(response, "UploadFileExtBlock", "", useExternalServer, fileDomain, fileEditorFlag, checkPlugin);
response.getWriter().println(scriptValue);
return;
}
/*
if (!isImageValid("file", fileCheck)) {
if(uploadFileSubDir.equalsIgnoreCase("false") && !imageUPath.equalsIgnoreCase(""))
tempFolderDelete(tempFileFolder);
scriptValue = executeFileScript(response, "invalid_file", getImageKind("file"), useExternalServer, fileDomain, fileEditorFlag, checkPlugin);
response.getWriter().println(scriptValue);
return;
}
*/
Calendar cal = Calendar.getInstance();
String year = Integer.toString(cal.get(Calendar.YEAR));
String month = Integer.toString(cal.get(Calendar.MONTH)+1);
String day = Integer.toString(cal.get(Calendar.DAY_OF_MONTH));
String sPath = "";
if(month.length() == 1)
month = "0" + month;
if(day.length() == 1)
day = "0" + day;
if(uploadFileSubDir.equalsIgnoreCase("false")) {
if(imageSubDirName != "")
imagePhysicalPath += "data" + File.separator;
File fileSaveSubFolder = new File(imagePhysicalPath);
synchronized (this){
if(!fileSaveSubFolder.exists()){
fileSaveSubFolder.setExecutable(false, true);
fileSaveSubFolder.setReadable(true);
fileSaveSubFolder.setWritable(false, true);
boolean returnRes = fileSaveSubFolder.mkdirs();
if(returnRes == false){
scriptValue = executeFileScript(response, "invalid_path", "", useExternalServer, fileDomain, fileEditorFlag, checkPlugin);
response.getWriter().println(scriptValue);
return;
}
}
}
if(imageSubDirName != ""){
sPath = year + File.separator + month + File.separator + day + File.separator + imageSubDirName;
imagePhysicalPath += sPath + File.separator;
File folderPath = new File(imagePhysicalPath);
synchronized (this){
if(!folderPath.exists()){
try{
folderPath.setExecutable(false, true);
folderPath.setReadable(true);
folderPath.setWritable(false, true);
folderPath.mkdirs();
}catch(Exception e){
e.getStackTrace();
}
}
}
}
} else {
if(imageSubDirName != "")
imagePhysicalPath += "data" + File.separator;
File fileSaveSubFolder = new File(imagePhysicalPath + fileKindSubFolder);
synchronized (this){
if(!fileSaveSubFolder.exists()){
fileSaveSubFolder.setExecutable(false, true);
fileSaveSubFolder.setReadable(true);
fileSaveSubFolder.setWritable(false, true);
boolean returnRes = fileSaveSubFolder.mkdirs();
if(returnRes == false){
scriptValue = executeFileScript(response, "invalid_path", "", useExternalServer, fileDomain, fileEditorFlag, checkPlugin);
response.getWriter().println(scriptValue);
return;
}
}
}
imagePhysicalPath += fileKindSubFolder + File.separator;
if(imageSubDirName != ""){
sPath = year + File.separator + month + File.separator + day + File.separator + imageSubDirName;
imagePhysicalPath += sPath + File.separator;
File folderPath = new File(imagePhysicalPath);
synchronized (this){
if(!folderPath.exists()){
try{
folderPath.setExecutable(false, true);
folderPath.setReadable(true);
folderPath.setWritable(false, true);
folderPath.mkdirs();
}catch(Exception e){
e.getStackTrace();
}
}
}
}
saveFolder = getChildDirectory(imagePhysicalPath, fileMaxCount);
if (saveFolder.equalsIgnoreCase("")) {
if(uploadFileSubDir.equalsIgnoreCase("false") && !imageUPath.equalsIgnoreCase("")){
boolean returnRes = tempFolderDelete(tempFileFolder);
if(returnRes == false){
messageText = "delete fail";
}
}
scriptValue = executeFileScript(response, "invalid_path", "", useExternalServer, fileDomain, fileEditorFlag, checkPlugin);
response.getWriter().println(scriptValue);
return;
} else
imagePhysicalPath += saveFolder;
}
realFileName = realFileName.replace('\\', ' ').trim();
String filenamecheck = checkFileUniqueName(realFileName, imagePhysicalPath, fileCheck);
String imgLinkParams = "";
String urlFilePath = fileUPathHost + imageUPath;
if(uploadFileSubDir.equalsIgnoreCase("false")) {
if(imageSubDirName != "")
urlFilePath += "data" + File.separator + sPath + File.separator;
} else{
if(imageSubDirName != "")
urlFilePath += "data" + File.separator + fileKindSubFolder + File.separator + sPath + File.separator + saveFolder + File.separator;
else
urlFilePath += fileKindSubFolder + File.separator + saveFolder + File.separator;
}
urlFilePath = urlFilePath.replace('\\', '/');
filenamecheck = filenamecheck.replace('\\', ' ').trim();
urlFilePath += filenamecheck;
imgLinkParams = urlFilePath;
if (fileTitle == null)
fileTitle ="";
if (fileId == null)
fileId ="";
if (fileClass == null)
fileClass = "";
if (editorFrame == null)
editorFrame = "";
if (fileSize == null)
fileSize = "";
returnParam = "{";
//returnParam += "\"fileURL\":\"" + urlFilePath.replaceAll("'", "\\\\\"") + "\",";
returnParam += "\"fileURL\":\"" + urlFilePath + "\",";
returnParam += "\"fileTitle\":\"" + fileTitle + "\",";
returnParam += "\"fileId\":\"" + fileId + "\",";
returnParam += "\"fileClass\":\"" + fileClass + "\",";
returnParam += "\"fileKind\":\"" + fileKind + "\",";
returnParam += "\"fileType\":\"" + fileCheck + "\",";
returnParam += "\"fileSize\":\"" + fileSize + "\",";
if (fileModify.equalsIgnoreCase("true"))
returnParam += "\"fileModify\":\"true\",";
returnParam += "\"editorFrame\":\"" + editorFrame + "\"";
returnParam += "}";
String moveFilePath = imagePhysicalPath + File.separator + filenamecheck;
int check = fileCopy(filePhysicalPathsubFolder + tempFileName, moveFilePath);
if(DeleteTempFolder != null){
boolean returnRes = DeleteTempFolder.delete();
if(returnRes == false){
messageText = "delete fail";
}
}
if (check == 1) {
//2018-11-20[4.2.0.12]vaccine로직 주석(수정된 빌드로 나갈 때 추가)
/*
if (strVaccinePath.length() <= 0) {
strVaccinePath = imagePhysicalPath + "/../../../vse";
}
String strName = checkVirusFile (moveFilePath, imagePhysicalPath + File.separator, strVaccinePath);
*/
if(uploadFileSubDir.equalsIgnoreCase("false") && !imageUPath.equalsIgnoreCase("")){
boolean returnRes = tempFolderDelete(tempFileFolder);
if(returnRes == false){
messageText = "delete fail";
}
}
if (SaveSubFolder.exists()){
boolean returnRes = SaveSubFolder.delete();
if(returnRes == false){
messageText = "delete fail";
}
}
//2018-11-20[4.2.0.12]vaccine로직 주석(수정된 빌드로 나갈 때 추가)
/*
if (strName.length() > 0) {
String msg = "found virus (";
msg += strName + ")";
scriptValue = executeFileScript(response, "virus", msg, useExternalServer, fileDomain, fileEditorFlag, "false");
response.getWriter().println(scriptValue);
return;
}
*/
scriptValue = executeFileScript(response, "success", returnParam, useExternalServer, fileDomain, fileEditorFlag, checkPlugin);
response.getWriter().println(scriptValue);
return;
} else {
if(uploadFileSubDir.equalsIgnoreCase("false") && !imageUPath.equalsIgnoreCase("")){
boolean returnRes = tempFolderDelete(tempFileFolder);
if(returnRes == false){
messageText = "delete fail";
}
}
scriptValue = executeFileScript(response, "fileCopyFail", "", useExternalServer, fileDomain, fileEditorFlag, checkPlugin);
response.getWriter().println(scriptValue);
return;
}
}else{
response.getWriter().println("not encoding type multipart/form-data");
}
} catch (IOException ioe) {
scriptValue = executeFileScript(response, "invalid_size", Integer.toString(maxSize), useExternalServer, fileDomain, fileEditorFlag, checkPlugin);
response.getWriter().println(scriptValue);
return;
} catch (org.apache.commons.fileupload.FileUploadBase.SizeLimitExceededException e) {
scriptValue = executeFileScript(response, "invalid_size", Integer.toString(maxSize), useExternalServer, fileDomain, fileEditorFlag, checkPlugin);
response.getWriter().println(scriptValue);
return;
} catch (RuntimeException e) {
messageText += "RuntimeException";
messageText = "<System Error>" + messageText;
scriptValue = executeFileScript(response, "", messageText, useExternalServer, fileDomain, fileEditorFlag, checkPlugin);
response.getWriter().println(scriptValue);
return;
}
%>

View File

@ -0,0 +1,35 @@
<%
/*
String namoFileKind = request.getParameter("namofilekind");
//filelink
String namoFilePhysicalPath = "D:\\cejava\\htdocs\\ce3\\namofile";
String namoFileUPath = "/ce3/namofile";
//movie
String namoFlashPhysicalPath = "D:\\cejava\\htdocs\\ce3\\namomovie";
String namoFlashUPath = "/ce3/namomovie";
//image
String namoImagePhysicalPath = "D:\\cejava\\htdocs\\ce3\\namoimage";
String namoImageUPath = "/ce3/namoimage";
System.out.println("namoFileKind: "+ namoFileKind);
if(namoFileKind != null && "file".equals(namoFileKind)){
imagePhysicalPath = namoFilePhysicalPath;
imageUPath = namoFileUPath;
}else if(namoFileKind != null && "flash".equals(namoFileKind)){
imagePhysicalPath = namoFlashPhysicalPath;
imageUPath = namoFlashUPath;
}else{
imagePhysicalPath = namoImagePhysicalPath;
imageUPath = namoImageUPath;
}
*/
//imagePhysicalPath = "C:\\cejava\\htdocs\\uploadfile";
//imageUPath = "/uploadfile";
%>

View File

@ -0,0 +1,933 @@
<%@page contentType="text/html;charset=utf-8" %>
<%@page import="java.util.regex.PatternSyntaxException"%>
<%@page import="java.io.*"%>
<%@page import="java.net.*"%>
<%@page import="java.awt.*"%>
<%@page import="javax.swing.ImageIcon"%>
<%@page import="java.util.List"%>
<%@page import="org.apache.commons.fileupload.servlet.ServletFileUpload"%>
<%@page import="org.apache.commons.fileupload.disk.DiskFileItemFactory"%>
<%@page import="org.apache.commons.fileupload.FileItem"%>
<%@page import="org.apache.commons.fileupload.FileUploadBase"%>
<%@page import="org.apache.commons.codec.binary.Base64"%>
<%@include file="Util.jsp"%>
<%@include file="SecurityTool.jsp"%>
<%--@include file="Vaccine.jsp"--%>
<%@page import="javax.imageio.*"%>
<%@page import="javax.imageio.stream.ImageInputStream"%>
<%@page import="javax.imageio.stream.FileImageInputStream"%>
<%@page import="java.net.UnknownHostException"%>
<%@page import="java.util.Calendar"%>
<%!
public Dimension getImageDim(final String path) {
Dimension result = null;
String suffix = this.getFileSuffix(path);
Iterator<ImageReader> iter = ImageIO.getImageReadersBySuffix(suffix);
if (iter.hasNext()) {
ImageReader reader = iter.next();
ImageInputStream stream = null;
boolean exceptionCheck = false;
try {
stream = new FileImageInputStream(new File(path));
reader.setInput(stream);
int width = reader.getWidth(reader.getMinIndex());
int height = reader.getHeight(reader.getMinIndex());
result = new Dimension(width, height);
} catch (IOException e) {
result = null;
} finally {
try {
if(stream != null){
stream.close();
}
} catch (IOException e) {
result = null;
}
if(reader != null){
reader.dispose();
}
}
}
return result;
}
private String getFileSuffix(final String path) {
String result = null;
if (path != null) {
result = "";
if (path.lastIndexOf('.') != -1) {
result = path.substring(path.lastIndexOf('.'));
if (result.charAt(0) == '.') {
result = result.substring(1);
}
}
}
return result;
}
%>
<%
/*
if(detectXSSEx(request.getParameter("licenseCheck")) != null){
if(detectXSSEx(request.getParameter("licenseCheck")).toLowerCase().equalsIgnoreCase("true")){
response.getWriter().println(InetAddress.getLocalHost().getHostAddress());
return;
}
}
*/
boolean isMultipart = ServletFileUpload.isMultipartContent(request);
DiskFileItemFactory factory = null;
ServletFileUpload upload = null;
List items = null;
//try {
if (isMultipart) {
factory = new DiskFileItemFactory();
factory.setSizeThreshold(2 * 1024 * 1024);
upload = new ServletFileUpload(factory);
upload.setSizeMax(-1);
upload.setHeaderEncoding("utf-8");
items = upload.parseRequest(request);
}else{
response.getWriter().println("not encoding type multipart/form-data");
}
//} catch (Exception e) {
// response.getWriter().println("not encoding type multipart/form-data");
// return;
//}
String messageText = "";
int maxSize = 5242880;
if(request.getParameter("imageSizeLimit") != null){
maxSize = Integer.parseInt(detectXSSEx(request.getParameter("imageSizeLimit")));
}
String defaultUPath = detectXSSEx(request.getParameter("defaultUPath"));
String imageUPath = detectXSSEx(request.getParameter("imageUPath"));
String protocol = "http://";
//if(request.isSecure()){
// protocol = "https://";
//}
String requestUrl = request.getRequestURL().toString();
if(requestUrl.indexOf("https://") == 0){
protocol = "https://";
}
String imageUPathHost = protocol + detectXSSEx(request.getHeader("host"));
String imagePhysicalPath = "";
String imageSubDirName = "";
String useExternalServer = detectXSSEx(request.getParameter("useExternalServer"));
String uploadFileExtBlockList = "";
//2018-11-20[4.2.0.12]vaccine로직 주석(수정된 빌드로 나갈 때 추가)
//String strVaccinePath = "";
%>
<%--@include file="VaccinePath.jsp"--%>
<%@include file="ImagePath.jsp"%>
<%@include file="UploadFileExtBlockList.jsp"%>
<%
String imageModify = "";
if (detectXSSEx(request.getParameter("imagemodify")) != null)
imageModify = detectXSSEx(request.getParameter("imagemodify"));
String imageEditorFlag = "";
if (detectXSSEx(request.getParameter("imageEditorFlag")) != null)
imageEditorFlag = detectXSSEx(request.getParameter("imageEditorFlag"));
String uploadFileSubDir = "";
if (detectXSSEx(request.getParameter("uploadFileSubDir")) != null)
uploadFileSubDir = detectXSSEx(request.getParameter("uploadFileSubDir"));
String imageDomain = "";
if (detectXSSEx(request.getParameter("imageDomain")) != null)
imageDomain = detectXSSEx(request.getParameter("imageDomain"));
/*
String useExternalServer = "";
if (detectXSSEx(request.getParameter("useExternalServer")) != null)
useExternalServer = detectXSSEx(request.getParameter("useExternalServer"));
*/
String checkPlugin = "";
if (detectXSSEx(request.getParameter("checkPlugin")) != null)
checkPlugin = detectXSSEx(request.getParameter("checkPlugin"));
String fileType = "";
if (detectXSSEx(request.getParameter("fileType")) != null)
fileType = detectXSSEx(request.getParameter("fileType"));
String imageTemp = "";
String scriptValue = "";
String saveFolder = "";
String returnParam ="";
String ContextPath = request.getContextPath();
String tempFileName = "";
boolean diFlag = false;
ServletContext context = getServletConfig().getServletContext();
if (!imageUPath.equalsIgnoreCase("")) {
if (imageUPath.length() > 7) {
if (imageUPath.substring(0, 7).equalsIgnoreCase("http://")) {
imageTemp = imageUPath.substring(7);
imageUPath = imageTemp.substring(imageTemp.indexOf("/"));
imageUPathHost = "http://" + imageTemp.substring(0, imageTemp.indexOf("/"));
}
else if (imageUPath.substring(0, 8).equalsIgnoreCase("https://")) {
imageTemp = imageUPath.substring(8);
imageUPath = imageTemp.substring(imageTemp.indexOf("/"));
imageUPathHost = "https://" + imageTemp.substring(0, imageTemp.indexOf("/"));
}
else if (!imageUPath.substring(0, 1).equalsIgnoreCase("/")) {
scriptValue = executeScript(response, "invalid_path", "", useExternalServer, imageDomain, imageEditorFlag, checkPlugin);
if(scriptValue != null){
response.getWriter().println(scriptValue);
}
return;
}
} else {
if (!imageUPath.substring(0, 1).equalsIgnoreCase("/")) {
scriptValue = executeScript(response, "invalid_path", "" , useExternalServer, imageDomain, imageEditorFlag, checkPlugin);
if(scriptValue != null){
response.getWriter().println(scriptValue);
}
return;
}
}
} else {
diFlag = true;
if (defaultUPath.length() > 7) {
if (defaultUPath.substring(0, 7).equalsIgnoreCase("http://")) {
imageTemp = defaultUPath.substring(7);
imageUPath = imageTemp.substring(imageTemp.indexOf("/"));
}
else if (defaultUPath.substring(0, 8).equalsIgnoreCase("https://")) {
imageTemp = defaultUPath.substring(8);
imageUPath = imageTemp.substring(imageTemp.indexOf("/"));
} else if (defaultUPath.substring(0, 1).equalsIgnoreCase("/"))
imageUPath = defaultUPath;
else {
scriptValue = executeScript(response, "invalid_path", "" , useExternalServer, imageDomain, imageEditorFlag, checkPlugin);
if(scriptValue != null){
response.getWriter().println(scriptValue);
}
return;
}
} else {
if (defaultUPath.substring(0, 1).equalsIgnoreCase("/"))
imageUPath = defaultUPath;
else {
scriptValue = executeScript(response, "invalid_path", "", useExternalServer, imageDomain, imageEditorFlag, checkPlugin);
if(scriptValue != null){
response.getWriter().println(scriptValue);
}
return;
}
}
}
if (imageUPath.length() > 0 && imageUPath.lastIndexOf("/") != imageUPath.length() - 1)
imageUPath = imageUPath + "/";
if (imagePhysicalPath.equalsIgnoreCase("")) {
String DompaserValue = dompaser(imageUPath);
if (DompaserValue.equalsIgnoreCase("")) {
imagePhysicalPath = context.getRealPath(imageUPath);
// 2013.08.26 [2.0.5.23] mwhong tomcat8.0
if(imagePhysicalPath == null && imageUPath != null && ContextPath != null){
imagePhysicalPath = context.getRealPath(imageUPath.substring(ContextPath.length()));
}
if (!ContextPath.equalsIgnoreCase("") && !ContextPath.equalsIgnoreCase("/")) {
File tempFileRealDIR = new File(imagePhysicalPath);
if (!tempFileRealDIR.exists()){
if (imageUPath.indexOf(ContextPath) != -1)
imagePhysicalPath = context.getRealPath(imageUPath.substring(ContextPath.length()));
}
}
}
else
imagePhysicalPath = DompaserValue;
}
File fileRealFolderWriteCheck = new File(imagePhysicalPath);
if (!fileRealFolderWriteCheck.exists()) {
scriptValue = executeScript(response, "invalid_path", "" , useExternalServer, imageDomain, imageEditorFlag, checkPlugin);
if(scriptValue != null){
response.getWriter().println(scriptValue);
}
return;
}
if (!fileRealFolderWriteCheck.canWrite()) {
scriptValue = executeScript(response, "canWriteErr", "", useExternalServer, imageDomain, imageEditorFlag, checkPlugin);
if(scriptValue != null){
response.getWriter().println(scriptValue);
}
return;
}
if (imagePhysicalPath.length() > 0 && imagePhysicalPath.lastIndexOf(File.separator) != imagePhysicalPath.length() - 1)
imagePhysicalPath += File.separator;
String imagePhysicalPathsubFolder = imagePhysicalPath;
File SaveSubFolder = new File(imagePhysicalPathsubFolder + "upload");
if(!SaveSubFolder.exists()){
SaveSubFolder.setExecutable(false, true);
SaveSubFolder.setReadable(true);
SaveSubFolder.setWritable(false, true);
boolean returnRes = SaveSubFolder.mkdir();
if(returnRes == false && !SaveSubFolder.exists()){
scriptValue = executeScript(response, "invalid_path", "" , useExternalServer, imageDomain, imageEditorFlag, checkPlugin);
response.getWriter().println(scriptValue);
return;
}
}
imagePhysicalPathsubFolder += "upload" + File.separator;
File DeleteTempFolder = null;
try{
String tempFileFolder = "";
if (uploadFileSubDir.equalsIgnoreCase("false") && !imageUPath.equalsIgnoreCase(""))
tempFileFolder = tempFolderCreate(imagePhysicalPath);
else
tempFileFolder = imagePhysicalPath;
//boolean isMultipart = ServletFileUpload.isMultipartContent(request);
if (isMultipart) {
String realDir = imagePhysicalPathsubFolder;
//DiskFileItemFactory factory = new DiskFileItemFactory();
//factory.setSizeThreshold(2 * 1024 * 1024);
//ServletFileUpload upload = new ServletFileUpload(factory);
//upload.setSizeMax(-1);
//upload.setHeaderEncoding("utf-8");
//List items = upload.parseRequest(request);
if(items == null){
scriptValue = executeScript(response, "", messageText, useExternalServer, imageDomain, imageEditorFlag, checkPlugin);
if(scriptValue != null){
response.getWriter().println(scriptValue);
}
return;
}
//Iterator iter=items.iterator();
String imageMaxCount = "";
String imageTitle = "";
String imageAlt = "";
String imageWidth = "";
String imageWidthUnit ="";
String imageHeight = "";
String imageHeightUnit = "";
/*
* 2013.03.28 [3.0] mwHong
*
* imageMarginSet
*
*/
String imageMarginLeft = "";
String imageMarginLeftUnit ="";
String imageMarginRight = "";
String imageMarginRightUnit = "";
String imageMarginTop = "";
String imageMarginTopUnit ="";
String imageMarginBottom = "";
String imageMarginBottomUnit = "";
int oriWidthCheck = 0, oriHeightCheck = 0;
String imageAlign = "";
String imageId = "";
String imageClass = "";
String imageBorder = "";
String imageKind = "";
String imageTempFName = "";
String imageUNameType = "";
String imageUNameEncode = "";
String imageViewerPlay = "";
String imageOrgPath = "";
String editorFrame = "";
String filename = "";
String type = "";
String imageSize = "";
boolean invalidImage = false;
//while(iter.hasNext()){
// FileItem fileItem = (FileItem) iter.next();
for(int i=0; items.size()>i; i++){
FileItem fileItem = (FileItem) items.get(i);
if(fileItem.isFormField()){
if( fileItem.getFieldName().equalsIgnoreCase("imageMaxCount") ) imageMaxCount = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("imageTitle") ) imageTitle = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("imageAlt") ) imageAlt = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("imageWidth") ) imageWidth = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("imageWidthUnit") ) imageWidthUnit = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("imageHeight") ) imageHeight = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("imageHeightUnit") ) imageHeightUnit = detectXSSEx(toString(fileItem.getString("utf-8")));
/*
* 2013.03.28 [3.0] mwHong
*
* imageMarginSet
*
*/
if( fileItem.getFieldName().equalsIgnoreCase("imageMaginLeft") ) imageMarginLeft = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("imageMaginLeftUnit") ) imageMarginLeftUnit = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("imageMaginRight") ) imageMarginRight = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("imageMaginRightUnit") ) imageMarginRightUnit = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("imageMaginTop") ) imageMarginTop = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("imageMaginTopUnit") ) imageMarginTopUnit = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("imageMaginBottom") ) imageMarginBottom = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("imageMaginBottomUnit") ) imageMarginBottomUnit = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("imageAlign") ) imageAlign = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("imageId") ) imageId = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("imageClass") ) imageClass = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("imageBorder") ) imageBorder = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("imageKind") ) imageKind = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("imageTempFName") ) imageTempFName = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("imageUNameType") ) imageUNameType = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("imageUNameEncode") ) imageUNameEncode = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("imageViewerPlay") ) imageViewerPlay = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("imageOrgPath") ) imageOrgPath = detectXSSEx(toString(fileItem.getString("utf-8")));
if( fileItem.getFieldName().equalsIgnoreCase("editorFrame") ) editorFrame = detectXSSEx(toString(fileItem.getString("utf-8")));
} else {
if(fileItem.getSize()>0) {
imageSize = Long.toString(fileItem.getSize());
if(fileItem.getSize() > maxSize){
scriptValue = executeScript(response, "invalid_size", Integer.toString(maxSize), useExternalServer, imageDomain, imageEditorFlag, checkPlugin);
if(scriptValue != null){
response.getWriter().println(scriptValue);
}
return;
}
filename = fileItem.getName();
if (filename != null) {
//filename = detectXSSEx(filename);
filename = detectXSSEx2(filename);
/*
if (filename.endsWith(".jsp") || filename.endsWith(".js") || filename.endsWith(".html") || filename.endsWith(".htm")) {
scriptValue = executeScript(response, "invalid_image", "", useExternalServer, imageDomain, imageEditorFlag, checkPlugin);
response.getWriter().println(scriptValue);
return;
}
*/
if (filename.toLowerCase().indexOf(".jar") != -1 || filename.toLowerCase().indexOf(".war") != -1 || filename.toLowerCase().indexOf(".jsp") != -1 || filename.toLowerCase().indexOf(".jspx") != -1 || filename.toLowerCase().indexOf(".js") != -1 || filename.toLowerCase().indexOf(".html") != -1 || filename.toLowerCase().indexOf(".htm") != -1) {
//scriptValue = executeScript(response, "invalid_image", "prohibited extensions", useExternalServer, imageDomain, imageEditorFlag, checkPlugin);
/*
scriptValue = executeScript(response, "invalid_image", "", useExternalServer, imageDomain, imageEditorFlag, checkPlugin);
if(scriptValue != null){
response.getWriter().println(scriptValue);
}
return;
*/
invalidImage = true;
}
}
if (filename.lastIndexOf("\\") != -1) {
filename = filename.substring(filename.lastIndexOf("\\")+1, filename.length());
}
if(checkPlugin.equalsIgnoreCase("false") && filename.equalsIgnoreCase("blob")) {
filename = fileNameTimeSetting()+"."+fileType;
}
type = fileItem.getContentType();
try{
tempFileName = filename;
File uploadedFile = new File(realDir + tempFileName);
if(uploadedFile.exists()){
tempFileName = fileNameTimeSetting() + filename.substring(filename.lastIndexOf(".")).toLowerCase();
uploadedFile = new File(realDir + tempFileName);
}
//File uploadedFile=new File(realDir,filename);
fileItem.write(uploadedFile);
fileItem.delete();
DeleteTempFolder = uploadedFile;
}catch(IOException ex) {
//System.out.println("An internal exception occured!");
messageText = "upload fail";
}
}
}
}
String fileTempName = "";
String imageKindSubFolder = "";
if (imageKind.toLowerCase().indexOf("flash") != -1)
imageKindSubFolder = "flashes";
else if (imageKind.toLowerCase().indexOf("image") != -1)
imageKindSubFolder = "images";
else
imageKindSubFolder = "movies";
if (imageUNameType.equalsIgnoreCase("real"))
fileTempName = filename.substring(0, filename.lastIndexOf("."));
else if(imageUNameType.equalsIgnoreCase("random")){
fileTempName = fileNameTimeSetting();
}
else {
//fileTempName = imageTempFName;
fileTempName = filename.substring(0, filename.lastIndexOf("."));
//sun.misc.BASE64Encoder encoder = new sun.misc.BASE64Encoder();
//byte[] keyByte = fileTempName.getBytes("utf-8");
//fileTempName = encoder.encode(keyByte);
//라이브러리 추가 요함 -> https://commons.apache.org/proper/commons-codec/download_codec.cgi
byte[] encoded = Base64.encodeBase64(fileTempName.getBytes());
fileTempName = new String(encoded, "ISO-8859-1");
if (fileTempName.indexOf("/") != -1)
fileTempName = fileTempName.replaceAll("/", "==NamOSeSlaSH==");
}
String realFileName = fileTempName.replace(' ', '_');
String fileCheck =filename.substring(filename.lastIndexOf(".") + 1).toLowerCase();
if(uploadFileExtBlockList.length() > 0 && !isArray(uploadFileExtBlockList, fileCheck)){
scriptValue = executeScript(response, "UploadFileExtBlock", "", useExternalServer, imageDomain, imageEditorFlag, checkPlugin);
response.getWriter().println(scriptValue);
return;
}
if (!isImageValid(imageKind, fileCheck) || invalidImage) {
if(uploadFileSubDir.equalsIgnoreCase("false") && !imageUPath.equalsIgnoreCase("")){
boolean returnRes = tempFolderDelete(tempFileFolder);
if(returnRes == false){
messageText = "delete fail";
}
}
if(invalidImage){
scriptValue = executeScript(response, "invalid_image", "", useExternalServer, imageDomain, imageEditorFlag, checkPlugin);
}else{
scriptValue = executeScript(response, "invalid_image", getImageKind(imageKind), useExternalServer, imageDomain, imageEditorFlag, checkPlugin);
}
if(scriptValue != null){
response.getWriter().println(scriptValue);
}
return;
}
/*
* 2016.03.23 [4.0] hylee
* image check
*/
//2016.11.09 update by nkpark (문제가 있어서 일시적으로 주석처리 추후 다시 살펴봐야함)
//2018-08-07 [CROSS4-799][롯데백화점] 실제 이미지 파일인지 체크하는 로직
if("image".equalsIgnoreCase(imageKind) || "backgroundimage".equalsIgnoreCase(imageKind)) {
//Image imgCheck = new ImageIcon(imagePhysicalPathsubFolder + filename).getImage();
//oriWidthCheck = imgCheck.getWidth(null);
//oriHeightCheck = imgCheck.getHeight(null);
Dimension ds = getImageDim(imagePhysicalPathsubFolder + tempFileName);
if (ds == null) {
if(uploadFileSubDir.equalsIgnoreCase("false") && !imageUPath.equalsIgnoreCase("")){
boolean returnRes = tempFolderDelete(tempFileFolder);
if(returnRes == false){
messageText = "delete fail";
}
}
scriptValue = executeScript(response, "fail_image", getImageKind(imageKind), useExternalServer, imageDomain, imageEditorFlag, checkPlugin);
response.getWriter().println(scriptValue);
return;
}
oriWidthCheck = ds.width;
oriHeightCheck = ds.height;
}
/* end */
Calendar cal = Calendar.getInstance();
String year = Integer.toString(cal.get(Calendar.YEAR));
String month = Integer.toString(cal.get(Calendar.MONTH)+1);
String day = Integer.toString(cal.get(Calendar.DAY_OF_MONTH));
String sPath = "";
if(month.length() == 1)
month = "0" + month;
if(day.length() == 1)
day = "0" + day;
if(uploadFileSubDir.equalsIgnoreCase("false")) {
if(imageSubDirName != "")
imagePhysicalPath += "data" + File.separator;
File imageSaveSubFolder = new File(imagePhysicalPath);
synchronized (this){
if(!imageSaveSubFolder.exists()){
imageSaveSubFolder.setExecutable(false, true);
imageSaveSubFolder.setReadable(true);
imageSaveSubFolder.setWritable(false, true);
boolean returnRes = imageSaveSubFolder.mkdirs();
if(returnRes == false){
scriptValue = executeScript(response, "invalid_path", "" , useExternalServer, imageDomain, imageEditorFlag, checkPlugin);
response.getWriter().println(scriptValue);
return;
}
}
}
if(imageSubDirName != ""){
sPath = year + File.separator + month + File.separator + day + File.separator + imageSubDirName;
imagePhysicalPath += sPath + File.separator;
File folderPath = new File(imagePhysicalPath);
synchronized (this){
if(!folderPath.exists()){
try{
folderPath.setExecutable(false, true);
folderPath.setReadable(true);
folderPath.setWritable(false, true);
folderPath.mkdirs();
}catch(Exception e){
e.getStackTrace();
}
}
}
}
} else {
if(imageSubDirName != "")
imagePhysicalPath += "data" + File.separator;
File imageSaveSubFolder = new File(imagePhysicalPath + imageKindSubFolder);
synchronized (this){
if(!imageSaveSubFolder.exists()){
imageSaveSubFolder.setExecutable(false, true);
imageSaveSubFolder.setReadable(true);
imageSaveSubFolder.setWritable(false, true);
boolean returnRes = imageSaveSubFolder.mkdirs();
if(returnRes == false){
scriptValue = executeScript(response, "invalid_path", "" , useExternalServer, imageDomain, imageEditorFlag, checkPlugin);
response.getWriter().println(scriptValue);
return;
}
}
}
imagePhysicalPath += imageKindSubFolder + File.separator;
if(imageSubDirName != ""){
sPath = year + File.separator + month + File.separator + day + File.separator + imageSubDirName;
imagePhysicalPath += sPath + File.separator;
File folderPath = new File(imagePhysicalPath);
synchronized (this){
if(!folderPath.exists()){
try{
folderPath.setExecutable(false, true);
folderPath.setReadable(true);
folderPath.setWritable(false, true);
folderPath.mkdirs();
}catch(Exception e){
e.getStackTrace();
}
}
}
}
saveFolder = getChildDirectory(imagePhysicalPath, imageMaxCount);
if (saveFolder.equalsIgnoreCase("")) {
if(uploadFileSubDir.equalsIgnoreCase("false") && !imageUPath.equalsIgnoreCase("")){
boolean returnRes = tempFolderDelete(tempFileFolder);
if(returnRes == false){
messageText = "delete fail";
}
}
scriptValue = executeScript(response, "invalid_path", "", useExternalServer, imageDomain, imageEditorFlag, checkPlugin);
if(scriptValue != null){
response.getWriter().println(scriptValue);
}
return;
} else
imagePhysicalPath += saveFolder;
}
String filenamecheck = checkFileUniqueName(realFileName, imagePhysicalPath, fileCheck);
String imgLinkParams = "";
String urlFilePath = imageUPathHost + imageUPath;
if(uploadFileSubDir.equalsIgnoreCase("false")) {
if(imageSubDirName != "")
urlFilePath += "data" + File.separator + sPath + File.separator;
} else{
if(imageSubDirName != "")
urlFilePath += "data" + File.separator + imageKindSubFolder + File.separator + sPath + File.separator + saveFolder + File.separator;
else
urlFilePath += imageKindSubFolder + File.separator + saveFolder + File.separator;
}
urlFilePath = urlFilePath.replace('\\', '/');
/*
if (imageViewerPlay.equalsIgnoreCase("true")) {
String curUrlPath = request.getRequestURI();
curUrlPath = curUrlPath.substring(0, curUrlPath.lastIndexOf("/"));
String imgLinkPathRename = imageUPathHost + curUrlPath + "/ImageViewer.jsp?imagesrc=";
if (imageUNameType.equalsIgnoreCase("real")) {
String enFileName = filenamecheck.substring(0, filenamecheck.lastIndexOf("."));
String enFileExt = filenamecheck.substring(filenamecheck.lastIndexOf("."));
//sun.misc.BASE64Encoder encoder = new sun.misc.BASE64Encoder();
//byte[] keyByte = enFileName.getBytes("utf-8");
//라이브러리 추가 요함 -> https://commons.apache.org/proper/commons-codec/download_codec.cgi
//imgLinkParams = java.net.URLEncoder.encode(urlFilePath + encoder.encode(keyByte).replaceAll("/", "==NamOSeSlaSH==") + enFileExt + "|" + imageUNameType);
byte[] encoded2 = Base64.encodeBase64(enFileName.getBytes());
enFileName = new String(encoded2, "ISO-8859-1");
imgLinkParams = URLEncoder.encode(urlFilePath + enFileName.replaceAll("/", "==NamOSeSlaSH==") + enFileExt + "|" + imageUNameType);
urlFilePath = imgLinkPathRename + imgLinkParams;
} else {
imgLinkParams = URLEncoder.encode(urlFilePath + filenamecheck + "|" + imageUNameType);
urlFilePath = imgLinkPathRename + imgLinkParams;
}
} else {
urlFilePath += filenamecheck;
imgLinkParams = urlFilePath;
}
*/
urlFilePath += filenamecheck;
imgLinkParams = urlFilePath;
if (imageOrgPath != null && !imageOrgPath.equalsIgnoreCase(""))
imageOrgPath += "|" + urlFilePath;
if (imageTitle == null)
imageTitle ="";
if (imageAlt == null)
imageAlt ="";
if (imageWidth == null)
imageWidth ="";
if (imageWidthUnit == null)
imageWidthUnit = "";
if (imageHeight == null)
imageHeight ="";
if (imageHeightUnit == null)
imageHeightUnit = "";
/*
* 2013.03.28 [3.0] mwHong
*
* imageMarginSet
*
*/
if (imageMarginLeft == null)
imageMarginLeft ="";
if (imageMarginLeftUnit == null)
imageMarginLeftUnit = "";
if (imageMarginRight == null)
imageMarginRight ="";
if (imageMarginRightUnit == null)
imageMarginRightUnit = "";
if (imageMarginTop == null)
imageMarginTop ="";
if (imageMarginTopUnit == null)
imageMarginTopUnit = "";
if (imageMarginBottom == null)
imageMarginBottom ="";
if (imageMarginBottomUnit == null)
imageMarginBottomUnit = "";
if (imageAlign == null)
imageAlign ="";
if (imageId == null)
imageId ="";
if (imageClass == null)
imageClass = "";
if (imageBorder == null)
imageBorder ="";
if (imageOrgPath == null)
imageOrgPath ="";
if (editorFrame == null)
editorFrame ="";
if (imageSize == null)
imageSize ="";
returnParam = "{";
//returnParam += "\"imageURL\":\"" + urlFilePath.replaceAll("'", "\\\\\"") + "\",";
returnParam += "\"imageURL\":\"" + urlFilePath + "\",";
returnParam += "\"imageTitle\":\"" + imageTitle + "\",";
returnParam += "\"imageAlt\":\"" + imageAlt + "\",";
returnParam += "\"imageWidth\":\"" + imageWidth + "\",";
returnParam += "\"imageWidthUnit\":\"" + imageWidthUnit + "\",";
returnParam += "\"imageHeight\":\"" + imageHeight + "\",";
returnParam += "\"imageHeightUnit\":\"" + imageHeightUnit + "\",";
returnParam += "\"imageSize\":\"" + imageSize + "\",";
/*
* 2013.03.28 [3.0] mwHong
*
* imageMarginSet
*
*/
returnParam += "\"imageMarginLeft\":\"" + imageMarginLeft + "\",";
returnParam += "\"imageMarginLeftUnit\":\"" + imageMarginLeftUnit + "\",";
returnParam += "\"imageMarginRight\":\"" + imageMarginRight + "\",";
returnParam += "\"imageMarginRightUnit\":\"" + imageMarginRightUnit + "\",";
returnParam += "\"imageMarginTop\":\"" + imageMarginTop + "\",";
returnParam += "\"imageMarginTopUnit\":\"" + imageMarginTopUnit + "\",";
returnParam += "\"imageMarginBottom\":\"" + imageMarginBottom + "\",";
returnParam += "\"imageMarginBottomUnit\":\"" + imageMarginBottomUnit + "\",";
returnParam += "\"imageAlign\":\"" + imageAlign + "\",";
returnParam += "\"imageId\":\"" + imageId + "\",";
returnParam += "\"imageClass\":\"" + imageClass + "\",";
returnParam += "\"imageBorder\":\"" + imageBorder + "\",";
returnParam += "\"imageKind\":\"" + imageKind + "\",";
returnParam += "\"imageOrgPath\":\"" + imageOrgPath + "\",";
if(imageKind.equalsIgnoreCase("image")) {
/*
int oriWidth = 0;
int oriHeight = 0;
try {
//2012.06.05 [2.0.4.16->2.0.4.17] nkpark heap memory
Image img = new ImageIcon(imagePhysicalPathsubFolder + tempFileName).getImage();
oriWidth = img.getWidth(null);
oriHeight = img.getHeight(null);
} catch(Exception e) {
//System.out.println("An internal exception occured!");
messageText = "get ImageSize fail";
}
*/
returnParam += "\"imageOrgWidth\":\"" + oriWidthCheck + "\",";
returnParam += "\"imageOrgHeight\":\"" + oriHeightCheck + "\",";
}
if (imageModify.equalsIgnoreCase("true"))
returnParam += "\"imageModify\":\"true\",";
returnParam += "\"editorFrame\":\"" + editorFrame + "\"";
returnParam += "}";
String moveFilePath = imagePhysicalPath + File.separator + filenamecheck;
int check = fileCopy(imagePhysicalPathsubFolder + tempFileName, moveFilePath);
if(DeleteTempFolder != null){
boolean returnRes = tempFileDelete(DeleteTempFolder);
if(returnRes == false){
messageText = "delete fail";
}
}
if (check == 1) {
//2018-11-20[4.2.0.12]vaccine로직 주석(수정된 빌드로 나갈 때 추가)
/*
if (strVaccinePath.length() <= 0) {
strVaccinePath = imagePhysicalPath + "/../../../vse";
}
String strName = checkVirusFile (moveFilePath, imagePhysicalPath + File.separator, strVaccinePath);
*/
if(uploadFileSubDir.equalsIgnoreCase("false") && !imageUPath.equalsIgnoreCase("")){
boolean returnRes = tempFolderDelete(tempFileFolder);
if(returnRes == false){
messageText = "delete fail";
}
}
if (SaveSubFolder.exists()){
boolean returnRes = SaveSubFolder.delete();
if(returnRes == false){
messageText = "delete fail";
}
}
//2018-11-20[4.2.0.12]vaccine로직 주석(수정된 빌드로 나갈 때 추가)
/*
if (strName.length() > 0) {
String msg = "found virus (";
msg += strName + ")";
scriptValue = executeScript(response, "virus", msg, useExternalServer, imageDomain, imageEditorFlag, "false");
if(scriptValue != null){
response.getWriter().println(scriptValue);
}
return;
}
*/
if (imageEditorFlag.equalsIgnoreCase("flashPhoto")) {
scriptValue = "{";
scriptValue += "\"result\":\"success\",";
scriptValue += "\"imageURL\":\"" + urlFilePath + "\",";
scriptValue += "\"addmsg\":" + returnParam;
scriptValue += "}";
} else{
scriptValue = executeScript(response, "success", returnParam, useExternalServer, imageDomain, imageEditorFlag, checkPlugin);
//response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
//response.setHeader("Access-Control-Max-Age", "3600");
//response.setHeader("Access-Control-Allow-Headers", "x-requested-with");
response.setHeader("Access-Control-Allow-Origin", "*");
}
if(scriptValue != null){
response.getWriter().println(scriptValue);
}
return;
} else {
if(uploadFileSubDir.equalsIgnoreCase("false") && !imageUPath.equalsIgnoreCase("")){
boolean returnRes = tempFolderDelete(tempFileFolder);
if(returnRes == false){
messageText = "delete fail";
}
}
scriptValue = executeScript(response, "fileCopyFail", "", useExternalServer, imageDomain, imageEditorFlag, checkPlugin);
if(scriptValue != null){
response.getWriter().println(scriptValue);
}
return;
}
}else{
response.getWriter().println("not encoding type multipart/form-data");
}
} catch (IOException ioe) {
scriptValue = executeScript(response, "invalid_size", Integer.toString(maxSize), useExternalServer, imageDomain, imageEditorFlag, checkPlugin);
if(scriptValue != null){
response.getWriter().println(scriptValue);
}
return;
} catch (org.apache.commons.fileupload.FileUploadBase.SizeLimitExceededException e) {
scriptValue = executeScript(response, "invalid_size", Integer.toString(maxSize), useExternalServer, imageDomain, imageEditorFlag, checkPlugin);
if(scriptValue != null){
response.getWriter().println(scriptValue);
}
return;
} catch (RuntimeException e) {
messageText += " RuntimeException";
messageText = "<System Error>" + messageText;
scriptValue = executeScript(response, "", messageText, useExternalServer, imageDomain, imageEditorFlag, checkPlugin);
if(scriptValue != null){
response.getWriter().println(scriptValue);
}
return;
}
%>

View File

@ -0,0 +1,182 @@
<%@ page pageEncoding="utf-8" %>
<%@page import="java.io.InputStreamReader"%>
<%@page import="java.io.InputStream"%>
<%@page import="java.io.BufferedReader"%>
<%@page import="java.net.URL"%>
<%@page import="java.net.HttpURLConnection"%>
<%@page import="java.net.URLConnection"%>
<%@page import="java.net.SocketTimeoutException"%>
<%@page import="java.io.PrintWriter"%>
<%@page import="java.io.StringWriter"%>
<%@page import="java.security.SecureRandom"%>
<%@page import="java.security.cert.X509Certificate"%>
<%@page import="javax.net.ssl.HttpsURLConnection"%>
<%@page import="javax.net.ssl.SSLContext"%>
<%@page import="javax.net.ssl.TrustManager"%>
<%@page import="javax.net.ssl.X509TrustManager"%>
<%!
public static String getPrintStackTrace(Exception e) {
StringWriter errors = new StringWriter();
e.printStackTrace(new PrintWriter(errors));
return errors.toString();
}
public void sslTrustAllCerts(){ TrustManager[] trustAllCerts = new TrustManager[] {
new X509TrustManager() {
public X509Certificate[] getAcceptedIssuers() {
return null;
}
public void checkClientTrusted(X509Certificate[] certs, String authType) { }
public void checkServerTrusted(X509Certificate[] certs, String authType) { } } };
SSLContext sc;
try {
sc = SSLContext.getInstance("SSL");
sc.init(null, trustAllCerts, new SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
} catch(Exception e){
e.printStackTrace();
}
}
public static URL getFinalURL(URL url) {
try {
HttpURLConnection con = (HttpURLConnection) url.openConnection();
//System.setProperty("java.net.useSystemProxies", "true");
System.setProperty("https.protocols", "TLSv1,TLSv1.1,TLSv1.2");
con.setRequestMethod("GET");
con.setRequestProperty("User-Agent","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36 Edg/96.0.1054.62");
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
con.setRequestProperty("Accept","text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
//con.addRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36 Edg/96.0.1054.62");
con.addRequestProperty("Accept-Language", "ko-KR,ko;q=0.8,en-US;q=0.6,en;q=0.4");
con.addRequestProperty("Referer", "https://www.google.com/");
con.addRequestProperty("Accept-Encoding","gzip, deflate, br");
con.setInstanceFollowRedirects(false);
con.setConnectTimeout(5000);
con.setReadTimeout(5000);
con.connect();
//Thread.sleep(1000);
// Header에서 Status Code를 뽑는다.
int resCode = con.getResponseCode();
System.out.println(resCode);
// http코드가 301(영구이동), 302(임시 이동), 303(기타 위치 보기) 이면 또다시 이 함수를 태운다. 재귀함수.
//if (resCode == HttpURLConnection.HTTP_SEE_OTHER || resCode == HttpURLConnection.HTTP_MOVED_PERM
// || resCode == HttpURLConnection.HTTP_MOVED_TEMP) {
if (resCode >= 300 && resCode <= 307 && resCode != 306 &&
resCode != HttpURLConnection.HTTP_NOT_MODIFIED)
{
String Location = con.getHeaderField("Location");
if (Location.startsWith("/")) {
Location = url.getProtocol() + "://" + url.getHost() + Location;
}
return getFinalURL(new URL(Location));
}
}catch(java.net.SocketTimeoutException e){ // time out exception check
System.out.println("getting page time out!!");
return null; // rediret url -> null
}
catch (Exception e) {
System.out.println(e.getMessage());
System.out.println(getPrintStackTrace(e));
}
return url;
}
%>
<%
try{
String url = request.getParameter("url");
//if(url.startsWith("http://") && url.indexOf("localhost") < 0) {
// url = url.replaceAll("http://", "https://");
//}
System.out.println("orgUrl :::::::::::" + url);
URLConnection con = new URL(url).openConnection();
URL redirectUrl = getFinalURL(con.getURL());
con.setConnectTimeout(5000);
con.setReadTimeout(5000);
System.out.println("rediRect Url :::::::::::" + redirectUrl);
String realUrl = "<redirectUrl>" + redirectUrl + "</redirectUrl>";
if(redirectUrl == null){
return ;
}
InputStream tempInputStream = redirectUrl.openStream();
InputStreamReader isr = new InputStreamReader(tempInputStream, "utf-8");
StringBuffer sb = new StringBuffer();
int curByte;
sb.append(realUrl);
while ((curByte = isr.read()) != -1) {
sb.append((char)curByte);
}
isr.close();
tempInputStream.close();
out.clearBuffer();
/*
StringBuilder sb = new StringBuilder();
String line;
InputStream in = redirectUrl.openStream();
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
while ((line = reader.readLine()) != null) {
sb.append(line).append(System.lineSeparator());
}
} finally {
in.close();
}
sb.append(realUrl);
*/
response.reset();
response.setContentType("text/plain; charset=utf-8");
//System.out.println(sb.toString().indexOf("<meta charset=\"euc-kr\">"));
if((sb.toString().indexOf("encoding=\"euc-kr\"") != -1 || sb.toString().indexOf("encoding=\"EUC-KR\"") != -1
|| sb.toString().indexOf("charset=\"euc-kr\"") != -1 || sb.toString().indexOf("charset=\"EUC-KR\"") != -1
|| sb.toString().indexOf("charset=euc-kr") != -1 || sb.toString().indexOf("charset=EUC-KR") != -1)
&& sb.toString().indexOf("charset=utf-8") == -1
){
InputStream tempInputStream2 = redirectUrl.openStream();
InputStreamReader isr2 = new InputStreamReader(tempInputStream2, "euc-kr");
String realUrl2 = "<redirectUrl>" + redirectUrl + "</redirectUrl>";
StringBuffer sb2 = new StringBuffer();
sb2.append(realUrl2);
int curByte2;
while ((curByte2 = isr2.read()) != -1) {
sb2.append((char)curByte2);
}
isr2.close();
tempInputStream2.close();
out.clearBuffer();
response.reset();
response.setContentType("text/plain; charset=euc-kr");
out.print(sb2.toString());
}else{
out.print(sb.toString());
}
}
catch(Exception e){
System.out.println("page error");
System.out.println(getPrintStackTrace(e));
}
%>

View File

@ -0,0 +1,29 @@
<% request.setCharacterEncoding("utf-8"); %>
<%@ page import="java.net.*" contentType="text/html; charset=utf-8" isErrorPage="true" %>
<%@ page import="java.io.*"%>
<%
if (request.getParameter("save_string") != null && !"".equals(request.getParameter("save_string"))){
response.setContentType("text/html");
response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filename=untitled.html");
/* OutputStream outs = response.getOutputStream();
outs.write( new byte[]{(byte)0xEF, (byte)0xBB, (byte)0xBF} );
outs.write(request.getParameter("save_string").getBytes());
outs.flush();
outs.close(); */
String sHTML = request.getParameter("save_string");
String decodeSHTML = java.net.URLDecoder.decode(sHTML, "utf-8");
// String decodeSHTML = java.net.URLDecoder.decode(sHTML);
out.println(decodeSHTML);
return;
}else{
return;
}
%>

View File

@ -0,0 +1,208 @@
<%@ page pageEncoding = "utf-8" %>
<%@page import="java.util.regex.PatternSyntaxException"%>
<%!
// @utf-8 SecurityUtil.jsp
/*
* SecurityUtil: CrossEditor Web Attack Defender
* Author : djlee <djlee@namo.co.kr>
* Last modified Sep 13 2012
* History:
* Sep 14 2012 - KISA XSS
*/
/* XSS s:String */
public boolean detectXSS(String s) {
java.util.Vector listXSS = new java.util.Vector();
listXSS.add("PHNjcmlwdA==");
listXSS.add("JTNzY3JpcHQ=");
listXSS.add("XHgzc2NyaXB0");
listXSS.add("amF2YXNjcmlwdDo=");
listXSS.add("JTAw");
listXSS.add("ZXhwcmVzc2lvbiAqXCgqXCk=");
listXSS.add("eHNzOipcKCpcKQ==");
listXSS.add("ZG9jdW1lbnQuY29va2ll");
listXSS.add("ZG9jdW1lbnQubG9jYXRpb24=");
listXSS.add("ZG9jdW1lbnQud3JpdGU=");
listXSS.add("b25BYm9ydCAqPQ==");
listXSS.add("b25CbHVyICo9");
listXSS.add("b25DaGFuZ2UgKj0=");
listXSS.add("b25DbGljayAqPQ==");
listXSS.add("b25EYmxDbGljayAqPQ==");
listXSS.add("b25EcmFnRHJvcCAqPQ==");
listXSS.add("b25FcnJvciAqPQ==");
listXSS.add("b25Gb2N1cyAqPQ==");
listXSS.add("b25LZXlEb3duICo9");
listXSS.add("b25LZXlQcmVzcyAqPQ==");
listXSS.add("b25LZXlVcCAqPQ==");
listXSS.add("b25sb2FkICo9");
listXSS.add("b25tb3VzZWRvd24gKj0=");
listXSS.add("b25tb3VzZW1vdmUgKj0=");
listXSS.add("b25tb3VzZW91dCAqPQ==");
listXSS.add("b25tb3VzZW92ZXIgKj0=");
listXSS.add("b25tb3VzZXVwICo9");
listXSS.add("b25tb3ZlICo9");
listXSS.add("b25yZXNldCAqPQ==");
listXSS.add("b25yZXNpemUgKj0=");
listXSS.add("b25zZWxlY3QgKj0=");
listXSS.add("b25zdWJtaXQgKj0=");
listXSS.add("b251bmxvYWQgKj0=");
listXSS.add("bG9jYXRpb24uaHJlZiAqPQ==");
boolean bStatus = false;
java.util.Enumeration e = listXSS.elements();
try{
while (e.hasMoreElements()) {
String r = (String)e.nextElement();
r = new String(getBase64Decode(r), "ISO-8859-1");
if (r.length() == 0)
continue;
// r:Roll, s:String
if (compareRegex(r, s)) {
bStatus = true;
}
}
}catch(UnsupportedEncodingException ex){
bStatus = true;
}
return bStatus;
}
public String detectXSSEx(String s) {
if(s != null){
s = s.replaceAll("<", "&lt;");
s = s.replaceAll(">", "&gt;");
s = s.replaceAll("&", "&amp;");
s = s.replaceAll("\"", "&quot;");
s = s.replaceAll("\r", "");
s = s.replaceAll("\n", "");
s = s.replaceAll("\'","&#39;");
s = s.replaceAll("%00","null;");
//s = s.replaceAll("%","&#37;");
}else{
s = "";
}
if (detectXSS(s)) {
return "";
}
return s;
}
public String detectXSSEx2(String s) {
if (detectXSS(s)) {
return "";
}
return s;
}
// Base64Decode
public static byte[] getBase64Decode(String base64) {
int pad = 0;
for (int i = base64.length() - 1; base64.charAt(i) == '='; i--){
pad++;
}
int length = base64.length() * 6 / 8 - pad;
byte[] raw = new byte[length];
int rawIndex = 0;
for (int i = 0; i < base64.length(); i += 4) {
int block =
(getValue(base64.charAt(i)) << 18)
+ (getValue(base64.charAt(i + 1)) << 12)
+ (getValue(base64.charAt(i + 2)) << 6)
+ (getValue(base64.charAt(i + 3)));
for (int j = 0; j < 3 && rawIndex + j < raw.length; j++){
raw[rawIndex + j] = (byte) ((block >> (8 * (2 - j))) & 0xff);
}
rawIndex += 3;
}
return raw;
}
// compare
public boolean compareRegex(String r, String s) {
boolean found = false;
try {
if(r == null || s == null) {
return false;
}
java.util.regex.Pattern p = java.util.regex.Pattern.compile(r, java.util.regex.Pattern.UNICODE_CASE | java.util.regex.Pattern.CASE_INSENSITIVE);
java.util.regex.Matcher m = p.matcher(s);
while (m.find())
found = true;
}catch(PatternSyntaxException ex) {
return false;
}catch(Exception e){
return false;
}
try {
String ns = new String(s.getBytes("utf-8"), "eucKR");
java.util.regex.Pattern p = java.util.regex.Pattern.compile(r, java.util.regex.Pattern.UNICODE_CASE | java.util.regex.Pattern.CASE_INSENSITIVE);
java.util.regex.Matcher m = p.matcher(ns);
while (m.find())
found = true;
}catch(PatternSyntaxException ex) {
return false;
}catch(Exception e){
return false;
}
return found;
}
// getValue
protected static int getValue(char c) {
if (c >= 'A' && c <= 'Z')
return c - 'A';
if (c >= 'a' && c <= 'z')
return c - 'a' + 26;
if (c >= '0' && c <= '9')
return c - '0' + 52;
if (c == '+')
return 62;
if (c == '/')
return 63;
if (c == '=')
return 0;
return -1;
}
%>
<%
/**
*
* detectXSS("<script",listXSS)
*
*
* if (detectXSS(defaultUPath) || detectXSS(defaultUPath)) { }
**/
// out.println(detectXSS("<script"));
%>

View File

@ -0,0 +1,5 @@
<%
uploadFileExtBlockList = "";
%>

View File

@ -0,0 +1,902 @@
<%@page import="java.util.*"%>
<%@page import="java.io.*"%>
<%@page import="java.net.*"%>
<%@page import ="javax.xml.parsers.DocumentBuilder"%>
<%@page import ="javax.xml.parsers.ParserConfigurationException"%>
<%@page import ="javax.xml.parsers.DocumentBuilderFactory"%>
<%@page import ="org.xml.sax.SAXException"%>
<%@page import ="org.w3c.dom.Document"%>
<%@page import ="org.w3c.dom.Element"%>
<%@page import ="org.w3c.dom.Node"%>
<%@page import ="org.w3c.dom.NodeList"%>
<%@page import ="org.xml.sax.SAXParseException"%>
<%@page import="java.security.SecureRandom"%>
<%@page import ="org.apache.commons.codec.binary.Base64"%>
<%!
public boolean isImageValid(String typeCheck,String fileCheck )
{
String appExtensions ="";
boolean value = false;
typeCheck = typeCheck.toUpperCase();
fileCheck = fileCheck.toUpperCase();
if(typeCheck.equalsIgnoreCase("FLASH"))
{
appExtensions = "SWF,WMV,AVI,MP4,OGG,WEBM";
}
else if(typeCheck.equalsIgnoreCase("FILE"))
{
appExtensions = "ZIP,DOC,DOCX,XLS,XLSX,TXT,PDF";
}
else
{
appExtensions = "GIF,JPEG,JPG,PNG,BMP";
}
String app[] = appExtensions.split(",");
for(int i=0;i<app.length;i++)
{
if(app[i].equalsIgnoreCase(fileCheck)){value = true;}
}
return value;
}
public String getImageKind(String typeCheck)
{
typeCheck = typeCheck.toUpperCase();
if(typeCheck.equalsIgnoreCase("FLASH"))
{
return "swf, wmv, avi, mp4, ogg, webm";
}
else if(typeCheck.equalsIgnoreCase("FILE"))
{
return "zip, doc, docx, xls, xlsx, txt, pdf";
}
else
{
return "gif, jpeg, jpg, png, bmp";
}
}
public boolean isArray(String appExtensions, String fileCheck)
{
String app[] = appExtensions.split(",");
boolean value = false;
for (int i=0;i<app.length;i++) {
if(app[i].equalsIgnoreCase(fileCheck)){value = true;}
}
return value;
}
public String getChildDirectory(String path, String maxCount)
{
if(maxCount.equalsIgnoreCase("")){maxCount = "100";}
boolean childFlag = false;
int childNum = 0;
String childName = "";
int fileInt = 0;
File dir = new File(path);
if(!dir.exists()){return childName = "";}
int listLength = 0;
if (dir != null && dir.list() != null) {
listLength = dir.list().length;
}
for(int i=0;i<listLength;i++)
{
File tmpFile = new File(path + File.separator + dir.list()[i]);
try{
if(tmpFile.isDirectory())
{
fileInt = Integer.parseInt(tmpFile.getName());
childFlag = true;
if(fileInt > childNum)
{
childNum = fileInt;
childName = tmpFile.getName();
}
}
}
catch(NumberFormatException e)
{
continue;
}
}
if(!childFlag)
{
childNum++;
childName = "000000" + Integer.toString(childNum);
childName = childName.substring(childName.length() - 6);
File dirNew = new File(path+File.separator+childName);
if(!dirNew.exists()){
dirNew.setExecutable(false, true);
dirNew.setReadable(true);
dirNew.setWritable(false, true);
boolean returnRes = dirNew.mkdir();
if(returnRes == false){
return "";
}
}
}
String childPath = path + File.separator + childName;
File dir3 = new File(childPath);
int cCount = 0;
if (dir3 != null && dir3.list() != null) {
listLength = dir3.list().length;
}
for(int i=0;i<listLength;i++)
{
File tmpFiles = new File(childPath+File.separator+dir3.list()[i]);
if(tmpFiles.isFile())
{
cCount++;
}
}
if(cCount >= Integer.parseInt(maxCount))
{
childNum++;
if(Integer.toString(childNum).length() > 6){
childName = Integer.toString(childNum);
}else{
childName = "000000" + Integer.toString(childNum);
childName = childName.substring(childName.length() - 6);
}
File dir4 = new File(path+File.separator+childName);
if(!dir4.exists()){
dir4.setExecutable(false, true);
dir4.setReadable(true);
dir4.setWritable(false, true);
boolean returnRes = dir4.mkdir();
if(returnRes == false){
return "";
}
}
}
return childName;
}
public String checkFileUniqueName(String realFileName, String image_physical_path ,String fileCheck)
{
String strFileName = realFileName + "." + fileCheck;
boolean due_check = true;
String strFileWholePath = image_physical_path + File.separator + strFileName;
int due_File_Count = 0;
while(due_check)
{
if(new File(strFileWholePath).exists())
{
due_File_Count += 1;
strFileName = realFileName + "_" + due_File_Count + "." + fileCheck;
strFileWholePath = image_physical_path + File.separator + strFileName;
}
else
{
due_check = false;
}
}
return strFileName;
}
public synchronized int fileCopy(String path, String savePath)
{
int check = 0;
FileInputStream inputStream = null;
FileOutputStream outputStream = null;
BufferedInputStream bin = null;
BufferedOutputStream bout = null;
try{
if(path != null){
inputStream = new FileInputStream(path);
}else{
return check;
}
if(savePath != null){
outputStream = new FileOutputStream(savePath);
}else{
return check;
}
bin = new BufferedInputStream(inputStream);
bout = new BufferedOutputStream(outputStream);
int bytesRead = 0;
byte[] buffer = new byte[1024];
while ((bytesRead = bin.read(buffer, 0, 1024)) != -1) {
bout.write(buffer, 0, bytesRead);
}
check = 1;
}
catch(IOException ioe)
{
check = 0;
}
finally
{
try
{
if(bout != null){
bout.close();
}
if(bin != null){
bin.close();
}
if(outputStream != null){
outputStream.close();
}
if(inputStream != null){
inputStream.close();
}
}
catch(IOException e)
{
check = 0;
//System.out.println("1:An internal exception occured!");
}
}
return check;
}
public String getEditorAuth(String filename, String conn, String conval)
{
String result = "false";
String str = "";
HttpURLConnection con = null;
InputStreamReader reader = null;
BufferedReader br = null;
try
{
URL url = new URL(filename);
con = (HttpURLConnection)url.openConnection();
reader = new InputStreamReader(con.getInputStream());
br = new BufferedReader(reader);
char[] buffer = new char[1024];
// String data = "";
// while((data=br.readLine()) != null ){
// str += data;
// }
int returnRes = br.read(buffer,0,1024);
// for (char c : buffer)
// {
// if(c != (char)0)
// {
// str += c;
// }
// }
// }
if(returnRes > 0){
for (int i=0; buffer.length>i; i++)
{
if(buffer[i] != (char)0)
{
str += buffer[i];
}
}
}
if (str.equalsIgnoreCase("valid")){
result = "true";
}else if (str.equalsIgnoreCase("expire_invalid")){
result = "expire";
}else{
result = "false";
}
}
catch(IOException e)
{
result = "false";
//System.out.println("2:An internal exception occured!");
}
finally
{
try
{
if(br != null){
br.close();
}
if(reader != null){
reader.close();
}
if(con != null){
con.disconnect();
}
}
catch(IOException e)
{
result = "false";
//System.out.println("3:An internal exception occured!");
}
}
return result;
}
public String createEncodeEditorKey(String genkey)
{
//sun.misc.BASE64Encoder encoder = new sun.misc.BASE64Encoder();
//byte[] keyByte = genkey.getBytes();
//String base64_encodeText = encoder.encode(keyByte);
//라이브러리 추가 요함 -> https://commons.apache.org/proper/commons-codec/download_codec.cgi
try{
byte[] encoded = Base64.encodeBase64(genkey.getBytes());
String base64_encodeText = new String(encoded, "ISO-8859-1");
int str_length = base64_encodeText.length();
String strLeft = base64_encodeText.substring(0,str_length/2);
String strRight = base64_encodeText.substring(str_length/2,str_length);
int strLeft_length = strLeft.length();
String strLeftSubLeft = strLeft.substring(0,strLeft_length/2);
String strLeftSubRight = strLeft.substring(strLeft_length/2,strLeft_length);
int strRight_length = strRight.length();
String strRightSubLeft = strRight.substring(0,strRight_length/2);
String strRightSubRight = strRight.substring(strRight_length/2,strRight_length);
genkey = strLeftSubLeft + strRightSubLeft + strRightSubRight + strLeftSubRight;
}catch(UnsupportedEncodingException e){
genkey = "EncodingException";
}
return genkey;
}
public long getDateDiff(String targetDate)
{
long dateDiff = 1;
//try{
Calendar gCal = Calendar.getInstance();
gCal.setTime(new Date());
int cur_year = gCal.get(Calendar.YEAR);
int cur_month = gCal.get(Calendar.MONTH)+1;
int cur_day = gCal.get(Calendar.DATE);
String[] exp_arr = targetDate.split("-");
int target_year = Integer.parseInt(exp_arr[0]);
int target_month = Integer.parseInt(exp_arr[1]);
int target_day = Integer.parseInt(exp_arr[2]);
Calendar ca1 = Calendar.getInstance();
Calendar ca2 = Calendar.getInstance();
ca1.set(target_year, target_month, target_day);
ca2.set(cur_year, cur_month, cur_day);
long milisecond1 = ca1.getTimeInMillis();
long milisecond2 = ca2.getTimeInMillis();
long diffInMSec = milisecond2 - milisecond1;
dateDiff = diffInMSec / (24 * 60 * 60 * 1000);
//}catch(Exception e){
//System.out.println("4:An internal exception occured!");
// dateDiff = -1;
//}
return dateDiff;
}
public String executeFileScript(HttpServletResponse response, String result, String addmsg, String useExternalServer, String userDomain, String image_editor_flag, String checkPlugin)
{
String param = "";
String result_sc = "";
userDomain = userDomain.trim();
if (!userDomain.equalsIgnoreCase(""))
userDomain = "document.domain=\"" + userDomain + "\";";
else
userDomain = "";
if (image_editor_flag.equalsIgnoreCase("flashPhoto")) {
param = "{";
param += "\"result\":\"" + result + "\",";
param += "\"imageURL\":\"\",";
param += "\"addmsg\":\"" + addmsg + "\"";
param += "}";
result_sc = param;
} else {
if(checkPlugin.equalsIgnoreCase("false")) {
// 20141118 image drag&drop event
if (addmsg != null) {
param = "{";
param += "\"result\":\"" + result + "\",";
if (result.equalsIgnoreCase("virus") || "UploadFileExtBlock".equalsIgnoreCase(result)) {
param += "\"addmsg\":\"" + addmsg + "\"";
} else {
if(result.equalsIgnoreCase("success")){
// [4.0.0.22] json.parse 오류 수정
param += "\"addmsg\":[" + addmsg + "]";
}else{
// [4.0.0.22] json.parse 오류 수정
param += "\"addmsg\":\"[" + addmsg + "]\"";
}
}
param += "}";
} else {
param = "{";
param += "\"result\":\"" + result + "\"";
param += "}";
}
} else {
if (addmsg != null)
param = "'" + result + "','" + addmsg + "'";
else
param = "'" + result + "'";
}
//2018-11-20[4.2.0.12]보안취약점 불필요한 코드 주석
result_sc = param;
/*
if (checkPlugin.equalsIgnoreCase("false")) {
// 20141118 image drag&drop event
result_sc = param;
} else if (!useExternalServer.equalsIgnoreCase("")) {
try {
result_sc = "?userdomain=" + URLEncoder.encode(userDomain, "utf-8");
result_sc += "&funcname=" + URLEncoder.encode("setInsertFile", "utf-8");
result_sc += "&param=" + URLEncoder.encode(param, "utf-8");
response.sendRedirect(useExternalServer + result_sc);
return "";
} catch (IOException e) {
//System.out.println("5:An internal exception occured!");
}
} else {
result_sc = "<script language='javascript' type='text/javascript'>";
result_sc += userDomain;
result_sc += " parent.window.setInsertFile(" + param + ");</script>";
}
*/
result_sc = param;
}
return result_sc;
}
public String executeScript(HttpServletResponse response, String result, String addmsg, String useExternalServer, String userDomain, String image_editor_flag, String checkPlugin)
{
String param = "";
String result_sc = "";
userDomain = userDomain.trim();
if (!userDomain.equalsIgnoreCase(""))
userDomain = "document.domain=\"" + userDomain + "\";";
else
userDomain = "";
if (image_editor_flag.equalsIgnoreCase("flashPhoto")) {
param = "{";
param += "\"result\":\"" + result + "\",";
param += "\"imageURL\":\"\",";
param += "\"addmsg\":\"" + addmsg + "\"";
param += "}";
result_sc = param;
} else {
if(checkPlugin.equalsIgnoreCase("false")) {
// 20141118 image drag&drop event
if (addmsg != null) {
param = "{";
param += "\"result\":\"" + result + "\",";
if (result.equalsIgnoreCase("virus")) {
param += "\"addmsg\":\"" + addmsg + "\"";
} else {
if(result.equalsIgnoreCase("success")){
param += "\"addmsg\":[" + addmsg + "]";
}else{
param += "\"addmsg\":\"[" + addmsg + "]\"";
}
}
param += "}";
} else {
param = "{";
param += "\"result\":\"" + result + "\"";
param += "}";
}
} else {
if (addmsg != null)
param = "'" + result + "','" + addmsg + "'";
else
param = "'" + result + "'";
}
//2018-11-20[4.2.0.12]보안취약점 불필요한 코드 주석
result_sc = param;
/*
if (checkPlugin.equalsIgnoreCase("false")) {
// 20141118 image drag&drop event
result_sc = param;
} else if(!useExternalServer.equalsIgnoreCase("")) {
try {
result_sc = "?userdomain=" + URLEncoder.encode(userDomain, "utf-8");
result_sc += "&funcname=" + URLEncoder.encode("setInsertImageFile", "utf-8");
result_sc += "&param=" + URLEncoder.encode(param, "utf-8");
response.setHeader("Access-Control-Allow-Origin", "*");
response.sendRedirect(useExternalServer + result_sc);
return "";
} catch (IOException e) {
//System.out.println("6:An internal exception occured!");
}
} else {
result_sc = "<script language='javascript' type='text/javascript'>";
result_sc += userDomain;
result_sc += " parent.window.setInsertImageFile(" + param + ");</script>";
}
*/
}
return result_sc;
}
public String dompaser(String image_temp)
{
String imageUrl = image_temp;
String oContextPath = "";
String oDocPath = "";
String oPhygicalPath = "";
String pathValue = "";
try {
if (System.getProperty("catalina.home") != null){
String filenames=System.getProperty("catalina.home") + "/conf/server.xml";
File severXml = new File(filenames);
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
//2016-06-07 보안취약성처리
/*
dbf.setValidating(true);
dbf.setFeature("http://javax.xml.XMLConstants/feature/secure-processing",true);
dbf.setFeature("http://xml.org/sax/features/external-general-entities",false);
dbf.setFeature("http://xml.org/sax/features/external-parameter-entities",false);
dbf.setFeature("http://xml.org/sax/features/validation", true);
*/
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(severXml);
NodeList nodeLst = doc.getElementsByTagName("Context");
for(int i = 0; i<nodeLst.getLength(); i++)
{
pathValue = ((Element)nodeLst.item(i)).getAttribute("path");
//try{
if (pathValue.equalsIgnoreCase(imageUrl.substring(0,pathValue.length())))
{
if(pathValue.length() > oContextPath.length())
{
oContextPath = pathValue;
oDocPath = ((Element)nodeLst.item(i)).getAttribute("docBase");
if(pathValue.lastIndexOf("/") == pathValue.length()-1)
{
pathValue = pathValue.substring(0,pathValue.lastIndexOf("/"));
}
oPhygicalPath = oDocPath;
String pathArr[] = imageUrl.substring(pathValue.length()).split("/");
for (int t = 0; t < pathArr.length; t++){
if (!pathArr[t].equalsIgnoreCase("")){
oPhygicalPath += File.separator + pathArr[t];
}
}
}
}
//} catch(Exception e2) {
// oPhygicalPath = "";
//continue;
//System.out.println("7:An internal exception occured!");
//}
}
}
} catch (ParserConfigurationException e) {
oPhygicalPath = "";
//System.out.println("8:An internal exception occured!");
}catch (IOException e) {
oPhygicalPath = "";
//System.out.println("9:An internal exception occured!");
}catch (SAXException e) {
oPhygicalPath = "";
//System.out.println("10:An internal exception occured!");
}
return oPhygicalPath;
}
public String mediaMimeType(String fileExt) {
String returnValue = "";
String defaultType = "noContents";
String flashType = "application/x-shockwave-flash";
String quicktimeType = "video/quicktime";
String asfType = "video/x-ms-asf";
String mpegType = "audio/mpeg";
String midType = "audio/x-midi";
String rmType = "application/vnd.rn-realmedia";
String wavType = "audio/x-wav";
String dcrType = "application/x-director";
String flvType = "video/x-flv";
String wmvType = "video/x-ms-wmv";
String aviType = "video/x-msvideo";
String mp4Type = "video/mp4";
String oggType = "video/ogg";
String webmType = "video/webm";
fileExt = fileExt.toUpperCase();
if (fileExt.equalsIgnoreCase("MOV")) {
returnValue = quicktimeType;
}
else if (fileExt.equalsIgnoreCase("WAV")) {
returnValue = wavType;
}
else if (fileExt.equalsIgnoreCase("SWF")) {
returnValue = flashType;
}
else if (fileExt.equalsIgnoreCase("FLV")) {
returnValue = flvType;
}
else if (fileExt.equalsIgnoreCase("DCR")) {
returnValue = dcrType;
}
else if (fileExt.equalsIgnoreCase("ASF")) {
returnValue = asfType;
}
else if (fileExt.equalsIgnoreCase("ASX")) {
returnValue = asfType;
}
else if (fileExt.equalsIgnoreCase("MP2")) {
returnValue = mpegType ;
}
else if (fileExt.equalsIgnoreCase("MP3")) {
returnValue = mpegType ;
}
else if (fileExt.equalsIgnoreCase("MPGA")) {
returnValue = mpegType;
}
else if (fileExt.equalsIgnoreCase("MID")) {
returnValue = midType;
}
else if (fileExt.equalsIgnoreCase("MIDI")) {
returnValue = midType;
}
else if (fileExt.equalsIgnoreCase("RM")) {
returnValue = rmType;
}
else if (fileExt.equalsIgnoreCase("RAM")) {
returnValue = rmType;
}
else if (fileExt.equalsIgnoreCase("WMV")) {
returnValue = wmvType;
}
else if (fileExt.equalsIgnoreCase("AVI")) {
returnValue = aviType;
}
else if (fileExt.equalsIgnoreCase("MP4")) {
returnValue = mp4Type;
}
else if (fileExt.equalsIgnoreCase("OGG")) {
returnValue = oggType;
}
else if (fileExt.equalsIgnoreCase("WEBM")) {
returnValue = webmType;
}
else {
returnValue = defaultType;
}
return returnValue;
}
public String rootFolderPath1(String urlPath)
{
String fileRealFolder = "";
fileRealFolder = urlPath.substring(0, urlPath.lastIndexOf("/") + 1);
return fileRealFolder;
}
public String xmlUrl1(String urlPPath)
{
return urlPPath + File.separator + "config" + File.separator + "xmls" + File.separator + "Config.xml";
}
public Hashtable childValueList1(Element root)
{
Hashtable settingValue = new Hashtable();
List addMenuList = new ArrayList();
NodeList nodeList = root.getChildNodes();
Node node;
Node cNode;
NodeList childNodes;
settingValue.put("AddMenuCheck", "false");
/*
try{
*/
for(int i=0; i<nodeList.getLength(); i++){
node = nodeList.item(i);
if(node.getNodeType() == Node.ELEMENT_NODE){
childNodes = node.getChildNodes();
for(int j=0; j<childNodes.getLength();j++){
cNode = childNodes.item(j);
if(cNode.getNodeType() == Node.ELEMENT_NODE){
if(cNode.getNodeName().equalsIgnoreCase("AddMenu")) settingValue.put("AddMenuCheck", "true");
if(cNode.getFirstChild() != null){
if(cNode.getNodeName().equalsIgnoreCase("AddMenu")){
addMenuList.add(cNode.getFirstChild().getNodeValue());
settingValue.put(cNode.getNodeName(),addMenuList);
}
else {
settingValue.put(cNode.getNodeName(),cNode.getFirstChild().getNodeValue());
}
}
else{
if(cNode.getNodeName().equalsIgnoreCase("AddMenu")){
addMenuList.add("");
settingValue.put(cNode.getNodeName(),addMenuList);
}else{
settingValue.put(cNode.getNodeName(),"");
}
}
}
}
}
}
return settingValue;
/*
} catch (Exception pce) {
System.out.println("internal exception occured!");
return settingValue;
}
*/
}
// filename is Time
public String fileNameTimeSetting()
{
String fileNameTime = "";
Calendar oCalendar = Calendar.getInstance();
StringBuffer buffer = new StringBuffer();
SecureRandom random = new SecureRandom();
String randomValue = "";
String chars[] = "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,0,1,2,3,4,5,6,7,8,9".split(",");
int count = 8;
for(int i=0; i<count; i++) {
// buffer.append(chars[random.nextInt(chars.length)]);
// buffer.append(chars[random.nextInt(getRandomSeed("randomfilename", path))]);
int ranVal = random.nextInt();
if(ranVal < 0){
ranVal = (ranVal * -1);
}
ranVal = (ranVal % chars.length);
buffer.append(chars[ranVal]);
}
randomValue = buffer.toString();
// YYYYMMDDhhmmssxxx_rendom(int+Char)
String oYear = Integer.toString(oCalendar.get(Calendar.YEAR));
String oMonth = "0" + Integer.toString(oCalendar.get(Calendar.MONTH) + 1);
String oDay = "0" + Integer.toString(oCalendar.get(Calendar.DAY_OF_MONTH));
String oHour = "0" + Integer.toString(oCalendar.get(Calendar.HOUR_OF_DAY));
String oMin = "0" + Integer.toString(oCalendar.get(Calendar.MINUTE));
String oSec = "0" + Integer.toString(oCalendar.get(Calendar.SECOND));
String oMillSec = Integer.toString(oCalendar.get(Calendar.MILLISECOND)) + "00";
oMonth = oMonth.substring(oMonth.length() - 2);
oDay = oDay.substring(oDay.length() - 2);
oHour = oHour.substring(oHour.length() - 2);
oMin = oMin.substring(oMin.length() - 2);
oSec = oSec.substring(oSec.length() - 2);
oMillSec = oMillSec.substring(0,3);
fileNameTime = oYear + oMonth + oDay + oHour + oMin + oSec + oMillSec + "_" + randomValue;
return fileNameTime;
}
public String tempFolderCreate(String path)
{
StringBuffer buffer = new StringBuffer();
SecureRandom random = new SecureRandom();
String chars[] = "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z".split(",");
String randomValue = "";
int count = 10;
for(int i=0; i<count; i++) {
// buffer.append(chars[random.nextInt(chars.length)]);
// buffer.append(chars[random.nextInt(getRandomSeed("randomfoldername", cpath))]);
int ranVal = random.nextInt();
if(ranVal < 0){
ranVal = (ranVal * -1);
}
ranVal = (ranVal % chars.length);
buffer.append(chars[ranVal]);
}
randomValue = buffer.toString();
path = path + randomValue + File.separator;
File tempSubFolder = new File(path);
if(!tempSubFolder.exists()){
tempSubFolder.setExecutable(false, true);
tempSubFolder.setReadable(true);
tempSubFolder.setWritable(false, true);
boolean returnRes = tempSubFolder.mkdir();
if(returnRes == false){
return "";
}
}
return path;
}
public synchronized boolean tempFolderDelete(String path)
{
boolean returnRes = true;
//synchronized(this){
File tempFolder = new File(path);
if(tempFolder.exists()){
returnRes = tempFolder.delete();
}
//}
return returnRes;
}
public synchronized boolean tempFileDelete(File tempFile)
{
boolean returnRes = true;
if(tempFile.exists()){
returnRes = tempFile.delete();
}
return returnRes;
}
public static String toString ( String s ) {
if ( s == null ) return "";
return s;
}
%>

View File

@ -0,0 +1,80 @@
<%@page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@page import="java.io.IOException"%>
<%@page import="java.io.InputStream"%>
<%@page import="java.io.OutputStream"%>
<%@page import="java.io.OutputStreamWriter"%>
<%@page import="java.io.Writer"%>
<%@page import="java.net.URL"%>
<%@page import="java.net.URLConnection"%>
<%@page import="java.util.regex.Pattern"%>
<%@page import="com.google.common.io.BaseEncoding"%>
<%@page import="com.google.common.io.ByteStreams"%>
<%@page import="com.google.gson.Gson"%>
<%!
static final long serialVersionUID = -3408677365195660129L;
%>
<%
Writer output = null;
Pattern callbackPattern = Pattern.compile("[a-zA-Z_$][0-9a-zA-Z_$]*");
try {
URL url = new URL(request.getParameter("url"));
String callback = request.getParameter("callback");
URLConnection connection = url.openConnection();
InputStream data = connection.getInputStream();
String contentType = connection.getContentType();
int nLength = connection.getContentLength();
boolean imageFlag = false;
if(contentType != null && contentType.split("/")[0].equalsIgnoreCase("image")){
imageFlag = true;
}
if(imageFlag){
if (callback == null) {
response.setContentType(contentType);
response.setContentLength(nLength);
ByteStreams.copy(data, response.getOutputStream());
} else {
//if (!callbackPattern.matcher(callback).matches()) {
//System.out.println("Invalid callback name");
//}
response.setContentType("application/javascript");
output = new OutputStreamWriter(response.getOutputStream(), "utf-8") {
public void close() throws IOException {
//Base64 stream will try to close before jsonp suffix is added.
};
};
String dataUri = new Gson().toJson("data:" + contentType + ";base64,");
output.write(callback + "(" + dataUri.substring(0, dataUri.length()-1));
OutputStream base64Stream = BaseEncoding.base64().encodingStream(output);
ByteStreams.copy(data, base64Stream);
base64Stream.close();
output.write("\");");
output.flush();
}
}
} catch (IOException ioe) {
//System.out.println("An IOException occurred.");
} catch (RuntimeException e) {
//System.out.println("An RuntimeException occurred.");
}finally{
try{
if( output != null){
output.close();
output = null;
}
}catch(java.io.IOException err1){
//System.out.println("An internal exception occured!!");
}
}
%>

View File

@ -0,0 +1,478 @@
<%@page contentType="text/html;charset=utf-8" %>
<%@page import="java.io.*"%>
<%@page import="java.net.*"%>
<%@page import="org.apache.commons.fileupload.servlet.ServletFileUpload"%>
<%@page import="org.apache.commons.fileupload.disk.DiskFileItemFactory"%>
<%@page import="org.apache.commons.fileupload.FileItem"%>
<%@page import="org.apache.commons.fileupload.FileUploadBase"%>
<%@page import="org.apache.commons.codec.binary.Base64"%>
<%@page import="org.json.*"%>
<%@include file="Util.jsp"%>
<%@page import="java.util.Calendar"%>
<%!
public String getRequestBuffer(InputStream inputStream) {
String strRet = "";
StringBuilder stringBuilder = new StringBuilder();
BufferedReader bufferedReader = null;
String errorRet = null;
try {
if (inputStream != null) {
bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
char[] charBuffer = new char[128];
int bytesRead = -1;
while ((bytesRead = bufferedReader.read(charBuffer)) > 0) {
stringBuilder.append(charBuffer, 0, bytesRead);
}
} else {
stringBuilder.append("");
}
} catch (IOException ex) {
errorRet = "error";
} finally {
if (bufferedReader != null) {
try {
bufferedReader.close();
} catch (IOException ex) {
errorRet = "error";
}
}
}
strRet = stringBuilder.toString();
if(strRet == null || "error".equalsIgnoreCase(errorRet)){
return "";
}else{
return strRet;
}
}
public String Base64ToFile (String strSavePath, String strSaveFName, String strBase64, String strSubDir, double dImageSizeLimit, String imageSubDirName) {
String strRet = "";
Calendar cal = Calendar.getInstance();
String year = Integer.toString(cal.get(Calendar.YEAR));
String month = Integer.toString(cal.get(Calendar.MONTH)+1);
String day = Integer.toString(cal.get(Calendar.DAY_OF_MONTH));
String sPath = "";
String fileTempName = fileNameTimeSetting();
String strExt = strSaveFName.substring(strSaveFName.lastIndexOf(".")).toLowerCase();
if(month.length() == 1)
month = "0" + month;
if(day.length() == 1)
day = "0" + day;
byte[] imageBytes = Base64.decodeBase64(strBase64.getBytes());
FileOutputStream fs = null;
BufferedOutputStream bs = null;
try {
if(!strSubDir.equalsIgnoreCase("false")){
strSavePath = strSavePath + File.separator;
if(imageSubDirName !="")
strSavePath += "data" + File.separator;
if(strSubDir.equalsIgnoreCase("mime")){
strSavePath += "mime";
}else{
strSavePath += "images";
}
} else {
if(imageSubDirName !="")
strSavePath = strSavePath + File.separator + "data";
}
File f = new File(strSavePath);
synchronized(this){
if (!f.exists()) {
f.setExecutable(false, true);
f.setReadable(true);
f.setWritable(false, true);
f.mkdir();
}
}
if(imageSubDirName !=""){
sPath = File.separator + year + File.separator + month + File.separator + day + File.separator + imageSubDirName;
strSavePath += sPath;
File folderPath = new File(strSavePath);
synchronized (this){
if(!folderPath.exists()){
try{
folderPath.setExecutable(false, true);
folderPath.setReadable(true);
folderPath.setWritable(false, true);
folderPath.mkdirs();
}catch(Exception e){
e.getStackTrace();
}
}
}
}
String subPath = "";
if(!strSubDir.equalsIgnoreCase("false")){
subPath = getChildDirectory(strSavePath, "100");
strSavePath += File.separator + subPath;
}
String strPath = strSavePath + File.separator + fileTempName + strExt;
File ff = new File(strPath);
synchronized (this){
if (!ff.exists()) {
ff.setExecutable(false, true);
ff.setReadable(true);
ff.setWritable(false, true);
ff.createNewFile();
}
}
fs = new FileOutputStream(ff);
bs = new BufferedOutputStream(fs);
bs.write(imageBytes);
double fileLength = ff.length();
if(dImageSizeLimit < fileLength){
strRet = "invalid_size";
ff.delete();
}else if(strExt.indexOf(".jar") != -1 || strExt.indexOf(".war") != -1 || strExt.indexOf(".jsp") != -1 || strExt.indexOf(".jspx") != -1 || strExt.indexOf(".js") != -1 || strExt.indexOf(".html") != -1 || strExt.indexOf(".htm") != -1){
strRet = "invalid_image";
ff.delete();
}else{
if(imageSubDirName !="")
strRet += "/data";
if(!strSubDir.equalsIgnoreCase("false")){
if(strSubDir.equalsIgnoreCase("mime")){
strRet += "/mime/";
}else{
strRet += "/images/";
}
if(imageSubDirName !="")
strRet += year + "/" + month + "/" + day + "/" + imageSubDirName + "/" + subPath + "/" + fileTempName + strExt;
else
strRet += subPath + "/" + fileTempName + strExt;
}else{
if(imageSubDirName !="")
strRet += "/" + year + "/" + month + "/" + day + "/" + imageSubDirName + "/" + fileTempName + strExt;
else
strRet += "/" + fileTempName + strExt;
}
}
}catch(Exception e) {
strRet = "";
}finally{
try{
fs.close();
bs.close();
}catch(Exception e2){
strRet = "";
}
}
return strRet;
}
public String fileUploadProc (String strSavePath, String strSaveFName, FileItem fileItem, String strSubDir, double dImageSizeLimit, String imageSubDirName) {
String strRet = "";
Calendar cal = Calendar.getInstance();
String year = Integer.toString(cal.get(Calendar.YEAR));
String month = Integer.toString(cal.get(Calendar.MONTH)+1);
String day = Integer.toString(cal.get(Calendar.DAY_OF_MONTH));
String sPath = "";
String fileTempName = fileNameTimeSetting();
String strExt = strSaveFName.substring(strSaveFName.lastIndexOf(".")).toLowerCase();
if(month.length() == 1)
month = "0" + month;
if(day.length() == 1)
day = "0" + day;
if(dImageSizeLimit < fileItem.getSize())
return "invalid_size";
else if (strExt.indexOf(".jar") != -1 || strExt.indexOf(".war") != -1 || strExt.indexOf(".jsp") != -1 || strExt.indexOf(".jspx") != -1 || strExt.indexOf(".js") != -1 || strExt.indexOf(".html") != -1 || strExt.indexOf(".htm") != -1)
return "invalid_image";
//byte[] imageBytes = Base64.decodeBase64(strBase64.getBytes());
try {
if(!strSubDir.equalsIgnoreCase("false")){
strSavePath = strSavePath + File.separator;
if(imageSubDirName !="")
strSavePath += "data" + File.separator;
if(strSubDir.equalsIgnoreCase("mime")){
strSavePath += "mime";
}else{
strSavePath += "images";
}
} else {
if(imageSubDirName !="")
strSavePath = strSavePath + File.separator + "data";
}
File f = new File(strSavePath);
synchronized(this){
if (!f.exists()) {
f.setExecutable(false, true);
f.setReadable(true);
f.setWritable(false, true);
f.mkdirs();
}
}
if(imageSubDirName !=""){
sPath = File.separator + year + File.separator + month + File.separator + day + File.separator + imageSubDirName;
strSavePath += sPath;
File folderPath = new File(strSavePath);
synchronized (this){
if(!folderPath.exists()){
try{
folderPath.setExecutable(false, true);
folderPath.setReadable(true);
folderPath.setWritable(false, true);
folderPath.mkdirs();
}catch(Exception e){
e.getStackTrace();
}
}
}
}
String subPath = "";
if(!strSubDir.equalsIgnoreCase("false")){
subPath = getChildDirectory(strSavePath, "100");
strSavePath += File.separator + subPath;
}
String strPath = strSavePath + File.separator + fileTempName + strExt;
File ff = new File(strPath);
synchronized (this){
if (!ff.exists()) {
ff.setExecutable(false, true);
ff.setReadable(true);
ff.setWritable(false, true);
ff.createNewFile();
}
}
fileItem.write(ff);
fileItem.delete();
if(imageSubDirName !="")
strRet += "/data";
if(!strSubDir.equalsIgnoreCase("false")){
if(strSubDir.equalsIgnoreCase("mime")){
strRet += "/mime/";
}else{
strRet += "/images/";
}
if(imageSubDirName !="")
strRet += year + "/" + month + "/" + day + "/" + imageSubDirName + "/" + subPath + "/" + fileTempName + strExt;
else
strRet += subPath + "/" + fileTempName + strExt;
}else{
if(imageSubDirName !="")
strRet += "/" + year + "/" + month + "/" + day + "/" + imageSubDirName + "/" + fileTempName + strExt;
else
strRet += "/" + fileTempName + strExt;
}
}catch(Exception e) {
strRet = "";
}
return strRet;
}
%>
<%
String imageTemp = "";
String imageUPath = "";
String imagePhysicalPath = "";
String imageSubDirName = "";
String uploadFileExtBlockList = "";
String uploadFileSubDir = "";
double imageSizeLimit = 5242880;
PrintWriter Output = response.getWriter();
String contentType = request.getContentType();
List items = null;
List<FileItem> fileItems = new ArrayList<FileItem>();
JSONArray filesArray = null;
JSONArray jsonArr = new JSONArray();
JSONObject jsonobj = new JSONObject();
if(contentType.indexOf("multipart/form-data;") != -1){
boolean isMultipart = ServletFileUpload.isMultipartContent(request);
DiskFileItemFactory factory = null;
ServletFileUpload upload = null;
String type = "";
String nm = "";
if (isMultipart) {
factory = new DiskFileItemFactory();
factory.setSizeThreshold(2 * 1024 * 1024);
upload = new ServletFileUpload(factory);
upload.setSizeMax(-1);
upload.setHeaderEncoding("utf-8");
items = upload.parseRequest(request);
for(int i=0; items.size()>i; i++){
FileItem fileItem = (FileItem) items.get(i);
if(fileItem.isFormField()){
if(fileItem.getFieldName().equalsIgnoreCase("imageUPath")) imageUPath = toString(fileItem.getString("utf-8"));
if(fileItem.getFieldName().equalsIgnoreCase("uploadFileSubDir")) uploadFileSubDir = toString(fileItem.getString("utf-8"));
if(fileItem.getFieldName().equalsIgnoreCase("imageSizeLimit")) imageSizeLimit = Double.parseDouble(toString(fileItem.getString("utf-8")));
} else {
if(fileItem.getSize()>0) {
fileItems.add(fileItem);
}
}
}
}else{
response.getWriter().println("not encoding type multipart/form-data");
}
}else{
String str = getRequestBuffer(request.getInputStream());
if (str.length() <= 0) {
Output.print("");
Output.close();
return;
}
JSONObject object = new JSONObject(str);
JSONObject pduObj = (JSONObject)object.get("pdu");
filesArray = (JSONArray)pduObj.get("files");
imageUPath = pduObj.get("imageUPath").toString();
uploadFileSubDir = pduObj.get("uploadFileSubDir").toString();
imageSizeLimit = Double.parseDouble(pduObj.get("imageSizeLimit").toString());
}
%>
<%@include file="ImagePath.jsp"%>
<%@include file="UploadFileExtBlockList.jsp"%>
<%
String strUPath = "";
String strAbsolutePath = "";
String protocol = "http://";
if(request.isSecure()){
protocol = "https://";
}
String imageUPathHost = protocol + request.getHeader("host");
if(imageUPath.length() > 0){
if(imageUPath.indexOf("http") == 0){
strUPath = imageUPath;
}else{
strUPath = imageUPathHost + imageUPath;
}
}else{
String curUrlPath = request.getRequestURI();
curUrlPath = curUrlPath.substring(0, curUrlPath.lastIndexOf("/"));
curUrlPath = curUrlPath.substring(0, curUrlPath.lastIndexOf("/"));
curUrlPath = curUrlPath.substring(0, curUrlPath.lastIndexOf("/"));
strUPath = imageUPathHost + curUrlPath + "/binary";
}
if(imagePhysicalPath.length() > 0){
strAbsolutePath = imagePhysicalPath;
}else{
ServletContext context = getServletContext();
String contextPath = request.getContextPath();
if(!imageUPath.equalsIgnoreCase("")){
if (imageUPath.length() > 7) {
if (imageUPath.substring(0, 7).equalsIgnoreCase("http://")) {
imageTemp = imageUPath.substring(7);
imageUPath = imageTemp.substring(imageTemp.indexOf("/"));
}
else if (imageUPath.substring(0, 8).equalsIgnoreCase("https://")) {
imageTemp = imageUPath.substring(8);
imageUPath = imageTemp.substring(imageTemp.indexOf("/"));
}
}
strAbsolutePath = context.getRealPath(imageUPath.substring(contextPath.length()));
}else{
String curUrlPath = request.getRequestURI();
curUrlPath = curUrlPath.substring(0, curUrlPath.lastIndexOf("/"));
curUrlPath = curUrlPath.substring(0, curUrlPath.lastIndexOf("/"));
curUrlPath = curUrlPath.substring(0, curUrlPath.lastIndexOf("/"));
curUrlPath.substring(contextPath.length());
strAbsolutePath = context.getRealPath(curUrlPath.substring(contextPath.length()) + "/binary");
}
}
if(filesArray != null){
for (int i = 0; i < filesArray.length(); i++) {
Object jobj = filesArray.get(i);
String strFileName = ((JSONObject) jobj).get("filename").toString();
String strExt = strFileName.substring(strFileName.lastIndexOf(".") + 1).toLowerCase();
if(uploadFileExtBlockList.length() > 0 && !isArray(uploadFileExtBlockList, strExt)){
final JSONObject o1 = new JSONObject();
o1.put("url", "UploadFileExtBlock");
o1.put("filename", strFileName);
jsonArr.put(o1);
continue;
}
String file = ((JSONObject) jobj).get("base64string").toString();
String strFileURL = Base64ToFile (strAbsolutePath, strFileName, file, uploadFileSubDir, imageSizeLimit, imageSubDirName);
if (strFileURL.length() > 0 && !strFileURL.equals("")) {
final JSONObject o = new JSONObject();
if("invalid_size".equalsIgnoreCase(strFileURL)){
o.put("url", strFileURL);
o.put("filename", strFileName);
}else if("invalid_image".equalsIgnoreCase(strFileURL)){
o.put("url", strFileURL);
o.put("filename", strFileName);
}else{
o.put("url", strUPath + strFileURL);
o.put("filename", strFileName);
}
jsonArr.put(o);
}
}
}
if(fileItems != null){
for(int i=0; fileItems.size()>i; i++){
FileItem fileItem2 = fileItems.get(i);
String strFileName2 = fileItem2.getName();
String strExt = strFileName2.substring(strFileName2.lastIndexOf(".") + 1).toLowerCase();
if(uploadFileExtBlockList.length() > 0 && !isArray(uploadFileExtBlockList, strExt)){
final JSONObject o1 = new JSONObject();
o1.put("url", "UploadFileExtBlock");
o1.put("filename", strFileName2);
jsonArr.put(o1);
continue;
}
String strFileURL = fileUploadProc (strAbsolutePath, strFileName2, fileItem2, uploadFileSubDir, imageSizeLimit, imageSubDirName);
if (strFileURL.length() > 0 && !strFileURL.equals("")) {
final JSONObject o = new JSONObject();
if("invalid_size".equalsIgnoreCase(strFileURL)){
o.put("url", strFileURL);
o.put("filename", strFileName2);
}else if("invalid_image".equalsIgnoreCase(strFileURL)){
o.put("url", strFileURL);
o.put("filename", strFileName2);
}else{
o.put("url", strUPath + strFileURL);
o.put("filename", strFileName2);
}
jsonArr.put(o);
}
}
}
jsonobj.put("files",jsonArr);
String json = jsonobj.toString();
Output.print(json);
Output.flush();
Output.close();
%>

View File

@ -126,11 +126,11 @@
<button type="button" class="btn btn-warning" id="editFaSriBtn" th:data-fasrikey="${faSri.faSriKey}">수정</button>
</th:block>
<th:block th:each="readUser:${faSri.readUserList}">
<th:block th:if="${userSeq eq readUser.userSeq}">
<th:block th:unless="${faSri.faSriEdate eq null}">
<button type="button" class="btn btn-success" id="reSendBtn" th:if="${faSri.faSriEdate} >= ${#temporals.createToday()}" th:data-fasrikey="${faSri.faSriKey}">회신</button>
</th:block>
</th:block>
<th:block th:if="${userSeq eq readUser.userSeq}">
<th:block th:unless="${faSri.faSriEdate eq null}">
<button type="button" class="btn btn-success" id="reSendBtn" th:if="${faSri.faSriEdate} >= ${#temporals.createToday()}" th:data-fasrikey="${faSri.faSriKey}">회신</button>
</th:block>
</th:block>
</th:block>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
</div>