modifyUserInfo.jsp 8.2 KB

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