index.jsp 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <%@ page language="java" pageEncoding="UTF-8" %>
  2. <%@ page import="java.io.File" %>
  3. <%@ page import="kr.comsquare.soonsu.define.AdminMessage" %>
  4. <%@ page import="kr.comsquare.common.library.FileLib" %>
  5. <%@ page import="kr.comsquare.soonsu.service.context.TrustFormServletContextListener" %>
  6. <% request.setCharacterEncoding("UTF-8"); %>
  7. <html>
  8. <head>
  9. <title>TrustForm Soonsu</title>
  10. </head>
  11. <%
  12. String strLanguage = AdminMessage.LANGUAGE;
  13. String strFontFamily = "Dotum, arial";
  14. if ("jp".equals(strLanguage))
  15. {
  16. strFontFamily = "MS Gothic, arial";
  17. }
  18. else if ("us".equals(strLanguage))
  19. {
  20. strFontFamily = "arial";
  21. }
  22. AdminMessage objAdminMessage = new AdminMessage();
  23. String strUserHome = System.getProperty("user.home");
  24. String strUserPath = TrustFormServletContextListener.s_strApplicationName + "/kr/comsquare/admin/";
  25. String strAppName = TrustFormServletContextListener.s_strApplicationName.replace("/", "");
  26. strAppName = strAppName.equals("") ? "ROOT" : strAppName;
  27. File objAdminFile = new File(strUserHome+File.separator + "tfconfig"+ File.separator+strAppName+".xml");
  28. if (!objAdminFile.exists())
  29. {
  30. String strAdminXML = new String();
  31. strAdminXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n";
  32. strAdminXML = strAdminXML + "<tfConfig>\r\n";
  33. strAdminXML = strAdminXML + "\t<loginInfo>\r\n";
  34. strAdminXML = strAdminXML + "\t\t<loginId>trustform</loginId>\r\n";
  35. strAdminXML = strAdminXML + "\t\t<loginPw>soonsu</loginPw>\r\n";
  36. strAdminXML = strAdminXML + "\t</loginInfo>\r\n";
  37. strAdminXML = strAdminXML + "\t<generatePath>\r\n";
  38. strAdminXML = strAdminXML + "\t</generatePath>\r\n";
  39. strAdminXML = strAdminXML + "</tfConfig>";
  40. FileLib.saveFile(objAdminFile, strAdminXML);
  41. }
  42. %>
  43. <script src="<%=strUserPath%>HttpClient.js" type="text/javascript"></script>
  44. <script type="text/javascript">
  45. var objHttpClient = new HttpClient();
  46. function submitLogin ()
  47. {
  48. if (document.getElementById("inputId").value == "")
  49. {
  50. alert("<%=objAdminMessage.getMessage("admin01")%>");
  51. document.getElementById("inputId").focus();
  52. return;
  53. }
  54. if (document.getElementById("inputPassword").value == "")
  55. {
  56. alert("<%=objAdminMessage.getMessage("admin02")%>");
  57. document.getElementById("inputPassword").focus();
  58. return;
  59. }
  60. var strData = encodeURI("inputId");
  61. strData += "=";
  62. strData += encodeURI(document.getElementById("inputId").value);
  63. strData += "&";
  64. strData += encodeURI("inputPassword");
  65. strData += "=";
  66. strData += encodeURI(document.getElementById("inputPassword").value);
  67. var strResult = objHttpClient.send("<%=strUserPath%>AdminLogin.tfs", strData, false);
  68. if (strResult == "Success")
  69. {
  70. location.href = "<%=strUserPath%>main.jsp";
  71. }
  72. else if (strResult == "InitFailure")
  73. {
  74. alert("<%=objAdminMessage.getMessage("admin03")%>");
  75. }
  76. else if (strResult == "LoginFailure")
  77. {
  78. alert("<%=objAdminMessage.getMessage("admin04")%>");
  79. }
  80. else if (strResult == "TrialExpire")
  81. {
  82. alert("<%=objAdminMessage.getMessage("admin06")%>");
  83. }
  84. else
  85. {
  86. alert("<%=objAdminMessage.getMessage("admin05")%>");
  87. }
  88. }
  89. </script>
  90. <body topmargin="0" leftmargin="0" bgcolor="#ECECEC" marginwidth="0" marginheight="0">
  91. <table cellpadding="0" cellspacing="0" align="center" style="position:absolute;left:50%;top:50%;margin:-250 0 0 -250; background-color:#FFFFFF;">
  92. <tr>
  93. <td width="500px" height="201px" colspan="5"><img src="<%=strUserPath%>image/admin01_<%=strLanguage%>.jpg" width="500px" height="201px" border="0"/></td>
  94. </tr>
  95. <tr>
  96. <td width="50px" height="49px" style="background-color:#ECECEC">
  97. </td>
  98. <td width="5px" height="49px">
  99. </td>
  100. <td width="390px" height="49px" background="image/admin02.jpg">
  101. <table cellpadding="0" cellspacing="0" align="center">
  102. <tr>
  103. <td align="center" width="45px" height="49px" rowspan="2"><img src="<%=strUserPath%>image/admin05_<%=strLanguage%>.jpg" width="45px" height="49px" border="0"/></td>
  104. <td align="center" width="160px" height="24px">
  105. <input id="inputId" type="text" style="font-family:<%=strFontFamily%>;font-size:10pt;width:140px;height:20px;border:1px solid #D6D6D6;" tabindex="1" onkeypress="if (event.keyCode==13) {submitLogin();}" title="<%=objAdminMessage.getTip("admin01")%>"/>
  106. </td>
  107. <td align="center" width="74px" height="49px" rowspan="2">
  108. <img src="<%=strUserPath%>image/admin06.jpg" tabindex="3" style="width:74px; height:45px; border-style:none; background-color:#CCCCCC; cursor:hand; " onclick="submitLogin();" onkeypress="if (event.keyCode==13) {submitLogin();}" title="<%=objAdminMessage.getTip("admin03")%>" alt="<%=objAdminMessage.getTip("admin03")%>"/>
  109. </td>
  110. </tr>
  111. <tr>
  112. <td align="center" width="160px" height="25px">
  113. <input id="inputPassword" type="password" style="width:140px;height:20px;border:1px solid #D6D6D6;" tabindex="2" onkeypress="if (event.keyCode==13) {submitLogin();}" title="<%=objAdminMessage.getTip("admin02")%>"/>
  114. </td>
  115. </tr>
  116. </table>
  117. </td>
  118. <td width="5px" height="49px">
  119. </td>
  120. <td width="50px" height="49px" style="background-color:#ECECEC">
  121. </td>
  122. </tr>
  123. <tr>
  124. <td width="50px" height="62px" style="background-color:#ECECEC"></td>
  125. <td width="5px" height="62px"></td>
  126. <td width="390px" height="62px" background="<%=strUserPath%>image/admin03.jpg"></td>
  127. <td width="5px" height="62px"></td>
  128. <td width="50px" height="62px" style="background-color:#ECECEC"></td>
  129. </tr>
  130. <tr>
  131. <td width="500px" height="46px" colspan="5"><img src="<%=strUserPath%>image/admin04.jpg" width="500px" height="46px" border="0"/></td>
  132. </tr>
  133. </table>
  134. </body>
  135. </html>