수정페이지,연동해제, 비밀번호초기화,변경, 통합탈퇴(진행중)

This commit is contained in:
JSYOO 2021-09-09 11:27:20 +09:00
parent 821363335d
commit b89edcf729
18 changed files with 804 additions and 130 deletions

View File

@ -7,6 +7,7 @@ import nlib.util.StringUtil;
public class OAuthUniversalUser {
private String mbSnsId;
private String mbInfoId;
private String snsId;
@ -24,6 +25,7 @@ public class OAuthUniversalUser {
private String loginIp;
private Date lastLogin;
private String regDd;
private NlibLoginVO nlibVO;
private boolean isValidLogin = false;
@ -160,4 +162,20 @@ public class OAuthUniversalUser {
this.nlibVO = nlibVO;
}
public String getMbSnsId() {
return mbSnsId;
}
public void setMbSnsId(String mbSnsId) {
this.mbSnsId = mbSnsId;
}
public String getRegDd() {
return regDd;
}
public void setRegDd(String regDd) {
this.regDd = regDd;
}
}

View File

@ -38,4 +38,6 @@ public interface LoginService
public int agreeProvInfo(NlibLoginVO loginVO);
public NlibLoginVO selectLoginUserInfo(NlibLoginVO loginVO);
}

View File

@ -37,10 +37,10 @@ public class MemberSiteVO implements Serializable {
private String joinType; /* 가입유형 SNS 및 로그인을 연계하는 포털시스템 아이디(naver, daum 등) */
private String joinAgreeDd; /* 가입동의일자 */
private String joinCouncilCd; /* 가입문화원코드 */
private String joinCouncilNm; /* 가입문화원명 */
private String masterYn; /* 대표여부 */
private String ipNotUse; /* 접속아이피 */
private String lastAccessDdNotUse; /* 마지막접근일자 */
//----------------------------------------------------------------
// SETTER.GETTER
//----------------------------------------------------------------
@ -92,4 +92,10 @@ public class MemberSiteVO implements Serializable {
public void setLastAccessDdNotUse(String lastAccessDdNotUse) {
this.lastAccessDdNotUse = lastAccessDdNotUse;
}
public String getJoinCouncilNm() {
return joinCouncilNm;
}
public void setJoinCouncilNm(String joinCouncilNm) {
this.joinCouncilNm = joinCouncilNm;
}
}

View File

@ -1,6 +1,9 @@
package nlib.user.service;
import java.util.List;
import egovframework.com.ext.oauth.service.OAuthUniversalUser;
/**
* Description :
@ -21,7 +24,44 @@ package nlib.user.service;
*/
public interface UserInfoService
{
/** 사용자의 SNS 연동 리스트를 조회한다.
* @param vo
* @return
* @throws Exception
*/
public List<OAuthUniversalUser> selectSnsSignUpList(NlibLoginVO vo) throws Exception;
/** 정보를 수정한다.
* @param vo
* @throws Exception
*/
public void updateMyInfo(NlibLoginVO vo) throws Exception;
/** 가입문화원 리스트를 조회한다.
* @param vo
* @return
* @throws Exception
*/
public List<MemberSiteVO> selectCenterSignUpList(NlibLoginVO vo) throws Exception;
/** SNS연동을 해지한다.
* @param oAuthVO
* @throws Exception
*/
public void deleteSnsLink(OAuthUniversalUser oAuthVO) throws Exception;
/** 문화원 가입을 해지한다.
* @param siteVO
* @throws Exception
*/
public void deleteCenterLink(MemberSiteVO siteVO) throws Exception;
/** 사용자의 정보를 조회한다.
* @param vo
* @return
* @throws Exception
*/
public NlibLoginVO selectMyInfo(NlibLoginVO vo) throws Exception;
public void updateMyInfo(NlibLoginVO vo) throws Exception;
}

View File

@ -121,12 +121,18 @@ public class LoginServiceImpl implements LoginService
return ERR_CODE_REQ_MEMBERSHIP;
}
// 휴면계 확인
// 휴면계 확인
if("P".equals(nLoginVO.getStatus())) {
oUser.setNlibVO(nLoginVO);
return WRN_CODE_DORMANT;
}
// 탈퇴계정 확인
if("D".equals(nLoginVO.getStatus())) {
oUser.setNlibVO(nLoginVO);
return ERR_CODE_REQ_MEMBERSHIP;
}
// 해당 지방문화원에 미등록된 경우, 정보제공 동의로 이동 처리 필요
if(StringUtil.isEmpty(nLoginVO.getJoinCouncilCd())) {
oUser.setNlibVO(nLoginVO);
@ -217,6 +223,12 @@ public class LoginServiceImpl implements LoginService
return loginDAO.agreeProvInfo(loginVO);
}
public NlibLoginVO selectLoginUserInfo(NlibLoginVO loginVO) {
return loginDAO.selectLoginUserInfo(loginVO);
}
/* SNS 연동 SSO를 통한 로그인 처리한다.
*
* return값이 null인 경우, 정상적인 로그인 처리 완료

View File

@ -47,12 +47,7 @@ public class MemberServiceImpl implements MemberService
String encodedText=null;
encodedText = egovPasswordEncoder.encryptPassword(vo.getLoginUserId()+vo.getPassword());
vo.setPassword(encodedText);
vo.setBirthday(ariaCrypto.encode(vo.getBirthday()));
vo.setMobileNo(ariaCrypto.encode(vo.getMobileNo()));
vo.setEmail(ariaCrypto.encode(vo.getEmail()));
vo.setZipCode(ariaCrypto.encode(vo.getZipCode()));
vo.setAddress(ariaCrypto.encode(vo.getAddress()));
vo.setAddressDetail(ariaCrypto.encode(vo.getAddressDetail()));
vo.encodePrivateInfo();
//회원가입 정보
memberDAO.insertMemberInfo(vo);
//가입한 정보의 UID select

View File

@ -1,12 +1,70 @@
package nlib.user.service.impl;
import java.util.List;
import egovframework.com.ext.oauth.service.OAuthUniversalUser;
import egovframework.rte.psl.dataaccess.mapper.Mapper;
import nlib.user.service.MemberSiteVO;
import nlib.user.service.NlibLoginVO;
/**
* <pre>
* @Class Name : UserInfoDAO.java
*
* @Description : 사용자의 관련 정보 제공 DAO
*
*
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
*
* </pre>
*
* @ ------------ -------- ---------------------------
* @ 수정일 수정자 수정내용
* @ ------------ -------- ---------------------------
* @ 2021. 9. 7. JSYOO 최초 생성
*
*
* @author 이씨플라자 * DIGITALSHIP JSYOO
* @since 2021. 9. 7.
* @version 1.0
*
*/
@Mapper("userInfoDAO")
public interface UserInfoDAO
{
public NlibLoginVO selectMyInfo(NlibLoginVO vo) throws Exception;
/** 사용자의 SNS 연동 리스트를 조회한다.
* @param vo
* @return
* @throws Exception
*/
public List<OAuthUniversalUser> selectSnsSignUpList(NlibLoginVO vo) throws Exception;
/** 정보를 수정한다.
* @param vo
* @throws Exception
*/
public void updateMyInfo(NlibLoginVO vo) throws Exception;
/** 가입문화원 리스트를 조회한다.
* @param vo
* @return
*/
public List<MemberSiteVO> selectCenterSignUpList(NlibLoginVO vo) throws Exception;
/** SNS연동을 해지한다.
* @param oAuthVO
*/
public void deleteSnsLink(OAuthUniversalUser oAuthVO) throws Exception;
/** 문화원가입을 해지한다.
* @param siteVO
*/
public void deleteCenterLink(MemberSiteVO siteVO) throws Exception;
/** 사용자의 정보를 조회한다.
* @param vo
* @return
*/
public NlibLoginVO selectMyInfo(NlibLoginVO vo) throws Exception;
}

