ChangeExpiredPwd.jsp 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <%--
  2. - FileName : ChangeExpiredPwd.jsp
  3. - Author(s) : chs
  4. - Date : 2023-09-21
  5. -
  6. - Description: 비밀번호 수정
  7. --%>
  8. <%@ page contentType="text/html; charset=utf-8" %>
  9. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  10. <%@ page contentType="text/html; charset=utf-8" %>
  11. <%@ page import="kr.co.hsnc.common.base.WAFLogger" %>
  12. <%@ page import="kr.co.hsnc.common.util.ValueObject" %>
  13. <%@ page import="kr.co.hsnc.j2ee.waf.controller.web.util.WebKeys" %>
  14. <%@ page import="kr.co.hsnc.j2ee.waf.view.template.Screen" %>
  15. <%@ page import="kr.co.hsnc.common.config.*"%>
  16. <%@ page import="com.udapsoft.waf.common.*" %>
  17. <%@ include file="/jsp/work/taglib.jsp" %>
  18. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  19. <%
  20. ctx.init(request, response);
  21. request.setCharacterEncoding("utf-8");
  22. ValueObject user = null;
  23. String login_id = request.getParameter("login_id");
  24. HandlerStorage storage = ctx.getHandlerStorage();
  25. ValueObject params = storage.getParams();
  26. String event = storage.getEvent();
  27. %>
  28. <SCRIPT language="JavaScript" src="/js/common.js"></SCRIPT>
  29. <SCRIPT language="JavaScript">
  30. function doClose(){
  31. setTimeout(function(){parent.changeExpiredPwdClose(null);},100);
  32. }
  33. function saveProc(){
  34. var f = document.form1;
  35. if( f.user_pw1.value == "") {
  36. alert("비밀번호를 입력하세요.");
  37. return;
  38. }
  39. if( f.user_pw2.value == "") {
  40. alert("비밀번호 확인을 입력하세요.");
  41. return;
  42. }
  43. if( f.user_pw1.value != f.user_pw2.value) {
  44. alert("비밀번호와 비밀번호확인이 일치하지 않습니다.");
  45. return;
  46. }
  47. var argObj = new Object();
  48. argObj.user_id = '<%=login_id %>';
  49. argObj.passwd01 = f.user_pw1.value;
  50. argObj.passwd02 = f.user_pw2.value;
  51. argObj.tel_no = "";
  52. argObj.fax_no = "";
  53. argObj.hand_tel = "";
  54. var rMsg = doValidPassWord(argObj)
  55. if( rMsg != "" ) {
  56. alert(rMsg);
  57. return;
  58. }
  59. submitXmlRequest("/sycs/user/ChangeExpiredPwdWorker.screen", "SAVE", f);
  60. /* f.action = "/sycs/user/ChangeExpiredPwdWorker.screen";
  61. f.target = "worker";
  62. f.fevent.value = "ChangeExpiredPwd.Save"; */
  63. }
  64. function doResult(resultObj) {
  65. try {
  66. if( resultObj.getRequestEvent() == "SAVE") {
  67. if( resultObj.getSuccess() ) {
  68. alert('변경되었습니다.');
  69. doClose();
  70. }else {
  71. dlgErrorMsg(resultObj);
  72. }
  73. }
  74. }
  75. catch(errorObject) {
  76. showErrorDlg("doResult()", errorObject);
  77. }
  78. }
  79. function doValidPassWord(Object) {
  80. var minLength = 8; //비밀번호 최소 자리수
  81. var maxLength = 15; //비밀번호 최대 자리수
  82. var msg = "";
  83. try {
  84. if(Object.passwd01 != Object.passwd02){
  85. msg = "입력하신 비밀번호가 다릅니다.";
  86. return msg;
  87. }
  88. if(Object.passwd01.length < minLength || Object.passwd01.length > maxLength){
  89. msg = "비밀번호는 "+minLength+"자 이상 ~"+maxLength+" 자 이내로 입력하세요!";
  90. return msg;
  91. }
  92. if(chkPassword(Object.passwd01) == false ){
  93. msg = "비밀번호는 영문, 숫자의 조합으로 입력하세요!";
  94. return msg;
  95. }
  96. if(chkNumber(Object.passwd01, Object.tel_no) == false
  97. ||chkNumber(Object.passwd01, Object.hand_tel) == false){
  98. msg = "전화번호, 휴대폰번호 등은 비밀번호로 사용할 수 없습니다!"
  99. return msg;
  100. }
  101. var cnt=0,cnt2=1,cnt3=1;
  102. var temp="";
  103. for(i=0;i < Object.user_id.length;i++){
  104. temp_id =Object.user_id.charAt(i);
  105. for(j=0;j < Object.passwd01.length;j++){
  106. if (cnt >0)
  107. j=tmp_pass_no+1;
  108. if (temp == "r"){
  109. j=0;
  110. temp="";
  111. }
  112. temp_pass = Object.passwd01.charAt(j);
  113. if (temp_id == temp_pass){
  114. cnt = cnt + 1;
  115. tmp_pass_no = j;
  116. break;
  117. }else if(cnt > 0 && j > 0){
  118. temp="r";
  119. cnt = 0;
  120. }else
  121. cnt = 0;
  122. }
  123. //alert("4-cnt="+cnt);
  124. if (cnt > 3) break;
  125. }
  126. if (cnt > 3){
  127. msg = "비밀번호가 ID와 4자 이상 중복되거나, \n연속된 문자나 순차적인 숫자를 4개이상 사용해서는 안됩니다.";
  128. return msg;
  129. }
  130. for(i=0;i < Object.passwd01.length;i++){
  131. temp_pass1 = Object.passwd01.charAt(i);
  132. next_pass = (parseInt(temp_pass1.charCodeAt(0)))+1;
  133. temp_p = Object.passwd01.charAt(i+1);
  134. temp_pass2 = (parseInt(temp_p.charCodeAt(0)));
  135. if (temp_pass2 == next_pass)
  136. cnt2 = cnt2 + 1;
  137. else
  138. cnt2 = 1;
  139. if (temp_pass1 == temp_p)
  140. cnt3 = cnt3 + 1;
  141. else
  142. cnt3 = 1;
  143. if (cnt2 > 3) break;
  144. if (cnt3 > 3) break;
  145. }
  146. if (cnt2 > 3){
  147. msg = "비밀번호에 연속된 문자나 순차적인 숫자를 4개이상 사용해서는 안됩니다.";
  148. return msg;
  149. }else if (cnt3 > 3){
  150. msg = "비밀번호에 반복된 문자/숫자를 4개이상 사용해서는 안됩니다.";
  151. return msg;
  152. }
  153. }catch(errorObject) {
  154. return msg = errorObject ;
  155. }
  156. return msg;
  157. }
  158. function chkPassword(pass) {
  159. chk1 = /^[a-z\d]{8,12}$/i; //a-z와 0-9이외의 문자가 있는지 확인
  160. chk2 = /[a-z]/i; //적어도 한개의 a-z 확인
  161. chk3 = /\d/; //적어도 한개의 0-9 확인
  162. return chk1.test(pass) && chk2.test(pass) && chk3.test(pass);
  163. }
  164. function chkNumber(pass, Num){
  165. var check = false;
  166. var comp = Num.substring(Num.length-4);
  167. if(pass.match(comp)== null || Num == ""){
  168. return true;
  169. }
  170. return check;
  171. }
  172. </SCRIPT>
  173. <FORM name="form1" method="post" action="" target="">
  174. <INPUT type='hidden' name="fevent" value="">
  175. <INPUT type='hidden' name="acct_id" value="<%= login_id %>">
  176. <TABLE width="100%" cellpadding="0" cellspacing="0" border="0" align = "center">
  177. <TR>
  178. <TD height="25" width="16" valign="middle"><IMG src="/img/buyer/template/bullet_03.gif" border="0" align="absmiddle"></TD>
  179. <TD width="100%"><b>패스워드변경</b></TD>
  180. <TD align="right" nowrap></TD>
  181. </TR>
  182. </TABLE>
  183. <TABLE width="100%" cellspacing="0" cellpadding="0" bordercolordark="#FFFFF" bordercolorlight="#d2d2d2" border="1" align = "center">
  184. <TR height="25">
  185. <TH class="view_title">비밀번호</TH>
  186. <TD colspan='2'>
  187. <INPUT class="input" type="password" id="user_pw1" name="user_pw1" maxlength="15" value="" style="width:95%; border:1px solid #CBCBCB;" />
  188. </TD>
  189. </TR>
  190. <TR height="25">
  191. <TH class="view_title">비밀번호 확인</TH>
  192. <TD colspan='2'>
  193. <INPUT class="input" type="password" id="user_pw2" name="user_pw2" maxlength="15" value="" style="width:95%; border:1px solid #CBCBCB;" />
  194. </TD>
  195. </TR>
  196. </TABLE>
  197. <TABLE width="400" border="0" cellspacing="0" cellpadding="0">
  198. <TR height="25" valign="top">
  199. <TD align="center" valign="middle">&nbsp;숫자,영문자 조합 8-15자리. 연속된 숫자,문자 4자리 이상 불가</TD>
  200. </TR>
  201. </TABLE>
  202. <TABLE width="400" border="0" cellspacing="0" cellpadding="0">
  203. <TR height="28" valign="top">
  204. <TD valign="bottom">&nbsp;</TD>
  205. <TD align="center">
  206. <span class="btnSearch center" id="btn_save"><a href="javascript:saveProc();">저장</a></span>
  207. <span class="btnSearch center" id="btn_close"><a href="javascript:doClose();">닫기</a></span>
  208. </TD>
  209. </TR>
  210. </TABLE>
  211. </FORM>