From 41780ba32759dad87f90db8b916b044384adaedb Mon Sep 17 00:00:00 2001 From: iyak Date: Wed, 1 Oct 2025 07:59:10 +0000 Subject: [PATCH] =?UTF-8?q?=EC=95=84=EC=9D=B4=EB=94=94/=EB=B9=84=EB=B0=80?= =?UTF-8?q?=EB=B2=88=ED=98=B8=20=EC=B0=BE=EA=B8=B0=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?=EA=B0=9C=EB=B0=9C=20=EA=B1=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Base/Controller/FCommon.cs | 13 +- Base/Controller/FOCommon.cs | 126 +++++++++++------- Dao/MyBatis/Maps/User.xml | 58 ++++++++- FO/Controllers/AccountController.cs | 110 ++++++++-------- FO/Controllers/FOBaseController.cs | 123 +++--------------- FO/FO.csproj | 3 + FO/Views/Account/CertOk3IPIN.cshtml | 40 ++++-- FO/Views/Account/CertOk3MOBI.cshtml | 39 ++++-- FO/Views/Account/FindIDPW.cshtml | 65 ++++++++++ FO/Views/Account/FindMe.cshtml | 26 +++- FO/Views/Account/IndexBase.cshtml | 63 +++++---- FO/Views/Account/JoinIdVeri.cshtml | 28 +--- FO/Views/Account/NewPassword.cshtml | 194 ++++++++++++++++++++++++++++ FO/Views/My/MyInfoCheck.cshtml | 39 +++++- FO/Views/Shared/_Layout.cshtml | 4 + FO/css/dev.css | 56 ++++++++ FO/css/login.css | 26 +++- FO/css/style.css | 16 ++- FO/img/common/join_select03-4.png | Bin 0 -> 2179 bytes FO/js/site.js | 186 +++++++++++++++++++++++++- 20 files changed, 918 insertions(+), 297 deletions(-) create mode 100644 FO/Views/Account/FindIDPW.cshtml create mode 100644 FO/Views/Account/NewPassword.cshtml create mode 100644 FO/img/common/join_select03-4.png diff --git a/Base/Controller/FCommon.cs b/Base/Controller/FCommon.cs index e7b9096..291433b 100644 --- a/Base/Controller/FCommon.cs +++ b/Base/Controller/FCommon.cs @@ -1,13 +1,13 @@ -using System; +using NP.Base.Auth; +using NP.Base.ENUM; +using NP.Model; +using System; +using System.Collections; using System.Collections.Generic; using System.Linq; +using System.Text.RegularExpressions; using System.Web; using System.Web.Mvc; - -using NP.Model; -using System.Collections; -using NP.Base.Auth; -using NP.Base.ENUM; namespace NP.Base.Controllers { /// @@ -140,7 +140,6 @@ namespace NP.Base.Controllers return JsonOK(Dao.Save("lect.edub2b", e)); } - //[HttpPost] //public JsonResult SaveUserFile(String type, Int64? fgno) //{ diff --git a/Base/Controller/FOCommon.cs b/Base/Controller/FOCommon.cs index 9141fe2..4fb72db 100644 --- a/Base/Controller/FOCommon.cs +++ b/Base/Controller/FOCommon.cs @@ -1,16 +1,12 @@ -using IBatisNet.Common.Transaction; -using Newtonsoft.Json; +using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using NP.Base.Auth; -using NP.Base.ENUM; -using NP.Frame; using NP.Model; using System; using System.Collections; using System.Collections.Generic; using System.Linq; +using System.Text.RegularExpressions; using System.Web; -using System.Web.ModelBinding; using System.Web.Mvc; namespace NP.Base.Controllers @@ -47,55 +43,24 @@ namespace NP.Base.Controllers { Dao.Save("sys.file.down", fno); var file = Dao.Get("sys.file.get" + (getdel > 0 ? "all" : ""), fno).FirstOrDefault(); - //if (!string.IsNullOrEmpty(loginfo)) - //{ - // LogSet(GetLong(loginfo.Split('|')[0]), null, fno, GetInt(loginfo.Split('|')[1]), 5, null); - //} - //if (((file.tablename ?? "").ToUpper() +"."+ (file.columnname??"").ToUpper()).Equals("삭제체크테이블.삭제체크컬럼")) - //{ - // //프로젝트파일 권한 확인 - // if (Dao.Get("sys.file.authcheck.orderfgno", new Hashtable() { {"FGNo", file.fgno }, {"UserNo", SUserInfo.UserNo } }).First() < 1) - // { - // return; - // } - //} - //else if ((file.UsingTable ?? "").ToUpper().Equals("users.fgno")) - //{ - // //이력서파일 권한 확인 - // if (Dao.Get("sys.file.authcheck.usersfgno", new Hashtable() { { "FGNo", file.FGNo }, { "UserNo", SUserInfo.UserNo } }).First() < 1) - // { - // return; - // } - //} if (Request.UrlReferrer == null || (!SUserInfo.IsAdmin && file.tablename == "lectsd" && file.columnname == "fgno" && SUserInfo.UserNo != file.cno)) - { - //Response.AppendHeader("Content-Disposition", cds.ToString()); - //return File(string.Format("{0}\\{1}", uploadDir, entity.SaveFileName), "application/file"); + { Response.Clear(); Response.ClearHeaders(); Response.ClearContent(); Response.ContentType = "Application/octet-stream"; - Response.AppendHeader("Content-Disposition", "attachment;filename=" + Server.UrlEncode("권한없음.png")); - //Response.AppendHeader("Content-Length", file.filesize.ToString()); + Response.AppendHeader("Content-Disposition", "attachment;filename=" + Server.UrlEncode("권한없음.png")); Response.TransmitFile(string.Format("{0}", Server.MapPath("/img/repute_tail.png"))); Response.Flush(); Response.End(); } else { - string fileurl = Server.MapPath((issubject == 1 ? file.fullurl2 : file.fullurl)); - //var cds = new System.Net.Mime.ContentDisposition - //{ - // FileName = Server.UrlEncode(file.orgname), // 파일의 원래이름(등록할때의 이름) - // Inline = false, - //}; - //Response.AppendHeader("Content-Disposition", cds.ToString()); - //return File(string.Format("{0}\\{1}", uploadDir, entity.SaveFileName), "application/file"); + string fileurl = Server.MapPath((issubject == 1 ? file.fullurl2 : file.fullurl)); Response.Clear(); Response.ClearHeaders(); - Response.ClearContent(); - //Response.ContentType = "Application/octet-stream"; + Response.ClearContent(); Response.ContentType = "text/plain"; Response.AppendHeader("Content-Disposition", "attachment;filename=" + Server.UrlEncode(file.orgname)); Response.AppendHeader("Content-Length", file.filesize.ToString()); @@ -361,10 +326,9 @@ namespace NP.Base.Controllers if (IsEmail && users.Count == 1) { - var MHtml = "\"\"

안녕하세요, " + user.username + "님,
당신의 영남건설기술교육원 비밀번호를 재설정하기 위한 링크를 전달합니다.
" + - "아래 링크를 클릭하셔서 비밀번호를 재설정해주세요.

" + - "비밀번호 재설정

이 링크는 24시간 뒤 만료됩니다."; - + var MHtml = $"안녕하세요, {user.username}님,
당신의 영남건설기술교육원 비밀번호를 재설정하기 위한 링크를 전달합니다.
" + + $"아래 링크를 클릭하셔서 비밀번호를 재설정해주세요.

" + + $"비밀번호 재설정

이 링크는 24시간 뒤 만료됩니다."; var mailResult = SendEmail(masteremail.Split(';')[1], GetInt(masteremail.Split(';')[2]), masteremail.Split(';')[3], masteremail.Split(';')[4], 999, user.email, masteremail.Split(';')[0], "영남건설기술교육원 운영자", "[영남건설기술교육원] 비밀번호 찾기 안내", MHtml, "", "0:0"); return JsonOK(mailResult); @@ -1603,5 +1567,77 @@ namespace NP.Base.Controllers return JsonOKObj(result); } + + + + /// + /// 비밀번호 변경 + /// + /// + [HttpPost] + [ValidateAntiForgeryToken] + public JsonResult UserChangePassword(string userid, string password) + { + try + { + #region + 유효성 검사 (실패 시 즉시 반환) + // 1. 빈 문자열 확인 + if (string.IsNullOrEmpty(userid) || string.IsNullOrEmpty(password)) + { + return Json(new { success = false, message = "아이디 또는 비밀번호를 입력해주세요.", data = -1 }); + } + + // 2. 비밀번호 복잡도 검사 (8자 이상, 영문, 숫자, 특수문자 포함) + var passwordRegex = new Regex("^(?=.*[a-zA-Z])(?=.*\\d)(?=.*[\\W_]).{8,}$"); + if (!passwordRegex.IsMatch(password)) + { + return Json(new { success = false, message = "비밀번호는 8자 이상이며, 영문, 숫자, 특수문자를 포함해야 합니다.", data = -2 }); + } + + // 3. 3번 이상 연속되는 동일한 문자/숫자/기호 검사 + var repeatRegex = new Regex("(.)\\1\\1"); + if (repeatRegex.IsMatch(password)) + { + return Json(new { success = false, message = "연속으로 3번 이상 반복되는 문자를 사용할 수 없습니다.", data = -3 }); + } + #endregion + + // 모든 유효성 검사를 통과한 경우 진행 + var p = new Hashtable(); + long userNo = -1; + + #region + Get: users.findme + // userno 추출을 위한 목적 + p.Clear(); + p.Add("userid", userid); + + Users user = Dao.Get("users.findme", p) + .FirstOrDefault() ?? new Users(); + + userNo = user.userno; + #endregion + + #region + Save: users.change.password (비밀번호 재설정) + if (userNo > 0) + { + p.Clear(); + p.Add("userid", userid); + p.Add("userpass", Base.Lib.KISA_SHA256.SHA256Hash(password)); + p.Add("userno", userNo); + p.Add("uip", GetUserIP()); + + Dao.Save("users.change.password", p); + } + #endregion + + return Json(new { success = true, message = "비밀번호가 성공적으로 변경되었습니다.", data = 0 }); + + } + catch (Exception ex) + { + SetError($"UserChangePassword: {ex.Message}"); + return Json(new { success = false, message = "처리 중 오류가 발생했습니다. 다시 시도해주세요.", data = -10 }); + } + } } } diff --git a/Dao/MyBatis/Maps/User.xml b/Dao/MyBatis/Maps/User.xml index 7de591f..d5eab6b 100644 --- a/Dao/MyBatis/Maps/User.xml +++ b/Dao/MyBatis/Maps/User.xml @@ -339,7 +339,33 @@ from userpasslog where userno = #userno# and userpass = #userpass# - + + + + + + insert into userpasslog (userno, userpass, cdt, uip) @@ -715,15 +741,19 @@ update users set asno=#asno# where userno=#userno# + + + AND a.CI = #ci# + AND (a.STATUS = 1 OR a.STATUS = 9) + + + AND a.userid = #userid# + AND (a.STATUS = 1 OR a.STATUS = 9) + + - 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) > + update users + set userpass = #userpass# + , pwcalltime = null + , pwcallno = null + , status = (CASE WHEN status = 9 THEN 1 ELSE status END) + where userno=#userno# + and pwcalltime is not null + and pwcallno=#pwcallno# + and date_add(pwcalltime, interval 24 hour) > update usercheck a diff --git a/FO/Controllers/AccountController.cs b/FO/Controllers/AccountController.cs index 6a898b7..1ebd2a5 100644 --- a/FO/Controllers/AccountController.cs +++ b/FO/Controllers/AccountController.cs @@ -7,7 +7,9 @@ using System; using System.Collections; using System.Collections.Generic; using System.Linq; +using System.Text.RegularExpressions; using System.Web; +using System.Web.Helpers; using System.Web.Mvc; using XPayClientNet; @@ -147,15 +149,6 @@ namespace NP.FO.Controllers Server.ClearError(); if (Request.IsAjaxRequest()) { - //public static bool IsAjaxRequest(this HttpRequest request) - //{ - // if (request == null) - // { - // throw new ArgumentNullException("request"); - // } - // - // return (request["X-Requested-With"] == "XMLHttpRequest") || ((request.Headers != null) && (request.Headers["X-Requested-With"] == "XMLHttpRequest")); - //} return JsonError(Base.ENUM.JSONCode.Error, vm.msg + ":" + Request.Url.AbsolutePath + (exception ?? new Exception()).Message, exception); } return View("Error", vm); @@ -500,6 +493,46 @@ namespace NP.FO.Controllers return View(); } + + /// + /// ID/PW 찾기 신규 + /// + /// + public ActionResult FindIDPW() + { + return View(); + } + + /// + /// 비빌번호 재설정 + /// + /// + /// + public ActionResult NewPassword(VMUser vm) + { + try + { + #region + Get: users.findme + var p = new Hashtable(); + p.Add("ci", vm.User.ci); + + // status 1: 활성, 8: 휴면, 9: 비활성(정지, 삭제), 98: 탈퇴신청, 99: 탈퇴 + vm.User = Dao.Get("users.findme", p) + .FirstOrDefault() ?? new Users(); + + #endregion + } + catch (Exception ex) + { + SetError($"NewPassword 에러 : {ex.Message}"); + } + + return View(vm); + } + + + + #region 본인인증 요청(mobile(가입이전,휴대폰인증),ipin) /// /// 본인인증 요청(mobile(가입이전,휴대폰인증),ipin) @@ -513,8 +546,7 @@ namespace NP.FO.Controllers String REQ_SITE_NM = "YNICTE"; String REQ_URL = ""; String RETURN_MSG = ""; - String SITE_URL = "https://" + Request.Url.Host; - //String SITE_URL = GetConfig("fronturl"); + String SITE_URL = "https://" + Request.Url.Host; //인증요청사유코드 //00 : 회원가입 //01 : 성인인증 @@ -541,8 +573,7 @@ namespace NP.FO.Controllers //return url 설정 RETURN_URL = "https://" + Request.Url.Host + "/Account/CertOk3" + sel + "?reason=" + reason + (!string.IsNullOrEmpty(param1) ? "¶m1=" + param1 : "") + (!string.IsNullOrEmpty(param2) ? "¶m2=" + param2 : ""); RTN_URL = "https://" + Request.Url.Host + "/Account/CertOk3" + sel + "?reason=" + reason + (!string.IsNullOrEmpty(param1) ? "¶m1=" + param1 : "") + (!string.IsNullOrEmpty(param2) ? "¶m2=" + param2 : ""); - //RETURN_URL = GetConfig("fronturl") + "/Account/CertOk3" + sel + "?reason=" + reason + (!string.IsNullOrEmpty(param1) ? "¶m1=" + param1 : "") + (!string.IsNullOrEmpty(param2) ? "¶m2=" + param2 : ""); - //RTN_URL = GetConfig("fronturl") + "/Account/CertOk3" + sel + "?reason=" + reason + (!string.IsNullOrEmpty(param1) ? "¶m1=" + param1 : "") + (!string.IsNullOrEmpty(param2) ? "¶m2=" + param2 : ""); + //모바일팝업 if (sel == "MOBI") { @@ -613,7 +644,7 @@ namespace NP.FO.Controllers String REQ_URL = ""; String RETURN_MSG = ""; String SITE_URL = "https://" + Request.Url.Host; - //String SITE_URL = GetConfig("fronturl"); + //인증요청사유코드 //00 : 회원가입 //01 : 성인인증 @@ -640,8 +671,7 @@ namespace NP.FO.Controllers //return url 설정 RETURN_URL = "https://" + Request.Url.Host + "/Account/CertOk3" + sel + "2?reason=" + reason + (!string.IsNullOrEmpty(param1) ? "¶m1=" + param1 : "") + (!string.IsNullOrEmpty(param2) ? "¶m2=" + param2 : ""); RTN_URL = "https://" + Request.Url.Host + "/Account/CertOk3" + sel + "2?reason=" + reason + (!string.IsNullOrEmpty(param1) ? "¶m1=" + param1 : "") + (!string.IsNullOrEmpty(param2) ? "¶m2=" + param2 : ""); - //RETURN_URL = GetConfig("fronturl") + "/Account/CertOk3" + sel + "?reason=" + reason + (!string.IsNullOrEmpty(param1) ? "¶m1=" + param1 : "") + (!string.IsNullOrEmpty(param2) ? "¶m2=" + param2 : ""); - //RTN_URL = GetConfig("fronturl") + "/Account/CertOk3" + sel + "?reason=" + reason + (!string.IsNullOrEmpty(param1) ? "¶m1=" + param1 : "") + (!string.IsNullOrEmpty(param2) ? "¶m2=" + param2 : ""); + //모바일팝업 if (sel == "MOBI") { @@ -768,14 +798,6 @@ namespace NP.FO.Controllers CI_UPDATE = outputobj["CI_UPDATE"].ToString(); TEL_COM_CD = outputobj["TEL_COM_CD"].ToString(); TEL_NO = outputobj["TEL_NO"].ToString(); - //Users users = new Users() - //{ - // username = RSLT_NAME, - // birthday = RSLT_BIRTHDAY, - // di=DI, - // mobile = TEL_NO, - // jointype=0 - //}; TEL_NO = string.IsNullOrEmpty(TEL_NO) || TEL_NO.Replace("-", "").Length < 10 ? (TEL_NO ?? "") : TEL_NO.Replace("-", "").Length == 10 ? string.Format("{0}-{1}-{2}", TEL_NO.Replace("-", "").Substring(0, 3), TEL_NO.Replace("-", "").Substring(3, 3), TEL_NO.Replace("-", "").Substring(6)) : string.Format("{0}-{1}-{2}", TEL_NO.Replace("-", "").Substring(0, 3), TEL_NO.Replace("-", "").Substring(3, 4), TEL_NO.Replace("-", "").Substring(7)); if (!string.IsNullOrEmpty(TEL_NO)) { @@ -1295,8 +1317,7 @@ namespace NP.FO.Controllers case "LectNo": result = "er.잘못된 강좌코드 입니다."; break; - default: - // NoCert + default: result = "er.인증에 실패하였습니다."; break; } @@ -1366,15 +1387,7 @@ namespace NP.FO.Controllers CI = outputobj["CI"].ToString(); CI_UPDATE = outputobj["CI_UPDATE"].ToString(); VSSN = outputobj["VSSN"].ToString(); - //Users users = new Users() - //{ - // username = RSLT_NAME, - // birthday = RSLT_BIRTHDAY, - // di = DI, - // ci = CI, - // vssn = VSSN, - // jointype = 0 - //}; + if (!string.IsNullOrEmpty(VSSN)) { if (reason == "Join") @@ -1511,7 +1524,7 @@ namespace NP.FO.Controllers + RSLT_NAME + ":" + RSLT_BIRTHDAY + ":" + RSLT_SEX_CD + ":" + RSLT_NTV_FRNR_CD + ":" + DI + ":" + CI + ":" + CI_UPDATE + ":" + VSSN + ":" + RETURN_MSG; - //vm.stringval = "CP_CD:" + CP_CD + "&RSLT_CD:" + RSLT_CD + "&RSLT_MSG:" + RSLT_MSG; + Dao.Save("sys.kcblog.in", new System.Collections.Hashtable() { { "cp_cd", CP_CD }, { "vssn", VSSN }, { "logmsg", "RSLT_CD:" + RSLT_CD + "&RSLT_MSG:" + RSLT_MSG } }); ViewBag.reason = reason; } @@ -1596,15 +1609,7 @@ namespace NP.FO.Controllers CI = outputobj["CI"].ToString(); CI_UPDATE = outputobj["CI_UPDATE"].ToString(); VSSN = outputobj["VSSN"].ToString(); - //Users users = new Users() - //{ - // username = RSLT_NAME, - // birthday = RSLT_BIRTHDAY, - // di = DI, - // ci = CI, - // vssn = VSSN, - // jointype = 0 - //}; + if (!string.IsNullOrEmpty(VSSN)) { rsltCd = CertOkRslt.Ok.ToString(); @@ -1760,7 +1765,7 @@ namespace NP.FO.Controllers + RSLT_NAME + ":" + RSLT_BIRTHDAY + ":" + RSLT_SEX_CD + ":" + RSLT_NTV_FRNR_CD + ":" + DI + ":" + CI + ":" + CI_UPDATE + ":" + VSSN + ":" + RETURN_MSG; - //vm.stringval = "CP_CD:" + CP_CD + "&RSLT_CD:" + RSLT_CD + "&RSLT_MSG:" + RSLT_MSG; + Dao.Save("sys.kcblog.in", new System.Collections.Hashtable() { { "cp_cd", CP_CD }, { "vssn", VSSN }, { "logmsg", "RSLT_CD:" + RSLT_CD + "&RSLT_MSG:" + RSLT_MSG } }); } @@ -1814,7 +1819,6 @@ namespace NP.FO.Controllers paramStr += "," + reasonNo; paramStr += "," + rsltCd; - //paramEncStr = "stringval:" + EncString(paramStr); ViewBag.result = EncString(paramStr); } else @@ -1833,7 +1837,6 @@ namespace NP.FO.Controllers paramStr += "," + reasonNo; paramStr += "," + rsltCd; - //paramEncStr = "stringval:" + EncString(paramStr); ViewBag.result = EncString(paramStr); } else @@ -1843,7 +1846,6 @@ namespace NP.FO.Controllers } break; } - //ViewBag.reason = reason; if (errChk) { @@ -1896,17 +1898,11 @@ namespace NP.FO.Controllers 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); + ViewBag.RTNURL = cookie.Value; } if (Request.Cookies.Get("ru") != null) { - ViewBag.RTNURL = Request.Cookies.Get("ru"); - //원래 마케팅용이어서 expire는 제외 - //cookie.Expires = DateTime.Now.AddDays(-1); - //Response.Cookies.Add(cookie); + ViewBag.RTNURL = Request.Cookies.Get("ru"); } if (ViewBag.UserNo > 0) diff --git a/FO/Controllers/FOBaseController.cs b/FO/Controllers/FOBaseController.cs index 13badcd..67d0dc0 100644 --- a/FO/Controllers/FOBaseController.cs +++ b/FO/Controllers/FOBaseController.cs @@ -1,16 +1,10 @@ -using System; +using NP.Model; +using System; +using System.Collections; using System.Collections.Generic; using System.Linq; -using System.Web; using System.Web.Mvc; - -using NP.Model; -using NP.Base.Auth; - using XPayClientNet; -using System.Security.Cryptography; -using System.Text; -using System.Collections; namespace NP.FO.Controllers { @@ -34,24 +28,17 @@ namespace NP.FO.Controllers } else { - //if (Request.IsSecureConnection && - // (Request.Url.AbsolutePath.ToUpper().StartsWith("/CROOM/") || - // Request.Url.AbsolutePath.ToUpper() == "/CROOM" || - // Request.Url.AbsolutePath.ToUpper().StartsWith("/CDMS/")) && - // Request.Url.AbsolutePath.ToUpper() != "/CDMS/HTTPS") if ( Request.IsSecureConnection && Request.Url.AbsolutePath.ToUpper().StartsWith("/CDMS/") && Request.Url.AbsolutePath.ToUpper() != "/CDMS/HTTPS" && false ) - { - //Response.Redirect("http://" + Request.Url.Host + Request.Url.PathAndQuery, true); + { filterContext.Result = new RedirectResult("http://" + Request.Url.Host + Request.Url.PathAndQuery); } else if ("Y".Equals(GetConfig("usessl")) && !Request.IsSecureConnection && - !Request.Url.AbsolutePath.StartsWith("/Open/") && - //!(Request.Url.AbsolutePath.ToUpper().StartsWith("/CROOM/") || Request.Url.AbsolutePath.ToUpper() == "/CROOM") && + !Request.Url.AbsolutePath.StartsWith("/Open/") && !(Request.Url.AbsolutePath.ToUpper().StartsWith("/CDMS/") || Request.Url.AbsolutePath.ToUpper() == "/CDMS") && !Request.Url.AbsolutePath.ToUpper().StartsWith("/ACCOUNT/ERROR")) { @@ -63,15 +50,9 @@ namespace NP.FO.Controllers { Response.Cookies["yicte"].Value = Request.Cookies["yicte"].Value + ";SameSite=None; Secure"; } - var cm = new Model.MenuPage() { }; - //if (Request.Url.AbsolutePath.ToUpper().StartsWith("/DIVISION/A")) - //{ - // cm = GetMENUPAGES.Where(w => (w.usertype == 0 || w.usertype == SUserInfo.UserType) && w.pageurl.Equals(Request.Url.PathAndQuery)).OrderByDescending(od => od.pdepth).FirstOrDefault(); - //} - //else - //{ + var cm = new Model.MenuPage() { }; cm = GetMENUPAGES.Where(w => (w.usertype == 0 || w.usertype == SUserInfo.UserType) && (w.pageurl ?? "").ToUpper().Equals(Request.Url.AbsolutePath.ToUpper())).OrderByDescending(od => od.pdepth).FirstOrDefault(); - //} + if (cm != null || Request.Url.AbsolutePath.ToUpper().Equals("/HOME/HTML") || Request.Url.AbsolutePath.ToUpper().StartsWith("/ACCOUNT/BANEMAIL") || Request.Url.AbsolutePath.ToUpper().StartsWith("/ACCOUNT/LOGOUT") @@ -104,15 +85,9 @@ namespace NP.FO.Controllers new NP.Model.PageLog() { uno = SUserInfo.UserNo, uip = GetUserIP(), logsite = 1, pno = cm.pno < 1 ? (int?)null : cm.pno, loginfo = (cm.ppagename ?? "") + " > " + cm.pagename }))); } } - else if (GetMENUPAGES.Where(w => (w.pageurl ?? "").ToUpper().Equals(Request.Url.AbsolutePath.ToUpper())).OrderByDescending(od => od.pdepth).FirstOrDefault() != null - //&& !Request.Url.AbsolutePath.ToUpper().StartsWith("/CDMS/PLAY") - //&& !Request.Url.AbsolutePath.ToUpper().StartsWith("/CONTENTS") - ) + else if (GetMENUPAGES.Where(w => (w.pageurl ?? "").ToUpper().Equals(Request.Url.AbsolutePath.ToUpper())).OrderByDescending(od => od.pdepth).FirstOrDefault() != null) { - filterContext.Result = new RedirectResult("/Account/Index?fobase=xx&ru=" + Request.Url.AbsolutePath, true); - //학습창 등이 안뜨고 로그인창으로 갈 경우 여기에 urlreferrer suserinfo, viewbag.ssuser~, GetMENUPAGES 등의 값들을 로깅해본다. - //~~ - //Response.Redirect("/Account/Index?ru=" + Request.Url.AbsolutePath, true); + filterContext.Result = new RedirectResult("/Account/Index?fobase=xx&ru=" + Request.Url.AbsolutePath, true); } else if (!Request.Url.AbsolutePath.ToUpper().StartsWith("/OPEN/") && !Request.Url.AbsolutePath.ToUpper().StartsWith("/HOME/POPUP") && @@ -123,23 +98,11 @@ namespace NP.FO.Controllers { filterContext.Result = new RedirectResult("/Account/Error"); } - //if (Request.IsSecureConnection && - //!Request.Url.AbsolutePath.ToUpper().StartsWith("/ACCOUNT/") && - //!Request.Url.AbsolutePath.ToUpper().StartsWith("/OPEN/")) - //{ - // //Redirect("http://" + Request.Url.Host + Request.Url.PathAndQuery); - // filterContext.Result = new RedirectResult("http://" + Request.Url.Host + Request.Url.PathAndQuery); - //} - else if (GetMENUPAGES.Where(w => (w.pageurl ?? "").ToUpper().Equals(Request.Url.AbsolutePath.ToUpper())).OrderByDescending(od => od.pdepth).FirstOrDefault() != null - //&& !Request.Url.AbsolutePath.ToUpper().StartsWith("/CDMS/PLAY") - //&& !Request.Url.AbsolutePath.ToUpper().StartsWith("/CONTENTS") - ) + + else if (GetMENUPAGES.Where(w => (w.pageurl ?? "").ToUpper().Equals(Request.Url.AbsolutePath.ToUpper())).OrderByDescending(od => od.pdepth).FirstOrDefault() != null) { filterContext.Result = new RedirectResult("/Account/Index?fobase=1&ru=" + Request.Url.AbsolutePath, true); - SetError("fobaseerror:path=" + Request.Url.AbsolutePath + "&urlrefer=" + Request.UrlReferrer + "&userinfo=" + SUserInfo.UserNo + "&ssuer=" + ViewBag.SSUserNo); - //학습창 등이 안뜨고 로그인창으로 갈 경우 여기에 urlreferrer suserinfo, viewbag.ssuser~, GetMENUPAGES 등의 값들을 로깅해본다. - //~~ - //Response.Redirect("/Account/Index?ru=" + Request.Url.AbsolutePath, true); + SetError("fobaseerror:path=" + Request.Url.AbsolutePath + "&urlrefer=" + Request.UrlReferrer + "&userinfo=" + SUserInfo.UserNo + "&ssuer=" + ViewBag.SSUserNo); } else if (!Request.Url.AbsolutePath.ToUpper().StartsWith("/OPEN/") && !Request.Url.AbsolutePath.ToUpper().StartsWith("/HOME/POPUP") && @@ -151,13 +114,6 @@ namespace NP.FO.Controllers { filterContext.Result = new RedirectResult("/Account/Error"); } - //if (Request.IsSecureConnection && - //!Request.Url.AbsolutePath.ToUpper().StartsWith("/ACCOUNT/") && - //!Request.Url.AbsolutePath.ToUpper().StartsWith("/OPEN/")) - //{ - // //Redirect("http://" + Request.Url.Host + Request.Url.PathAndQuery); - // filterContext.Result = new RedirectResult("http://" + Request.Url.Host + Request.Url.PathAndQuery); - //} } } private static IList POPUPS { get; set; } @@ -223,8 +179,7 @@ namespace NP.FO.Controllers get { if (BANNER == null) - { - //var banners = GetBANNERS; + { BANNER = ""; if (GetBANNERS.Where(w => w.ismain == 0).Count() > 0) { @@ -250,14 +205,10 @@ namespace NP.FO.Controllers get { if (BANNERCROOM == null) - { - //var banners = GetBANNERS; + { BANNERCROOM = ""; if (GetBANNERS.Where(w => w.ismain == 1).Count() > 0) - { - //BANNERCROOM = string.Join("", GetBANNERS.Where(w => w.ismain == 1).Select(s => - // string.Format("
\"\"
" - // , (new BaseModel()).rootfolder + s.fileurl, (new BaseModel()).rootfolder + s.fileurl2))); + { } } return BANNERCROOM; @@ -339,8 +290,7 @@ namespace NP.FO.Controllers sbmauth.Append(string.Format("
  • {0}
      ", m.pagename, m.pno,menu.pno,menu.pagetype,menu.pageurl)); } else - { - //sbmauth.Append(string.Format("
    • {0}
        ", m.pagename, m.pno,menu.pno,menu.pagetype,menu.pageurl)); + { sbmauth.Append(string.Format("
      • {0}
          ", m.pagename, m.pno,menu.pno,menu.pagetype,menu.pageurl)); } if (m.usertype == 0) @@ -350,8 +300,7 @@ namespace NP.FO.Controllers sbm.Append(string.Format("
        • {0}
            ", m.pagename, m.pno, menu.pno, menu.pagetype, menu.pageurl)); } else - { - //sbm.Append(string.Format("
          • {0}
              ", m.pagename, m.pno, menu.pno, menu.pagetype, menu.pageurl)); + { sbm.Append(string.Format("
            • {0}
                ", m.pagename, m.pno, menu.pno, menu.pagetype, menu.pageurl)); } @@ -419,23 +368,6 @@ namespace NP.FO.Controllers } protected void PayAll(VMPay vm) { - //ViewBag.IsOldTLS = false; - //try - //{ - // if (Request.IsSecureConnection) - // { - // System.Net.Security.SslStream sss = new System.Net.Security.SslStream(Request.UrlReferrer.); - // Console.WriteLine(sss.SslProtocol); - // //if (ssp.SslProtocol != System.Security.Authentication.SslProtocols.Tls12) - // //{ - // // ViewBag.IsOldTLS = true; - // //} - // } - //} - //catch (Exception ex) - //{ - // Console.WriteLine(ex.Message); - //} vm.PayItems = new List() { }; if (vm.ispaycart) { @@ -482,22 +414,11 @@ namespace NP.FO.Controllers vm.pginfo = GetConfig("pginfo"); vm.pginfomobile = GetConfig("pginfomobile"); vm.signkey = ComputeHash(vm.pginfo.Split('|')[2]); - - //vm.payitemname = Utf8ToEuckr(); - vm.viewname5 = "https://" + Request.Url.Host + "/Course/PayClose"; - //vm.viewname5 = GetConfig("fronturl") + "/Course/PayClose"; + vm.viewname5 = "https://" + Request.Url.Host + "/Course/PayClose"; vm.previewname = vm.previewname ?? "/My/Cart"; vm.deliveramt = GetInt(GetConfig("deliveramt")); } - //private String Utf8ToEuckr(String s) - //{ - // byte[] pbSource = System.Text.Encoding.UTF8.GetBytes(s); - // byte[] pbDest = System.Text.Encoding.Convert( - // System.Text.Encoding.UTF8, System.Text.Encoding.GetEncoding("euc-kr"), pbSource); - // pbSource = System.Text.Encoding.Convert(System.Text.Encoding.GetEncoding("euc-kr"), System.Text.Encoding.UTF8, pbDest); - // char[] psUnicode = System.Text.UTF8Encoding.UTF8.GetChars(pbSource); - // return new string(psUnicode); - //} + protected ActionResult PayReturn(VMPay vm) { //20220802 추가 @@ -833,8 +754,7 @@ namespace NP.FO.Controllers { item.eend2 = item.eend.ToString("yyyy년 MM월 dd일"); } - - //vm.SelectCMInningscd.scdInfoSummary = string.Format("{0}", vm.SelectCMInningscd.estart.ToString("yyyy년 MM월 dd일까지")); + if (vm.SelectCMInningscd.estart < Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 00:00:00"))) { vm.SelectCMInningscd.isEnd = true; @@ -845,5 +765,4 @@ namespace NP.FO.Controllers return View("ApplyComplete", vm); } } -} - +} \ No newline at end of file diff --git a/FO/FO.csproj b/FO/FO.csproj index f3ccc0d..ae43a5d 100644 --- a/FO/FO.csproj +++ b/FO/FO.csproj @@ -329,6 +329,7 @@ + @@ -756,6 +757,8 @@ + + diff --git a/FO/Views/Account/CertOk3IPIN.cshtml b/FO/Views/Account/CertOk3IPIN.cshtml index 1ec3455..2ab4e9d 100644 --- a/FO/Views/Account/CertOk3IPIN.cshtml +++ b/FO/Views/Account/CertOk3IPIN.cshtml @@ -39,31 +39,51 @@ self.close(); } else if (ViewBag.reason == "AuthPlatformChange") { - - if ("@(RSLT_NAME)" == $(opener.document).find("#mform").find("#username").val()) { + + if ("@(RSLT_NAME)" == $(opener.document).find("#mform").find("#username").val()) { $(opener.document).find("#mform").find("#authplatform").val("@(AuthPlatform.IPIN.GetHashCode())"); - $(opener.document).find("#mform").find("#birthday").val("@(RSLT_BIRTHDAY)"); + $(opener.document).find("#mform").find("#birthday").val("@(RSLT_BIRTHDAY)"); $(opener.document).find("#mform").find("#di").val("@(DI)"); $(opener.document).find("#mform").find("#ci").val("@(CI)"); $(opener.document).find("#mform").find("#vssn").val("@(VSSN)"); $(opener.document).find("#mform").find("#authPlatform_IPIN").show(); $(opener.document).find("#mform").find("#authPlatform_IPIN").css("padding-bottom","0px"); $(opener.document).find("#mform").find("#authPlatform_IPIN_Name").text("I-PIN 인증"); - $(opener.document).find("#mform").find("#authPlatform_Mobile").hide(); - try { - $(opener.document).find("#mform").find("#txtbirthday").text(moment("@(RSLT_BIRTHDAY)").format('YYYY.MM.DD')); - } catch (error) { + $(opener.document).find("#mform").find("#authPlatform_Mobile").hide(); + try { + $(opener.document).find("#mform").find("#txtbirthday").text(moment("@(RSLT_BIRTHDAY)").format('YYYY.MM.DD')); + } catch (error) { } alert("인증완료"); - } else { - alert("입력한 정보와 일치하지 않습니다.\n 재인증해주세요."); + } else { + alert("입력한 정보와 일치하지 않습니다.\n 재인증해주세요."); + } + self.close(); + + } else if (ViewBag.reason == "FINDIDPW") { + + if ("@(RSLT_NAME)" != "" && "@CI" != "") { + try { + $(opener.document).find("#mform").find("#User_di").val("@(DI)"); + $(opener.document).find("#mform").find("#User_ci").val("@(CI)"); + $(opener.document).find("#mform").find("#User_authplatform").val("@(AuthPlatform.Mobile.GetHashCode())"); + $(opener.document).find("#mform").attr("action", "/Account/NewPassword"); + $(opener.document).find("#mform").submit(); + alert("인증완료"); + self.close(); + } + catch (ex) { + console.error(ex.message); + } + } else { + alert("입력하신 아이디 또는 비밀번호와 일치하는 계정이 없습니다.\n 다시 확인해주세요."); } self.close(); } else if (ViewBag.reason == "LectinningAuth") { alert("인증완료"); - location.href = "http://" + location.hostname + "/Open/PlayOpen?lectno=@(ViewBag.lectno)&cmino=@(ViewBag.cmino)"; + location.href = "http://" + location.hostname + "/Open/PlayOpen?lectno=@(ViewBag.lectno)&cmino=@(ViewBag.cmino)"; } } else { diff --git a/FO/Views/Account/CertOk3MOBI.cshtml b/FO/Views/Account/CertOk3MOBI.cshtml index a619918..4414cb2 100644 --- a/FO/Views/Account/CertOk3MOBI.cshtml +++ b/FO/Views/Account/CertOk3MOBI.cshtml @@ -21,7 +21,8 @@
                - \ No newline at end of file diff --git a/FO/Views/Account/FindMe.cshtml b/FO/Views/Account/FindMe.cshtml index 26950c5..f3e5d45 100644 --- a/FO/Views/Account/FindMe.cshtml +++ b/FO/Views/Account/FindMe.cshtml @@ -7,12 +7,19 @@ {

                - @Model.User.username (@Model.User.userid)님, 인증이 완료되었습니다. + @Model.User.username 님, 아이디는 @Model.User.userid 입니다. 새롭게 사용할 비밀번호를 입력해주세요.

                  -
                • -
                • +
                • +
                • +
                +
                  +
                • +

                  +

                  +
                  +
                • 비밀번호 재설정
                • @@ -53,7 +60,20 @@ *@ @@ -17,10 +18,10 @@
                  • - +
                  • - +
                  @@ -28,14 +29,22 @@
                  -

                  ※ 2021년 7월 1일 이전에 회원가입을 하신 분 들은 본인인증을 위하여 회원가입을 다시 진행 해주시길 부탁드립니다.

                  + + @*
                  + + + +

                  2021년 7월 1일 이전에 가입하신 회원님은 본인인증을 위해
                  회원가입을 다시 진행해 주시길 바랍니다.

                  +
                  *@ + +

                  +
                  로그인 -
                  @**@ @@ -44,12 +53,15 @@ \ No newline at end of file diff --git a/FO/Views/Account/JoinIdVeri.cshtml b/FO/Views/Account/JoinIdVeri.cshtml index 65497bb..4e014e8 100644 --- a/FO/Views/Account/JoinIdVeri.cshtml +++ b/FO/Views/Account/JoinIdVeri.cshtml @@ -21,23 +21,16 @@
                  i-PIN 인증

                  i-PIN 인증

                  - 인증하기 + 인증하기
                휴대폰 본인인증

                휴대폰 본인인증

                - 인증하기 + 인증하기
                - @*
                -
                - 카드인증 -

                카드인증

                - 인증하기 -
                -
                *@ @Html.Partial("./Partial/OkCert3", null, new ViewDataDictionary { })

                본인 인증 시 제공되는 정보는 해당 인증기관에서 직접 수집하며, 인증 이외의 용도로 이용 또는 저장하지 않습니다.

                @@ -53,20 +46,7 @@ $("#frm").submit(); } else { - msg(val.replace("er.","")) + msg(val.replace("er.", "")) } } - -@*@{ - string errMsg = ""; - if (ViewBag.rsltCd != "") - { - errMsg = ((string)ViewBag.rsltCd).Replace("er.", ""); - - } -}*@ - + \ No newline at end of file diff --git a/FO/Views/Account/NewPassword.cshtml b/FO/Views/Account/NewPassword.cshtml new file mode 100644 index 0000000..4cb3bfd --- /dev/null +++ b/FO/Views/Account/NewPassword.cshtml @@ -0,0 +1,194 @@ +@model NP.Model.VMUser +@{ + // 상태 (확장대비) + int userStatus = Model.User.status; + + // 인증CI + string ci = Model.User.ci ?? ""; +} + +@if (!string.IsNullOrEmpty(ci) && !string.IsNullOrEmpty(Model.User.userid)) +{ // 인증 결과가 있는 사용자만 +
                + @Html.AntiForgeryToken() + +
                +

                + @Model.User.username 님, 아이디는 @Model.User.userid 입니다. + 새롭게 사용할 비밀번호를 입력해주세요. +

                +
                  +
                • +
                • +
                +
                  +
                • +

                  +

                  +
                  +
                • +
                + +
                + + @section scriptsHeader{ + @Html.Partial("./Partial/ScriptPost") + } +
                + + + } +else +{ // 인증결과가 없는 회원의 확인창을 띄울 빈 껍데기 + +
                +

                + 새롭게 사용할 비밀번호를 입력해주세요. +

                +
                  +
                • +
                • +
                + +
                + + +} \ No newline at end of file diff --git a/FO/Views/My/MyInfoCheck.cshtml b/FO/Views/My/MyInfoCheck.cshtml index c59d998..3b22b7c 100644 --- a/FO/Views/My/MyInfoCheck.cshtml +++ b/FO/Views/My/MyInfoCheck.cshtml @@ -15,9 +15,7 @@ - - + /** 알림 팝업 버튼 스타일 (mpgpop_ 접두사 적용) */ + + .mpgpop_btn_base { + display: block; + text-align: center; + text-decoration: none; + border: 1px solid #999; + border-radius: 4px; + background-color: #fff; + color: #333; + cursor: pointer; + transition: background-color 0.2s ease; + } + + /* 마우스를 올렸을 때의 효과 */ + .mpgpop_btn_base:hover { + background-color: #f5f5f5; + } + + /* '회원가입 바로가기' 버튼 전용 스타일 */ + .mpgpop_btn_signup { + width: 220px; + padding: 12px 0; + font-weight: bold; + } + + /* '확인' 버튼 전용 스타일 */ + .mpgpop_btn_confirm { + width: 120px; + padding: 10px 0; + } +
                diff --git a/FO/Views/Shared/_Layout.cshtml b/FO/Views/Shared/_Layout.cshtml index 903aa79..cb0789a 100644 --- a/FO/Views/Shared/_Layout.cshtml +++ b/FO/Views/Shared/_Layout.cshtml @@ -43,6 +43,10 @@
                ...
                +