From dea76b7f2e90f38736c7a4dd3dc2161e6c4616cd Mon Sep 17 00:00:00 2001 From: swpark Date: Tue, 14 Dec 2021 06:37:46 +0000 Subject: [PATCH] =?UTF-8?q?<=EC=B6=94=EA=B0=80=EC=82=AC=ED=95=AD>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 개인정보수정 팝업 (p8) - 비밀번호 변경 90일 경과일 때 개인정보 변경 안내 - 신규 페이지 권한 추가 /Account/Pwchange 2. 휴면해제 안내 (p9) - 1년간 로그인 이력 없을시 휴면해제 안내 - 신규 페이지 권한 추가 /Account/DormantCancel 3. ID/PW 찾기 휴면 테이블에서도 검색 (p10) - user 테이블 검색 없을 시 휴면테이블 까지 검색 # 커밋 파일 Base\Controller\FOCommon.cs Dao\MyBatis\Maps\User.xml FO\Controllers\AccountController.cs FO\Views\Account\DormantCancel.cshtml FO\Views\Account\IndexBase.cshtml FO\Views\Account\PwChange.cshtml FO.csproj # 테스트 결과 - 이상없음 # 특이사항 및 이슈사항 - 이상없음 --- Base/Controller/FOCommon.cs | 72 +++++++++++++++++++++++++++++ Dao/MyBatis/Maps/User.xml | 34 ++++++++++++-- FO/Controllers/AccountController.cs | 57 ++++++++++++++++++++++- FO/Views/Account/IndexBase.cshtml | 17 ++++++- 4 files changed, 175 insertions(+), 5 deletions(-) diff --git a/Base/Controller/FOCommon.cs b/Base/Controller/FOCommon.cs index 977fb85..7f53c11 100644 --- a/Base/Controller/FOCommon.cs +++ b/Base/Controller/FOCommon.cs @@ -121,12 +121,75 @@ namespace NP.Base.Controllers { return JsonBack(new JsonRtn() { code = 1000, obj = -1, msg = u.subdomain }); } + //비밀번호 변경 90일 경과 + if (u.udt.AddDays(90) < DateTime.Now) + { + return JsonBack(new JsonRtn() { code = 1000, msg = "-2", obj = u.userno }); + } + // 휴면상태 + if (u.status == 8) + { + return JsonBack(new JsonRtn() { code = 1000, msg = "-3", obj = u.userno }); + } return JsonOK(u.userno); } } return JsonOK(0); } + /// + /// 비밀번호 변경 저장 (비밀번호 변경 90일 지난 사용자) + /// + /// + /// + public JsonResult PwChange(VMUser vm) + { + if (string.IsNullOrEmpty(vm.User.userpass) || vm.User.userpass.Trim() == "") + { + Dao.Save("users.resetuserpass", new Hashtable() { { "userno", vm.userno } }); + return JsonOK(1); + } + if (vm.userno > 0 && !string.IsNullOrEmpty(vm.User.userpass) && vm.User.userpass.Trim() != "") + { + if (Dao.Save("users.resetuserpass", new Hashtable() { { "userpass", NP.Base.Lib.KISA_SHA256.SHA256Hash(vm.User.userpass) }, { "userno", vm.userno } }) == 1) + { + var u = GoLogin(vm.User.userid, vm.User.userpass); + if (u != null) + { + return JsonOK(1); + } + } + } + return JsonOK(0); + } + + /// + /// 휴면해제 + /// + /// + /// + public JsonResult DormantCancel(int userno) + { + if (Dao.Get("users.dormants", new Hashtable() { { "userno", userno } }).Count() < 1) + { + return JsonBack(new JsonRtn() { code = 1 }); + } + var result = Dao.Save("users.dormant.cancel", new Hashtable() { { "usernos", userno }, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } }); + var user = Dao.Get("users.findmes", new Hashtable() { { "userno", userno } }).FirstOrDefault(); + if (user != null) + { + var u = GoLogin(user.userid, "rhksflwkfhrmdls999"); + if (u != null) + { + return JsonOK(result); + } + else + { + return JsonBack(new JsonRtn() { code = 2 }); + } + } + return JsonOK(0); + } [HttpPost] public JsonResult GetBoards(int btype, int pn, int prc, String sc) @@ -179,11 +242,20 @@ namespace NP.Base.Controllers if (string.IsNullOrEmpty(email)) { return JsonOK(-1); } email = email.Replace(" ", "").Replace(" ", ""); List users = new List() { }; + bool IsEmail = false; if (email.Contains("@")) { IsEmail = true; users = Dao.Get("users.findme", new Hashtable() { { "email", email } }).ToList(); + + if(users.Count() < 1) + { + // user 테이블 검색 뒤 없을 경우 휴면테이블에서 검색 + users = Dao.Get("users.findmes", new Hashtable() { { "email", email } }).ToList(); + + } + } //else //{ diff --git a/Dao/MyBatis/Maps/User.xml b/Dao/MyBatis/Maps/User.xml index a0b69b5..64cb95a 100644 --- a/Dao/MyBatis/Maps/User.xml +++ b/Dao/MyBatis/Maps/User.xml @@ -607,14 +607,14 @@ where status<>99 and userno in ($usernos$) --> + + + update users set pwcalltime=,pwcallno=#pwcallno# where userno=#userno# @@ -649,7 +673,11 @@ ,usertype ,pwcallno from users - where userno=#userno# and pwcallno=#pwcallno# and pwcalltime is not null and date_add(pwcalltime, interval 24 hour) > + where userno=#userno# + + and pwcallno=#pwcallno# and pwcalltime is not null and date_add(pwcalltime, interval 24 hour) > + + update users set userpass=#userpass#, pwcalltime=null,pwcallno=null where userno=#userno# and pwcalltime is not null and pwcallno=#pwcallno# and date_add(pwcalltime, interval 24 hour) > diff --git a/FO/Controllers/AccountController.cs b/FO/Controllers/AccountController.cs index 90e4b99..7ea4162 100644 --- a/FO/Controllers/AccountController.cs +++ b/FO/Controllers/AccountController.cs @@ -19,6 +19,11 @@ namespace NP.FO.Controllers { public class AccountController : FOOpenBaseController { + /// + /// ID/PW 찾기 + /// + /// + /// public ActionResult FindMe(VMUser vm) { vm.User = new Users() { }; @@ -989,9 +994,59 @@ namespace NP.FO.Controllers ViewBag.reason = reason; } return View(); - } + } #endregion + /// + /// 개인정보 변경안내(비밀번호 변경 90일 경과) + /// + /// + /// + public ActionResult PwChange(VMUser vm) + { + vm.User = new Users() { }; + if (SUserInfo.UserNo > 0) + { + vm.User = Dao.Get("users.pwuser", new Hashtable() { { "userno", SUserInfo.UserNo } }).FirstOrDefault(); + if (vm.User == null) + { + vm.User = new Users() { }; + vm.userno = -1; + } + vm.userno = vm.User.userno; + } + return View(vm); + } + + /// + /// 휴면해제 안내 + /// + /// + public ActionResult DormantCancel() + { + ViewBag.UserNo = SUserInfo.UserNo; + // 에듀윌 소스 (사용여부 ??) + if (Request.Cookies.Get("RTNURL") != null) + { + var cookie = Request.Cookies.Get("RTNURL"); + ViewBag.RTNURL = cookie.Value; + //원래 마케팅용이어서 expire는 제외 + //cookie.Expires = DateTime.Now.AddDays(-1); + //Response.Cookies.Add(cookie); + } + + if (ViewBag.UserNo > 0) + { + //인증링크 클릭 확인 + Users User = Dao.Get("users.dormants", new Hashtable() { { "userno", SUserInfo.UserNo } }).FirstOrDefault(); + if (User == null) + { + ViewBag.UserNo = -1; + } + } + return View(); + } + public ActionResult NaverCallback() { ViewBag.naverClientID = naverClientID; diff --git a/FO/Views/Account/IndexBase.cshtml b/FO/Views/Account/IndexBase.cshtml index fa35260..a1e4ea1 100644 --- a/FO/Views/Account/IndexBase.cshtml +++ b/FO/Views/Account/IndexBase.cshtml @@ -100,7 +100,22 @@ if (capResult.code == 1000) { if (capResult.obj == -1) { msg("고객사 사용자는 고객사사이트를 이용해주세요.", null, null, null, "location.href='https://" + capResult.msg + ".cte.or.kr/Account/Index'"); - } else { + } + else if (capResult.msg == "-2") { // 비밀번호 변경 90일 경과 + $("#mform").attr("action", "/Account/Pwchange"); + if ('@(Model.ru??"")' != "") { + $("#mform").attr("action", "@Model.ru".replace(/-/gi, '&')); + } + submit(); + } + else if (capResult.msg == "-3") { // 휴면해제안내 + $("#mform").attr("action", "/Account/DormantCancel"); + if ('@(Model.ru??"")' != "") { + $("#mform").attr("action", "@Model.ru".replace(/-/gi, '&')); + } + submit(); + } + else { $("#mform").attr("action", "/"); if ('@(Model.ru??"")' != "") { $("#mform").attr("action", "@Model.ru".replace(/-/gi, '&'));