123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265 |
- <%--
- - FileName : ChangeExpiredPwd.jsp
- - Author(s) : chs
- - Date : 2023-09-21
- -
- - Description: 비밀번호 수정
- --%>
- <%@ page contentType="text/html; charset=utf-8" %>
- <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
- <%@ page contentType="text/html; charset=utf-8" %>
- <%@ page import="kr.co.hsnc.common.base.WAFLogger" %>
- <%@ page import="kr.co.hsnc.common.util.ValueObject" %>
- <%@ page import="kr.co.hsnc.j2ee.waf.controller.web.util.WebKeys" %>
- <%@ page import="kr.co.hsnc.j2ee.waf.view.template.Screen" %>
- <%@ page import="kr.co.hsnc.common.config.*"%>
- <%@ page import="com.udapsoft.waf.common.*" %>
- <%@ include file="/jsp/work/taglib.jsp" %>
- <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
- <%
- ctx.init(request, response);
- request.setCharacterEncoding("utf-8");
-
- ValueObject user = null;
- String login_id = request.getParameter("login_id");
- HandlerStorage storage = ctx.getHandlerStorage();
- ValueObject params = storage.getParams();
- String event = storage.getEvent();
-
- %>
- <SCRIPT language="JavaScript" src="/js/common.js"></SCRIPT>
- <SCRIPT language="JavaScript">
- function doClose(){
- setTimeout(function(){parent.changeExpiredPwdClose(null);},100);
- }
- function saveProc(){
-
- var f = document.form1;
-
- if( f.user_pw1.value == "") {
- alert("비밀번호를 입력하세요.");
- return;
- }
-
- if( f.user_pw2.value == "") {
- alert("비밀번호 확인을 입력하세요.");
- return;
- }
-
- if( f.user_pw1.value != f.user_pw2.value) {
- alert("비밀번호와 비밀번호확인이 일치하지 않습니다.");
- return;
- }
-
- var argObj = new Object();
- argObj.user_id = '<%=login_id %>';
- argObj.passwd01 = f.user_pw1.value;
- argObj.passwd02 = f.user_pw2.value;
- argObj.tel_no = "";
- argObj.fax_no = "";
- argObj.hand_tel = "";
- var rMsg = doValidPassWord(argObj)
- if( rMsg != "" ) {
- alert(rMsg);
- return;
- }
-
- submitXmlRequest("/sycs/user/ChangeExpiredPwdWorker.screen", "SAVE", f);
-
- /* f.action = "/sycs/user/ChangeExpiredPwdWorker.screen";
- f.target = "worker";
- f.fevent.value = "ChangeExpiredPwd.Save"; */
-
- }
- function doResult(resultObj) {
- try {
- if( resultObj.getRequestEvent() == "SAVE") {
- if( resultObj.getSuccess() ) {
- alert('변경되었습니다.');
- doClose();
- }else {
- dlgErrorMsg(resultObj);
- }
- }
- }
- catch(errorObject) {
- showErrorDlg("doResult()", errorObject);
- }
- }
- function doValidPassWord(Object) {
- var minLength = 8; //비밀번호 최소 자리수
- var maxLength = 15; //비밀번호 최대 자리수
- var msg = "";
-
- try {
-
- if(Object.passwd01 != Object.passwd02){
- msg = "입력하신 비밀번호가 다릅니다.";
- return msg;
- }
- if(Object.passwd01.length < minLength || Object.passwd01.length > maxLength){
- msg = "비밀번호는 "+minLength+"자 이상 ~"+maxLength+" 자 이내로 입력하세요!";
- return msg;
- }
-
-
- if(chkPassword(Object.passwd01) == false ){
- msg = "비밀번호는 영문, 숫자의 조합으로 입력하세요!";
- return msg;
- }
-
- if(chkNumber(Object.passwd01, Object.tel_no) == false
- ||chkNumber(Object.passwd01, Object.hand_tel) == false){
- msg = "전화번호, 휴대폰번호 등은 비밀번호로 사용할 수 없습니다!"
- return msg;
- }
-
- var cnt=0,cnt2=1,cnt3=1;
- var temp="";
- for(i=0;i < Object.user_id.length;i++){
- temp_id =Object.user_id.charAt(i);
- for(j=0;j < Object.passwd01.length;j++){
- if (cnt >0)
- j=tmp_pass_no+1;
- if (temp == "r"){
- j=0;
- temp="";
- }
- temp_pass = Object.passwd01.charAt(j);
- if (temp_id == temp_pass){
- cnt = cnt + 1;
- tmp_pass_no = j;
- break;
- }else if(cnt > 0 && j > 0){
- temp="r";
- cnt = 0;
- }else
- cnt = 0;
- }
- //alert("4-cnt="+cnt);
- if (cnt > 3) break;
- }
- if (cnt > 3){
- msg = "비밀번호가 ID와 4자 이상 중복되거나, \n연속된 문자나 순차적인 숫자를 4개이상 사용해서는 안됩니다.";
- return msg;
- }
- for(i=0;i < Object.passwd01.length;i++){
- temp_pass1 = Object.passwd01.charAt(i);
- next_pass = (parseInt(temp_pass1.charCodeAt(0)))+1;
- temp_p = Object.passwd01.charAt(i+1);
- temp_pass2 = (parseInt(temp_p.charCodeAt(0)));
- if (temp_pass2 == next_pass)
- cnt2 = cnt2 + 1;
- else
- cnt2 = 1;
- if (temp_pass1 == temp_p)
- cnt3 = cnt3 + 1;
- else
- cnt3 = 1;
- if (cnt2 > 3) break;
- if (cnt3 > 3) break;
- }
- if (cnt2 > 3){
- msg = "비밀번호에 연속된 문자나 순차적인 숫자를 4개이상 사용해서는 안됩니다.";
- return msg;
- }else if (cnt3 > 3){
- msg = "비밀번호에 반복된 문자/숫자를 4개이상 사용해서는 안됩니다.";
- return msg;
- }
-
- }catch(errorObject) {
- return msg = errorObject ;
- }
-
- return msg;
- }
- function chkPassword(pass) {
- chk1 = /^[a-z\d]{8,12}$/i; //a-z와 0-9이외의 문자가 있는지 확인
- chk2 = /[a-z]/i; //적어도 한개의 a-z 확인
- chk3 = /\d/; //적어도 한개의 0-9 확인
- return chk1.test(pass) && chk2.test(pass) && chk3.test(pass);
- }
-
- function chkNumber(pass, Num){
- var check = false;
-
- var comp = Num.substring(Num.length-4);
- if(pass.match(comp)== null || Num == ""){
- return true;
- }
-
- return check;
- }
-
- </SCRIPT>
- <FORM name="form1" method="post" action="" target="">
- <INPUT type='hidden' name="fevent" value="">
- <INPUT type='hidden' name="acct_id" value="<%= login_id %>">
- <TABLE width="100%" cellpadding="0" cellspacing="0" border="0" align = "center">
- <TR>
- <TD height="25" width="16" valign="middle"><IMG src="/img/buyer/template/bullet_03.gif" border="0" align="absmiddle"></TD>
- <TD width="100%"><b>패스워드변경</b></TD>
- <TD align="right" nowrap></TD>
- </TR>
- </TABLE>
-
- <TABLE width="100%" cellspacing="0" cellpadding="0" bordercolordark="#FFFFF" bordercolorlight="#d2d2d2" border="1" align = "center">
- <TR height="25">
- <TH class="view_title">비밀번호</TH>
- <TD colspan='2'>
- <INPUT class="input" type="password" id="user_pw1" name="user_pw1" maxlength="15" value="" style="width:95%; border:1px solid #CBCBCB;" />
- </TD>
- </TR>
- <TR height="25">
- <TH class="view_title">비밀번호 확인</TH>
- <TD colspan='2'>
- <INPUT class="input" type="password" id="user_pw2" name="user_pw2" maxlength="15" value="" style="width:95%; border:1px solid #CBCBCB;" />
- </TD>
- </TR>
- </TABLE>
- <TABLE width="400" border="0" cellspacing="0" cellpadding="0">
- <TR height="25" valign="top">
- <TD align="center" valign="middle"> 숫자,영문자 조합 8-15자리. 연속된 숫자,문자 4자리 이상 불가</TD>
- </TR>
- </TABLE>
- <TABLE width="400" border="0" cellspacing="0" cellpadding="0">
- <TR height="28" valign="top">
- <TD valign="bottom"> </TD>
- <TD align="center">
- <span class="btnSearch center" id="btn_save"><a href="javascript:saveProc();">저장</a></span>
- <span class="btnSearch center" id="btn_close"><a href="javascript:doClose();">닫기</a></span>
- </TD>
- </TR>
- </TABLE>
- </FORM>
|