View File

@ -1,14 +1,42 @@
package nlib.user.service.impl;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import egovframework.com.ext.oauth.service.OAuthUniversalUser;
import egovframework.rte.fdl.cryptography.EgovPasswordEncoder;
import nlib.cmm.crypto.AriaCrypto;
import nlib.user.service.MemberService;
import nlib.user.service.MemberSiteVO;
import nlib.user.service.NlibLoginVO;
import nlib.user.service.UserInfoService;
/**
* <pre>
* @Class Name : UserInfoServiceImpl.java
*
* @Description : 사용자의 정보를 조회하는 서비스
*
*
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
*
* </pre>
*
* @ ------------ -------- ---------------------------
* @ 수정일 수정자 수정내용
* @ ------------ -------- ---------------------------
* @ 2021. 9. 7. JSYOO 최초 생성
*
*
* @author 이씨플라자 * DIGITALSHIP JSYOO
* @since 2021. 9. 7.
* @version 1.0
*
*/
@Service("userInfoService")
public class UserInfoServiceImpl implements UserInfoService
{
@ -18,12 +46,60 @@ public class UserInfoServiceImpl implements UserInfoService
@Resource(name = "egovEnvPasswordEncoderService")
EgovPasswordEncoder egovPasswordEncoder;
@Resource(name = "ariaCrypto")
AriaCrypto ariaCrypto;
public NlibLoginVO selectMyInfo(NlibLoginVO vo) throws Exception {
return userInfoDAO.selectMyInfo(vo);
/* 사용자의 SNS 연동 리스트를 조회한다.
* (non-Javadoc)
* @see nlib.user.service.UserInfoService#selectSnsSignUpList(nlib.user.service.NlibLoginVO)
*/
public List<OAuthUniversalUser> selectSnsSignUpList(NlibLoginVO vo) throws Exception {
return userInfoDAO.selectSnsSignUpList(vo);
}
/* 정보를 수정한다.
* (non-Javadoc)
* @see nlib.user.service.UserInfoService#updateMyInfo(nlib.user.service.NlibLoginVO)
*/
public void updateMyInfo(NlibLoginVO vo) throws Exception {
//회원정보 암호화
vo.encodePrivateInfo();
userInfoDAO.updateMyInfo(vo);
}
/* 가입문화원 리스트를 조회한다.
* (non-Javadoc)
* @see nlib.user.service.UserInfoService#selectCenterSignUpList(nlib.user.service.NlibLoginVO)
*/
public List<MemberSiteVO> selectCenterSignUpList(NlibLoginVO vo) throws Exception {
return userInfoDAO.selectCenterSignUpList(vo);
}
/* SNS연동을 해지한다.
* (non-Javadoc)
* @see nlib.user.service.UserInfoService#deleteSnsLink(egovframework.com.ext.oauth.service.OAuthUniversalUser)
*/
public void deleteSnsLink(OAuthUniversalUser oAuthVO) throws Exception {
userInfoDAO.deleteSnsLink(oAuthVO);
}
/* 문화원 가입을 해지한다.
* (non-Javadoc)
* @see nlib.user.service.UserInfoService#deleteCenterLink(nlib.user.service.MemberSiteVO)
*/
public void deleteCenterLink(MemberSiteVO siteVO) throws Exception {
userInfoDAO.deleteCenterLink(siteVO);
}
/* 사용자의 정보를 조회한다.
* (non-Javadoc)
* @see nlib.user.service.UserInfoService#selectMyInfo(nlib.user.service.NlibLoginVO)
*/
public NlibLoginVO selectMyInfo(NlibLoginVO vo) throws Exception {
vo.setMobileNo(ariaCrypto.encode(vo.getMobileNo()));
NlibLoginVO loginVO =userInfoDAO.selectMyInfo(vo);
// 개인정보 암호화 내용 복호화 처리
if(loginVO != null) {
loginVO.setMobileNo(AriaCrypto.decode(loginVO.getMobileNo()));
}
return loginVO;
}
}

View File

@ -23,6 +23,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.commons.lang.StringUtils;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
@ -60,6 +61,7 @@ import egovframework.com.ext.oauth.service.OAuthLogin;
import egovframework.com.ext.oauth.service.OAuthUniversalUser;
import egovframework.com.ext.oauth.service.OAuthVO;
import egovframework.rte.fdl.cryptography.EgovPasswordEncoder;
import nlib.cmm.NlibCommonController;
import nlib.cmm.crypto.AriaCrypto;
import nlib.cmm.service.NlibProperty;
import nlib.cmm.session.SessionConfig;
@ -69,6 +71,7 @@ import nlib.info.service.InformService;
import nlib.mail.EmailSender;
import nlib.mail.service.EmailVO;
import nlib.restful.service.DataApiReqVO;
import nlib.user.service.LoginService;
import nlib.user.service.MemberService;
import nlib.user.service.NlibLoginVO;
import nlib.user.service.MemberSiteVO;
@ -76,6 +79,7 @@ import nlib.user.service.UserInfoService;
import nlib.util.StringUtil;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.security.core.Authentication;
/**
* <pre>
@ -101,7 +105,7 @@ import org.springframework.mail.javamail.JavaMailSender;
*/
@Controller
public class MemberController {
public class MemberController extends NlibCommonController{
//-------------------------------------------
// SNS 연동 환경설정 정보 : context-oauth.xml 참고
@ -125,6 +129,9 @@ public class MemberController {
@Resource(name="informService")
private InformService informService;
@Resource(name="loginService")
private LoginService loginService;
@Resource(name = "egovEnvPasswordEncoderService")
EgovPasswordEncoder egovPasswordEncoder;
@ -187,6 +194,10 @@ public class MemberController {
*/
@RequestMapping(value="/member/selectMemberJoiningInfo.do")
public String selectMemberJoiningInfo(HttpServletRequest req,ModelMap model,HttpSession session) throws Exception {
//이용약관 개인정보제공동의
HashMap<String, String> termRet = informService.selectTermsInfo(NlibProperty.getString("nlib.council.cd"));
HashMap<String, String> privacyRet = informService.selectPrivacyInfo(NlibProperty.getString("nlib.council.cd"));
String jsessionId = session.getId();
OAuthUniversalUser oauthUser = SessionConfig.getNewMemberInfo(jsessionId);
@ -200,6 +211,14 @@ public class MemberController {
model.addAttribute("url","/nlib"+NlibProperty.getString("login.url"));
return "nlib/cmm/alert";
}
model.addAttribute("termTitle", termRet.get("TITLE"));
model.addAttribute("termContent", termRet.get("CONTENT"));
model.addAttribute("privacyTitle", privacyRet.get("TITLE"));
model.addAttribute("privacyContent", privacyRet.get("CONTENT"));
return "/nlib/member/selectMemberJoiningInfo";
}
@ -305,7 +324,7 @@ public class MemberController {
if(!(vo.getMobileVrfctNo().equals(oauthUser.getNlibVO().getMobileVrfctNo()))
||oauthUser.getNlibVO().getMobileVrfctDd() == null)
{
model.addAttribute("msg","핸드폰인증에 문제가 있습니다. 다시 회원가입을 진행해주세요.");
model.addAttribute("msg","핸드폰인증이 정상적이지않습니다. 다시 회원가입을 진행해주세요.");
model.addAttribute("url","${pageContext.request.contextPath}"+NlibProperty.getString("member.new.url"));
return "nlib/cmm/alert";
}
@ -318,7 +337,7 @@ public class MemberController {
if(!(vo.getEmailVrfctDd().equals(oauthUser.getNlibVO().getEmailVrfctDd()))
||oauthUser.getNlibVO().getEmailVrfctDd() == null)
{
model.addAttribute("msg","이메일인증에 문제가 있습니다. 다시 회원가입을 진행해주세요.");
model.addAttribute("msg","이메일인증이 정상적이지않습니다. 다시 회원가입을 진행해주세요.");
model.addAttribute("url","${pageContext.request.contextPath}"+NlibProperty.getString("member.new.url"));
return "nlib/cmm/alert";
}
@ -379,9 +398,24 @@ public class MemberController {
* @exception Exception
*/
@RequestMapping(value="/member/emailCertNum.ajax" , method=RequestMethod.POST)
public @ResponseBody void emailCertNum(HttpServletResponse response,HttpServletRequest request,HttpSession session) throws Exception{
public @ResponseBody Map<String,String> emailCertNum(HttpServletResponse response,HttpServletRequest request,HttpSession session) throws Exception{
String email = request.getParameter("email");
Map<String,String> map = new HashMap<String,String>();
OAuthUniversalUser authUser= new OAuthUniversalUser();
authUser.setSnsUserId(email);
authUser.setSnsEmail(email);
//중복된 아이디가 있을시
if(memberService.selectAlreadySignUpId(authUser) != null)
{
map.put("msg","이미 사용중인 이메일입니다.");
map.put("emailCertYn","N");
return map;
}
EmailVO emailVO = new EmailVO();
//인증번호 생성
String CertNumber=memberService.numberGen(6,1);
System.out.println(CertNumber);
@ -398,6 +432,7 @@ public class MemberController {
oauthUser.setNlibVO(vo);
SessionConfig.setNewMemberInfo(jsessionId,oauthUser);
//이메일 발송
// 결과가 정상이면, 안내 메일 발송
// > 템플릿파일에서 내용 mailing.sender.membership.template
@ -426,8 +461,9 @@ public class MemberController {
emailVO.setSubject(subject);
emailVO.setContent(contents);
emailSender.SendEmail(emailVO);
//------------
map.put("msg","이메일 인증번호가 발송됐습니다.");
map.put("emailCertYn","Y");
return map;
}
/**
@ -519,6 +555,19 @@ public class MemberController {
}
}
/**
* 회원탈퇴
* @exception Exception
*/
@RequestMapping(value="/member/deleteMembershipForm.do")
public String deleteMembershipForm(HttpServletResponse response,Authentication authentication,HttpServletRequest request,ModelMap model) throws Exception{
//사용자 정보를 가져온다.
NlibLoginVO loginVO = getNlibLoginVO(authentication);
loginVO.decodePrivateInfo();
loginVO.setLoginUserId(maskingEmail(loginVO.getLoginUserId()));
model.addAttribute("loginVO",loginVO);
return "nlib/member/deleteMembershipForm";
}
/**
* 비밀번호초기화
* @exception Exception
@ -548,7 +597,7 @@ public class MemberController {
String encodedText=null;
//ID와 핸드폰 번호가 일치하는지 확인
if(loginVO!=null && (loginVO.getMobileNo().equals(vo.getMobileNo()) && loginVO.getLoginUserId().equals(vo.getLoginUserId())))
if(loginVO!=null && loginVO.getLoginUserId().equals(vo.getLoginUserId()))
{
String reciver = vo.getLoginUserId(); //받을사람의 이메일입니다.-> naver nate 등등
String subject = "온라인자료대출시스템 비밀번호 초기화 메일입니다.";
@ -572,7 +621,7 @@ public class MemberController {
contents+=readLine;
}
encodedText = egovPasswordEncoder.encryptPassword(InitPwd);
encodedText = egovPasswordEncoder.encryptPassword(loginVO.getLoginUserId()+InitPwd);
vo.setPassword(encodedText);
vo.setMbInfoId(gUserId);
@ -598,7 +647,62 @@ public class MemberController {
return message;
}
/**
* 비밀번호 변경
* @exception Exception
*/
@RequestMapping(value="/member/changePassword.ajax")
public @ResponseBody String changePassword(Authentication authentication,HttpServletResponse response,HttpServletRequest request,ModelMap model) throws Exception{
//사용자 정보를 가져온다.
NlibLoginVO loginVO = getNlibLoginVO(authentication);
loginVO.setJoinCouncilCd(getCurCouncilCd(request));
loginVO = loginService.selectLoginUserInfo(loginVO);
String password=egovPasswordEncoder.encryptPassword(loginVO.getLoginUserId()+request.getParameter("password"));
String newPassword=egovPasswordEncoder.encryptPassword(loginVO.getLoginUserId()+request.getParameter("newPassword"));
String message="";
if(loginVO!=null && (loginVO.getPassword().equals(password)))
{
loginVO.setPassword(newPassword);
//암호화된 비밀번호로 수정
memberService.changePassword(loginVO);
message="비밀번호 변경이 처리되었습니다.";
}else {
message="기존 비밀번호가 올바르지 않습니다.";
}
return message;
}
/** * 이메일 masking 후 리턴<br> * 변환 실패시 입력값 그대로 리턴<br> * 이메일 아이디 앞 2자리 노출<br> * 마스킹 처리는 글자수 상관없이 5자리로 노출 * */
public String maskingEmail(String email){
try{
if(StringUtils.isEmpty(email) || !email.contains("@")){
return email;
}
String[] emailSplited = email.split("@");
if(emailSplited.length != 2){
return email;
}
if(emailSplited[0].length() > 2){
String str="";
for(int i=2;emailSplited[0].length()>i;i++)
{
str+="*";
}
return email.substring(0, 2) + str+"@" + emailSplited[1];
}
else{
return email;
}
}
catch (Exception e){
} return email;
}
/**
* 회원가입 SNS 구글인증
* @exception Exception

View File

@ -1,7 +1,9 @@
package nlib.user.web;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
@ -9,18 +11,25 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import egovframework.com.ext.oauth.service.OAuthUniversalUser;
import egovframework.rte.fdl.cryptography.EgovPasswordEncoder;
import nlib.restful.service.DataApiReqVO;
import nlib.security.SecUserVO;
import nlib.user.service.LoginService;
import nlib.user.service.MemberService;
import nlib.user.service.MemberSiteVO;
import nlib.user.service.NlibLoginVO;
import nlib.user.service.UserInfoService;
import nlib.cmm.NlibCommonController;
import nlib.cmm.service.NlibProperty;
/**
@ -46,11 +55,14 @@ import nlib.user.service.UserInfoService;
*
*/
@Controller
public class UserInfoController {
public class UserInfoController extends NlibCommonController {
@Resource(name="userInfoService")
private UserInfoService userInfoService;
@Resource(name="loginService")
private LoginService loginService;
@Resource(name = "egovEnvPasswordEncoderService")
EgovPasswordEncoder egovPasswordEncoder;
@ -69,20 +81,36 @@ public class UserInfoController {
*/
@RequestMapping(value="/userInfo/putMyInfo.do")
public String putMyInfo(NlibLoginVO vo,HttpServletResponse response,HttpServletRequest request,Authentication authentication,ModelMap model) throws Exception{
NlibLoginVO loginVO =userInfoService.selectMyInfo(vo);
//사용자 정보를 가져온다.
NlibLoginVO loginVO = getNlibLoginVO(authentication);
loginVO.setJoinCouncilCd(getCurCouncilCd(request));
loginVO = loginService.selectLoginUserInfo(loginVO);
List<OAuthUniversalUser> snsList = new ArrayList<OAuthUniversalUser>();
List<MemberSiteVO> centerList = new ArrayList<MemberSiteVO>();
//sns연동 계정 리스트
snsList = userInfoService.selectSnsSignUpList(loginVO);
//가입된 문화원 리스트
centerList = userInfoService.selectCenterSignUpList(loginVO);
String encodedText=null;
encodedText = egovPasswordEncoder.encryptPassword(vo.getPassword());
encodedText = egovPasswordEncoder.encryptPassword(loginVO.getLoginUserId()+vo.getPassword());
vo.setPassword(encodedText);
//암호화된 패스워드 비교
if(loginVO.getPassword().equals(vo.getPassword())) {
model.addAttribute("loginVO",loginVO);
model.addAttribute("centerList",centerList);
model.addAttribute("snsList",snsList);
return "nlib/userInfo/putMyInfo";
}else {
String message="비밀번호가 잘못되었습니다.";
model.addAttribute("message",message);
return "nlib/userInfo/pwCertMyInfo";
model.addAttribute("msg","비밀번호가 일치하지않습니다.");
model.addAttribute("url","/nlib/userInfo/pwCertMyInfo.do");
return "nlib/cmm/alert";
}
}
@ -100,6 +128,7 @@ public class UserInfoController {
userInfoService.updateMyInfo(vo);
}
/**
* 정보 수정 password 인증
* @exception Exception
@ -109,4 +138,31 @@ public class UserInfoController {
return "nlib/userInfo/pwCertMyInfo";
}
/** SNS연동을 해지한다.
* @param response
* @param request
* @return
* @return
* @throws Exception
*/
@RequestMapping(value="/userInfo/deleteSnsLink.ajax")
public @ResponseBody void deleteSnsLink(HttpServletResponse response,HttpServletRequest request) throws Exception{
OAuthUniversalUser oAuthVO = new OAuthUniversalUser();
oAuthVO.setMbSnsId(request.getParameter("mbSnsId"));
userInfoService.deleteSnsLink(oAuthVO);
}
/** 문화원 가입을 해지한다.
* @param response
* @param request
* @return
* @throws Exception
*/
@RequestMapping(value="/userInfo/deleteCenterLink.ajax")
public @ResponseBody void deleteCenterLink(HttpServletResponse response,HttpServletRequest request) throws Exception{
MemberSiteVO siteVO = new MemberSiteVO();
siteVO.setMbSiteId(request.getParameter("mbSiteId"));
userInfoService.deleteCenterLink(siteVO);
}
}

View File

@ -75,14 +75,13 @@
<!-- 비밀번호 변경 -->
<update id="changePassword" parameterType="nlib.user.service.NlibLoginVO">
UPDATE
TMP_SM_USER
MB_INFO
SET
USER_PWD=#{userPwd}
,MOD_ID = #{userId}
,MOD_DD = SYSDATE()
PASSWORD=#{password}
,MOD_ID = #{mbInfoId}
,MOD_DD = NOW()
WHERE 1=1
AND LOGIN_USER_ID = #{loginUserId}
AND TEL_NO = #{telNo}
</update>
<!-- 회원가입시 SNS인증한 계정 ID와 일치하는 계정이 있는지 체크 -->
@ -108,6 +107,7 @@
MB_SNS
WHERE 1=1
AND SNS_USER_ID = #{snsUserId}
AND UNLINK_DD IS NULL
) MB
GROUP BY MB_INFO_ID
</select>
@ -122,6 +122,7 @@
MB_INFO
WHERE 1=1
AND MOBILE_NO = #{mobileNo}
LIMIT 1
</select>
<!-- 회원가입시 sns 계정 추가 , 기존 계정 ID와 일치시 통합처리시 추가 -->
@ -190,7 +191,8 @@
MB_SITE
WHERE 1=1
AND MB_INFO_ID = #{mbInfoId}
AND JOIN_COUNCIL_CD = #{joinCouncilCd};
AND JOIN_COUNCIL_CD = #{joinCouncilCd}
AND UNLINK_DD IS NULL;
</select>
<!-- SnsId로 기가입자인지 판별 -->
@ -201,6 +203,8 @@
MB_SNS
WHERE 1=1
AND SNS_ID = #{snsId}
AND SNS_TYPE = #{snsType};
AND SNS_TYPE = #{snsType}
AND UNLINK_DD IS NULL
</select>
</mapper>

View File

@ -5,7 +5,6 @@
<resultMap type="nlib.user.service.NlibLoginVO" id="NlibLoginVO">
<result column="MB_INFO_ID" property="mbInfoId"/>
<result column="LOGIN_USER_ID" property="loginUserId"/>
<result column="USER_DIV" property="userDiv"/>
<result column="NAME" property="name"/>
<result column="PASSWORD" property="password"/>
<result column="BIRTHDAY" property="birthday"/>
@ -16,34 +15,119 @@
<result column="GENDER" property="gender"/>
<result column="REG_ID" property="regId"/>
<result column="MOD_ID" property="modId"/>
</resultMap>
<select id="selectMyInfo" parameterType="nlib.user.service.NlibLoginVO" resultMap="NlibLoginVO">
<resultMap type="egovframework.com.ext.oauth.service.OAuthUniversalUser" id="OAuthUniversalUser">
<result column="MB_SNS_ID" property="mbSnsId"/>
<result column="MB_INFO_ID" property="mbInfoId"/>
<result column="SNS_TYPE" property="snsType"/>
<result column="SNS_ID" property="snsId"/>
<result column="SNS_USER_ID" property="snsUserId"/>
<result column="REG_DD" property="regDd"/>
</resultMap>
<resultMap type="nlib.user.service.MemberSiteVO" id="MemberSiteVO">
<result column="MB_SITE_ID" property="mbSiteId"/>
<result column="MB_INFO_ID" property="mbInfoId"/>
<result column="JOIN_TYPE" property="joinType"/>
<result column="JOIN_AGREE_DD" property="joinAgreeDd"/>
<result column="JOIN_COUNCIL_CD" property="joinCouncilCd"/>
<result column="JOIN_COUNCIL_NM" property="joinCouncilNm"/>
<result column="MASTER_YN" property="masterYn"/>
</resultMap>
<!-- sns계정 리스트 -->
<select id="selectSnsSignUpList" parameterType="nlib.user.service.NlibLoginVO" resultMap="OAuthUniversalUser">
SELECT
LOGIN_USER_ID
MB_SNS_ID
,MB_INFO_ID
,SNS_TYPE
,SNS_ID
,SNS_USER_ID
,REG_DD
FROM
TMP_SM_USER
MB_SNS
WHERE 1=1
AND USER_ID="U2000000003"
AND MB_INFO_ID = #{mbInfoId}
AND UNLINK_DD IS NULL
</select>
<update id="updateMyInfo" parameterType="nlib.user.service.NlibLoginVO">
UPDATE
TMP_SM_USER
SET
USER_NM=#{userNm}
,USER_PWD=#{userPwd}
,BIRTHDATE=#{birthdate}
,GENDER=#{gender}
,TEL_NO=#{telNo}
,ZIPCODE=#{zipcode}
,ADDR1=#{addr1}
,ADDR2=#{addr2}
<!-- 사용자의 정보를 조회한다. -->
<select id="selectMyInfo" parameterType="nlib.user.service.NlibLoginVO" resultMap="NlibLoginVO">
SELECT
MB_INFO_ID
,LOGIN_USER_ID
,MOBILE_NO
FROM
MB_INFO
WHERE 1=1
AND USER_ID="U2000000003"
AND MOBILE_NO = #{mobileNo}
AND LOGIN_USER_ID = #{loginUserId}
</select>
<!-- 내 정보 수정 -->
<update id="updateMyInfo" parameterType="nlib.user.service.NlibLoginVO">
/* updateMyInfo */
UPDATE
MB_INFO
SET
NAME=#{name}
,BIRTHDAY=#{birthday}
,MOBILE_NO=#{mobileNo}
,ZIP_CODE=#{zipCode}
,ADDRESS=#{address}
,ADDRESS_DETAIL=#{addressDetail}
,GENDER=#{gender}
,MOD_ID=#{mbInfoId}
,MOD_DD=NOW()
WHERE 1=1
AND MB_INFO_ID=#{mbInfoId}
</update>
<!-- 가입문화원 리스트를 조회한다. -->
<select id="selectCenterSignUpList" parameterType="nlib.user.service.NlibLoginVO" resultMap="MemberSiteVO">
SELECT
mb.MB_SITE_ID
,mb.MB_INFO_ID
,mb.JOIN_TYPE
,mb.JOIN_AGREE_DD
,mb.JOIN_COUNCIL_CD
,sm.DEPT_NM JOIN_COUNCIL_NM
,mb.MASTER_YN
FROM
MB_SITE mb
LEFT OUTER JOIN
SM_DEPT sm
ON sm.ORG_CD = mb.JOIN_COUNCIL_CD
WHERE 1=1
AND MB_INFO_ID = #{mbInfoId}
AND UNLINK_DD IS NULL
ORDER BY mb.MB_SITE_ID
</select>
<!-- SNS연동을 해지한다. -->
<update id="deleteSnsLink" parameterType="egovframework.com.ext.oauth.service.OAuthUniversalUser">
UPDATE
MB_SNS
SET
UNLINK_DD=NOW()
WHERE 1=1
<if test="mbSnsId != null">
AND MB_SNS_ID = #{mbSnsId};
</if>
<if test="mbInfoId != null">
AND MB_INFO_ID = #{mbInfoId};
</if>
</update>
<!-- 문화원의 가입을 해지한다. -->
<update id="deleteCenterLink" parameterType="nlib.user.service.MemberSiteVO">
UPDATE
MB_SITE
SET
UNLINK_DD=NOW()
WHERE 1=1
<if test="mbSiteId != null">
AND MB_SITE_ID = #{mbSiteId};
</if>
<if test="mbInfoId != null">
AND MB_INFO_ID = #{mbInfoId};
</if>
</update>
</mapper>

View File

@ -0,0 +1,45 @@
<%
/**
* <pre>
* @Class Name : deleteMembershipForm.jsp
*
* @Description : 회원탈퇴폼
*
*
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
*
* </pre>
*
* @ ------------ -------- ---------------------------
* @ 수정일 수정자 수정내용
* @ ------------ -------- ---------------------------
* @ 2021. 9. 9. JSYOO 최초 생성
*
*
* @author 이씨플라자 * DIGITALSHIP JSYOO
* @since 2021. 9. 9.
* @version 1.0
*
*/
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<form id="deleteMembershipForm" name="deleteMembershipForm">
<p1>회원탈퇴</p1><br>
이름 : <c:out value="${loginVO.name }"/><br>
이메일 : <c:out value="${loginVO.loginUserId }"/><br>
<input type="password" id="password" name="password" placeholder="비밀번호"><br>
<input type="button" value="탈퇴하기"><input type="button" onclick="location.href='${pageContext.request.contextPath}/userInfo/putMyInfo.do'" value="취소">
</form>
</body>
</html>

View File

@ -43,6 +43,8 @@ function goFindPw(){
var data = $("form[name=initPw]").serialize();
if(confirm("비밀번호를 초기화 하시겠습니까?"))
{
$.ajax({
url : "/nlib/member/initPassword.ajax",
type : "POST",
@ -57,6 +59,9 @@ function goFindPw(){
}
})
}
}
</script>
</head>
<body>

View File

@ -110,15 +110,12 @@ $(document).ready(function() {
if($("#snsMobileNo").val() == $("#mobileNo").val())
{
$("#mobileCertYn").val("Y");
$("#mobileCertForm").css("display","none");
$("#mobileCertSendBtn").css("display","none");
$("#mobileCertForm").css("display","none");
}else{
$("#mobileCertYn").val("N");
$("#mobileCertForm").css("display","block")
$("#mobileCertSendBtn").css("display","block");
}
});
<%
//아이디가 변하는것 실시간 감지
@ -127,17 +124,13 @@ $(document).ready(function() {
if($("#snsUserId").val() == $("#loginUserId").val())
{
$("#emailCertYn").val("Y");
$("#emailCertForm").css("display","none");
$("#emailCertSendBtn").css("display","none");
$("#emailCertForm").css("display","none");
}else{
$("#emailCertYn").val("N");
$("#emailCertForm").css("display","block")
$("#emailCertSendBtn").css("display","block");
}
$("#emailCertYn").val("N");
$("#getEmailCert").css("display","block")
//snsUserId
});
})
<%
@ -160,11 +153,18 @@ function emailCert(){
async: false,
data : {"email" : $("#loginUserId").val()},
success : function(result){
alert("이메일 인증번호가 발송됐습니다.");
$("#emailCertYn").val("N");
//인증번호 확인창
$("#emailCertForm").css("display","block")
alert(result.msg);
if(result.emailCertYn=="Y")
{
$("#emailCertYn").val("Y");
$("#emailCertForm").css("display","block")
}
if(result.emailCertYn=="N")
{
$("#emailCertYn").val("N");
$("#emailCertForm").css("display","none")
}
},error : function(){
}
})
@ -221,6 +221,7 @@ function mobileCert(){
success : function(result){
alert("인증번호가 발송됐습니다.");
$("#mobileCertYn").val("N");
$("#mobileCertForm").css("display","block")
},error : function(){
}
})

View File

@ -22,8 +22,14 @@
*
*/
%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
@ -32,6 +38,18 @@
<title>Insert title here</title>
<script>
function snsCertForm(){
if(document.getElementsByName('agree')[0].focus())
{
alert("이용약관에 동의해주세요.");
document.termsForm.agree[0].focus()
return false;
}
if(document.getElementsByName('agree')[1].focus())
{
alert("개인정보처리정책에 동의해주세요.");
document.termsForm.agree[1].focus()
return false;
}
if(document.getElementById('agree').checked)
{
location.href="${pageContext.request.contextPath}/member/insertMemberInfoForm.do";
@ -44,9 +62,15 @@ function snsCertForm(){
</head>
<body>
<div style="width:500px;">
<textarea style="height:200px;width:500px;">${result.info["terms"]}</textarea>
<br><div style="float: right;"><input type="checkbox" id="agree" >동의</div>
<form id="termsForm" name="termsForm">
<p1><c:out value="${termTitle}" escapeXml="false"/></p1>
<textarea style="height:200px;width:500px;"><c:out value="${termContent}" escapeXml="false"/></textarea>
<br><div style="float: right;"><input type="checkbox" name="agree" >동의</div>
<p1><c:out value="${privacyTitle}" escapeXml="false"/></p1>
<textarea style="height:200px;width:500px;"><c:out value="${privacyContent}" escapeXml="false"/></textarea>
<br><div style="float: right;"><input type="checkbox" name="agree" >동의</div>
<br><br><input type="button" value="다음" onclick="snsCertForm();" style="float: right;">
</form>
</div>
</body>
</html>

View File

@ -38,12 +38,40 @@
<title>Insert title here</title>
<script type="text/javaScript" language="javascript" defer="defer">
$(document).ready(function() {
// sns연동이 하나일때 연결해제버튼 제거
if($("input[name='unlinkBtn']").length==1)
{
$("input[name='unlinkBtn']").remove();
};
<%
//새비밀번호,새비밀번호확인이 일치하는지 확인
%>
$("#newPassword,#newPasswordConfirm").on("propertychange change keyup paste", function() {
if($("#newPassword").val() == $("#newPasswordConfirm").val())
{
$("#passwordMsg *").remove();
$("#passwordMsg").append("<a>비밀번호가 일치합니다.</a>");
}else{
$("#passwordMsg *").remove();
$("#passwordMsg").append("<a>비밀번호가 일치하지않습니다.</a>");
}
});
<%
//핸드폰 번호가 변하는것 실시간 감지
%>
$("#mobileNo").on("propertychange change keyup paste input", function() {
if($("#snsMobileNo").val() == $("#mobileNo").val())
{
$("#mobileCertYn").val("Y");
$("#mobileCertSendBtn").css("display","none");
$("#mobileCertForm").css("display","none");
}else{
$("#mobileCertYn").val("N");
$("#mobileCertSendBtn").css("display","block");
}
});
$("input:radio[name='gender']:radio[value='${loginVO.gender}']").prop("checked",true);
var birthday='${loginVO.birthday}';
@ -51,19 +79,9 @@ $(document).ready(function() {
$("#birth_yy").val(birthday.substr(0,4));
$("#birth_mm").val(birthday.substr(4,2));
$("#birth_dd").val(birthday.substr(6,2));
alert("22222 <c:out value="${loginVO.address}" escapeXml="false"/>");
})
function update(){
var p = document.getElementById('password');
var p_cf = document.getElementById('passwordConfirm');
if(p.value != p_cf.value)
{
alert("비밀번호가 일치하지 않습니다. 확인해 주세요.");
p_cf.focus();
return false;
}
if(!checkBirthday())
{
alert("생년월일이 형식에 맞지 않습니다. 확인해주세요.");
@ -100,10 +118,34 @@ function update(){
}
})
return false;
}else{
}
return false;
}
function changePassword(){
var p = document.getElementById('newPassword');
var p_cf = document.getElementById('newPasswordConfirm');
if(p.value != p_cf.value)
{
alert("새 비밀번호가 일치하지 않습니다. 확인해 주세요.");
p_cf.focus();
return false;
}
$.ajax({
url : "/nlib/member/changePassword.ajax",
type : "POST",
async: false,
data : {"password" : $("#password").val()
,"newPassword" : $("#newPassword").val()
},
success : function(result){
alert(result);
},error : function(){
}
})
return false;
}
<%
@ -128,7 +170,7 @@ function mobileCert(){
data : {"mobileNo" : $("#mobileNo").val()},
success : function(result){
alert("인증번호가 발송됐습니다.");
//인증번호 확인창
$("#mobileCertYn").val("N");
$("#mobileCertForm").css("display","block")
},error : function(){
@ -139,14 +181,14 @@ function mobileCert(){
<%
//핸드폰 인증번호 확인
%>
function certNumCheck(){
function certMobileCheck(){
<%
//ajax 사용자가 입력한 번호를 보내 RESTfull server에서 확인 success or fail 반환 (3분이내인지도)
%>
$.ajax({
url : "/nlib/member/mobileCertNumChk.ajax",
type : "POST",
data : {"mobileCertNum" : $("#mobileCertNum").val(),
data : {"mobileVrfctNo" : $("#mobileVrfctNo").val(),
"mobileNo" : $("#mobileNo").val()},
async: false,
success : function(result){
@ -255,6 +297,53 @@ function calcAge(birth) {
var age = monthDay < birthdaymd ? year - birthdayy - 1 : year - birthdayy;
return age;
}
<%
/* SNS 연동해지 */
%>
function snsUnlink(snsId){
if(confirm("SNS연동을 해지하시겠습니까?"))
{
$.ajax({
url : "${pageContext.request.contextPath}/userInfo/deleteSnsLink.ajax",
type : "POST",
async: false,
data : {mbSnsId:snsId},
success : function(result){
alert("연동이 해지되었습니다.");
$("#s"+snsId).remove();
if($("input[name='unlinkBtn']").length==1)
{
$("input[name='unlinkBtn']").remove();
};
},error : function(){
}
})
}
}
<%
/* 문화원 가입해지 */
%>
function centerUnlink(siteId){
if(confirm("문화원 가입을 해제하시겠습니까?"))
{
$.ajax({
url : "${pageContext.request.contextPath}/userInfo/deleteCenterLink.ajax",
type : "POST",
async: false,
data : {mbSiteId:siteId},
success : function(result){
alert("가입이 해지되었습니다.");
$("#c"+siteId).remove();
},error : function(){
}
})
}
}
</script>
<style type="text/css">
@ -370,45 +459,100 @@ label.error {
<input type="text" id="birth_dd" name="birth_dd" size="2" maxlength="2" placeholder="일" size="4" required>
</td>
</tr>
<tr>
<td id="title">비밀번호</td>
<td>
<input type="password" id="password" name="password" minlength="8" maxlength="16"
oninvalid="this.setCustomValidity('8~16자 영문 대 소문자, 숫자, 특수문자를 사용하세요.')"
oninput="this.setCustomValidity('')"
pattern="^(?=.*[A-Z])(?=.*[a-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,16}$" required>
</td>
</tr>
<tr>
<td id="title">비밀번호 확인</td>
<td>
<input type="password" id="passwordConfirm" name="passwordConfirm" minlength="8" maxlength="16" required>
</td>
</tr>
<tr>
<td id="title">주소</td>
<td>
<input type="text" id="zipCode" name="zipCode" value="<c:out value="${loginVO.zipCode}"/>" readonly ><button type="button" style="text-align:left;" class="btn-warning" onclick="goPopup()">주소검색</button><br>
<input type="text" id="zipCode" name="zipCode" value="<c:out value="${loginVO.zipCode}"/>" readonly ><button type="button" style="text-align:left;" class="btn-warning" onclick="sample6_execDaumPostcode()">주소검색</button><br>
<input type="text" id="address" name="address" value="<c:out value="${loginVO.address}" escapeXml="false"/>" readonly />
<input type="text" id="addressDetail" name="addressDetail" value="<c:out value="${loginVO.addressDetail}"/>" readonly />
<input type="text" id="addressDetail" name="addressDetail" value="<c:out value="${loginVO.addressDetail}"/>" />
</td>
</tr>
<tr>
<td id="title">휴대전화</td>
<td id="Cert">
<input type="text" id="mobileNo" name="mobileNo" required value="<c:out value="${loginVO.mobileNo}"/>" ><button type="button" style="text-align:left;" class="btn-warning" onclick="mobileCert()" required>인증번호 받기</button>
<div id="mobileCertForm" style="display:none;"><br><input type='text' id='mobileCertNum' name='mobileCertNum'> <button type='button' style='text-align:left;' class='btn-warning' onclick='certNumCheck()' >인증번호 확인</button></div>
<input type="text" id="mobileNo" name="mobileNo" required value="<c:out value="${loginVO.mobileNo}"/>" ><button type="button" id="mobileCertSendBtn" style="text-align:left;" class="btn-warning" onclick="mobileCert()" required>인증번호 받기</button>
<div id="mobileCertForm" style="display:none;"><br><input type='text' id='mobileVrfctNo' name='mobileVrfctNo'> <button type='button' style='text-align:left;' class='btn-warning' onclick='certMobileCheck()' >인증번호 확인</button></div>
</td>
</tr>
</table>
<br>
<input type="hidden" id="mobileCertYn" name="mobileCertYn" value=<c:out value="Y"/>>
<input type="hidden" id="birthday" name="birthday" >
<input type="hidden" id="mbInfoId" name="mbInfoId" value="<c:out value="${loginVO.mbInfoId}"/>" >
<input type="hidden" id="extMobileNo" name="extMobileNo" value="<c:out value="${loginVO.mobileNo}"/>">
<input type="submit" value="수정"/> <input type="button" onclick="javascript:location.href='${pageContext.request.contextPath}/userInfo/getMyInfo.do';" value="취소">
</form>
<a href="${pageContext.request.contextPath}/member/deleteMembershipForm.do">소장자료관을 더 이상 사용하고 싶지 않으신가요?</a>
</div>
<div>
<br>
<p1>SNS연동 </p1><br>
<c:forEach var="snsList" items="${snsList}" varStatus="status">
<a id="<c:out value="s${snsList.mbSnsId}" />"><c:out value="${snsList.snsType }" /> 이메일: <c:out value="${snsList.mbSnsId}" /> <c:out value="${snsList.regDd}" /> 연결완료 <input type="button" name="unlinkBtn" onclick=snsUnlink("<c:out value="${snsList.mbSnsId}" />"); value="연결해제"></a>
<br>
</c:forEach>
<br>
<p1>가입된 문화원 </p1><br>
<c:forEach var="centerList" items="${centerList}" varStatus="status">
<a id="<c:out value="c${centerList.mbSiteId}" />"><c:out value="${centerList.joinCouncilNm}" /><c:out value="${centerList.joinAgreeDd }" /> 가입완료 <c:if test="${centerList.masterYn ne 'Y'}"><input type="button" onclick=centerUnlink("<c:out value="${centerList.mbSiteId}" />"); value="가입해제"></c:if></a>
<br>
</c:forEach>
<p1>비밀번호 변경 </p1>
<form id="passwordForm" name="passwordForm" method="post" onsubmit="return changePassword()" >
<table>
<tr>
<td>
<input type="password" id="password" name="password"
placeholder="기존 비밀번호" required>
</td>
</tr>
<tr>
<td>
<input type="password" id="newPassword" name="newPassword" minlength="8" maxlength="16"
oninvalid="this.setCustomValidity('8~16자 영문 대 소문자, 숫자, 특수문자를 사용하세요.')"
oninput="this.setCustomValidity('')"
pattern="^(?=.*[A-Z])(?=.*[a-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,16}$"
placeholder="새 비밀번호" required>
</td>
</tr>
<tr>
<td>
<input type="password" id="newPasswordConfirm" name="newPasswordConfirm" placeholder="새 비밀번호 확인" minlength="8" maxlength="16" required>
</td>
<td> <div id="passwordMsg"></div></td>
</tr>
</table>
<input type="submit" value="변경하기"/>
<input type="button" value="취소"/>
</div>
</body>
<script src="//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js"></script>
<script>
function sample6_execDaumPostcode() {
new daum.Postcode({
oncomplete: function(data) {
// 팝업에서 검색결과 항목을 클릭했을때 실행할 코드를 작성하는 부분.
// 각 주소의 노출 규칙에 따라 주소를 조합한다.
// 내려오는 변수가 값이 없는 경우엔 공백('')값을 가지므로, 이를 참고하여 분기 한다.
var addr = ''; // 주소 변수
var extraAddr = ''; // 참고항목 변수
//사용자가 선택한 주소 타입에 따라 해당 주소 값을 가져온다.
if (data.userSelectedType === 'R') { // 사용자가 도로명 주소를 선택했을 경우
addr = data.roadAddress;
} else { // 사용자가 지번 주소를 선택했을 경우(J)
addr = data.jibunAddress;
}
// 우편번호와 주소 정보를 해당 필드에 넣는다.
document.getElementById('zipCode').value = data.zonecode;
document.getElementById("address").value = addr;
// 커서를 상세주소 필드로 이동한다.
document.getElementById("addressDetail").focus();
}
}).open();
}
</script>
</html>

View File

@ -51,7 +51,7 @@ function goPutMyInfo(){
<body>
<h2>비밀번호를 입력해주세요</h2>
<form id="pwInputForm" name="pwInputForm" method="POST">
<input type="password" id="userPwd" name="userPwd"><button style="text-align:left;" class="btn-warning" onclick="goPutMyInfo();">확인</button>
<input type="password" id="password" name="password" required><button style="text-align:left;" class="btn-warning" onclick="goPutMyInfo();">확인</button>
</form>
</body>
</html>