modify.jsp 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <%@ page language="java" pageEncoding="UTF-8" %>
  2. <%@ page import="java.io.File" %>
  3. <%@ page import="org.w3c.dom.Node" %>
  4. <%@ page import="kr.comsquare.soonsu.define.AdminMessage" %>
  5. <%@ page import="kr.comsquare.common.library.XmlLib" %>
  6. <%@ page import="kr.comsquare.soonsu.service.context.TrustFormServletContextListener" %>
  7. <% request.setCharacterEncoding("UTF-8"); %>
  8. <html>
  9. <head>
  10. <title>TrustForm Soonsu</title>
  11. </head>
  12. <%
  13. String strLanguage = AdminMessage.LANGUAGE;
  14. String strFontFamily = "Dotum, arial";
  15. if ("jp".equals(strLanguage))
  16. {
  17. strFontFamily = "MS Gothic, arial";
  18. }
  19. else if ("us".equals(strLanguage))
  20. {
  21. strFontFamily = "arial";
  22. }
  23. AdminMessage objAdminMessage = new AdminMessage();
  24. String strLogin = (String)session.getAttribute("login");
  25. String strUserHome = System.getProperty("user.home");
  26. String strAppName = TrustFormServletContextListener.s_strApplicationName.replace("/", "");
  27. strAppName = strAppName.equals("") ? "ROOT" : strAppName;
  28. File objAdminFile = new File(strUserHome+File.separator + "tfconfig"+ File.separator+strAppName+".xml");
  29. if (!objAdminFile.exists() || strLogin == null || !strLogin.equals("Success"))
  30. {
  31. %>
  32. <script type="text/javascript">
  33. alert("<%=objAdminMessage.getMessage("main01")%>");
  34. if (window.parent.document.getElementById("modalBackground"))
  35. {
  36. window.parent.document.getElementById("tableModify").style.visibility = "hidden";
  37. window.parent.document.getElementById("modalBackground").style.visibility = "hidden";
  38. window.parent.document.getElementById("frameModify").src = "";
  39. }
  40. else
  41. {
  42. location.href = "index.jsp";
  43. }
  44. </script>
  45. <%
  46. return;
  47. }
  48. Node xnTfConfig = XmlLib.loadXmlDocument(objAdminFile);
  49. Node xnLoginId = XmlLib.selectSingleNode(xnTfConfig, "loginInfo/loginId");
  50. Node xnLoginPw = XmlLib.selectSingleNode(xnTfConfig, "loginInfo/loginPw");
  51. String strGetId = XmlLib.getTextValue(xnLoginId);
  52. String strGetPassword = XmlLib.getTextValue(xnLoginPw);
  53. %>
  54. <script src="HttpClient.js" type="text/javascript"></script>
  55. <script type="text/javascript">
  56. var objHttpClient = new HttpClient();
  57. function submitModify ()
  58. {
  59. if (document.getElementById("inputId").value == "")
  60. {
  61. alert("<%=objAdminMessage.getMessage("admin01")%>");
  62. document.getElementById("inputId").focus();
  63. return;
  64. }
  65. if (document.getElementById("inputPassword").value == "" || document.getElementById("inputPassword").value != document.getElementById("inputPasswordConfirm").value)
  66. {
  67. alert("<%=objAdminMessage.getMessage("modify01")%>");
  68. document.getElementById("inputPassword").focus();
  69. return;
  70. }
  71. if (confirm("<%=objAdminMessage.getMessage("modify02")%>"))
  72. {
  73. var strData = encodeURI("inputId");
  74. strData += "=";
  75. strData += encodeURI(document.getElementById("inputId").value);
  76. strData += "&";
  77. strData += encodeURI("inputPassword");
  78. strData += "=";
  79. strData += encodeURI(document.getElementById("inputPassword").value);
  80. var strResult = objHttpClient.send("AdminModify.tfs", strData, false);
  81. closeModify();
  82. if (strResult == "Success")
  83. {
  84. alert("<%=objAdminMessage.getMessage("modify03")%>");
  85. }
  86. else if (strResult == "InitFailure")
  87. {
  88. alert("<%=objAdminMessage.getMessage("main01")%>");
  89. }
  90. else
  91. {
  92. alert("<%=objAdminMessage.getMessage("admin05")%>");
  93. }
  94. }
  95. }
  96. function closeModify ()
  97. {
  98. window.parent.document.getElementById("tableModify").style.visibility = "hidden";
  99. window.parent.document.getElementById("modalBackground").style.visibility = "hidden";
  100. window.parent.document.getElementById("frameModify").src = "";
  101. }
  102. </script>
  103. <body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">
  104. <table cellpadding="0" cellspacing="0" align="center">
  105. <tr>
  106. <td width="400px" height="170px">
  107. <table cellpadding="0" cellspacing="0" align="center">
  108. <tr>
  109. <td width="73px" height="75px" rowspan="3" style="font-size:0;">
  110. <img src="image/modify02_<%=strLanguage%>.jpg" width="73px" height="75px" border="0"/>
  111. </td>
  112. <td align="right" width="218px" height="25px">
  113. <input id="inputId" name="inputId" type="text" style="font-family:<%=strFontFamily%>;font-size:9pt;width:208px;height:20px;border:1px solid #D6D6D6;" tabindex="1" onkeypress="javascript:if (event.keyCode==13) {submitModify();}" value="<%=strGetId%>" title="<%=objAdminMessage.getTip("admin01")%>"/>
  114. </td>
  115. </tr>
  116. <tr>
  117. <td align="right" width="218px" height="25px">
  118. <input id="inputPassword" name="inputPassword" type="password" style="width:208px;height:20px;border:1px solid #D6D6D6;" tabindex="2" onkeypress="javascript:if (event.keyCode==13) {submitModify();}" value="<%=strGetPassword%>" title="<%=objAdminMessage.getTip("admin02")%>"/>
  119. </td>
  120. </tr>
  121. <tr>
  122. <td align="right" width="218px" height="25px">
  123. <input id="inputPasswordConfirm" name="inputPasswordConfirm" type="password" style="width:208px;height:20px;border:1px solid #D6D6D6;" tabindex="3" onkeypress="javascript:if (event.keyCode==13) {submitModify();}" title="<%=objAdminMessage.getTip("modify01")%>"/>
  124. </td>
  125. </tr>
  126. </table>
  127. </td>
  128. </tr>
  129. <tr>
  130. <td width="400px" height="82px">
  131. <table cellpadding="0" cellspacing="0" align="center">
  132. <tr>
  133. <td width="379px" height="80px" align="center" style="border-top:1px solid #D8D8D8;">
  134. <img src="image/modalButtOk_<%=strLanguage%>.gif" tabindex="4" onclick="submitModify();" onkeypress="javascript:if (event.keyCode==13) {submitModify();}" style="background-color:#CCCCCC; cursor:hand; " width="56px" height="25px" border="0" title="<%=objAdminMessage.getTip("modal01")%>" alt="<%=objAdminMessage.getTip("modal01")%>"/>&nbsp;
  135. <img src="image/modalButtCancel_<%=strLanguage%>.gif" tabindex="5" onclick="closeModify();" onkeypress="javascript:if (event.keyCode==13) {closeModify();}" style="background-color:#CCCCCC; cursor:hand; " width="56px" height="25px" border="0" title="<%=objAdminMessage.getTip("modal02")%>" alt="<%=objAdminMessage.getTip("modal02")%>"/>
  136. </td>
  137. </tr>
  138. </table>
  139. </td>
  140. </tr>
  141. </table>
  142. </body>
  143. </html>