From 994271dbfaaa27ec9402dd27133d604013e19bb8 Mon Sep 17 00:00:00 2001 From: jity7777 Date: Thu, 2 May 2024 03:42:16 +0000 Subject: [PATCH] =?UTF-8?q?=EC=B5=9C=EA=B7=BC=20=EB=B3=80=EA=B2=BD?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EC=9D=BC=EA=B4=84=20=EC=BB=A4=EB=B0=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Base/Base.csproj | 2 +- Base/Controller/BasePartialController.cs | 33 + Base/Controller/FCommonMy.cs | 124 +++- Base/Controller/FOCommon.cs | 97 ++- Base/packages.config | 2 +- Dao/MyBatis/Maps/System.xml | 25 + FO/Controllers/AccountController.cs | 844 ++++++++++++++++++++++- FO/Controllers/FOBaseController.cs | 15 +- FO/FO.csproj | 8 +- FO/Views/Account/CertOk3IPIN2.cshtml | 16 + FO/Views/Account/CertOk3MOBI.cshtml | 6 +- FO/Views/Account/CertOk3MOBI2.cshtml | 16 + FO/Views/Account/CertOk3MOBI_old.cshtml | 88 +++ FO/Views/Account/Join.cshtml | 2 +- FO/Views/Account/JoinIdVeri.cshtml | 75 +- FO/Views/My/MyInfoCheck.cshtml | 202 ++++-- FO/Views/Shared/Partial/OkCert3.cshtml | 9 + FO/Web.config | 4 +- FO/packages.config | 2 +- Model/ENUM.cs | 64 ++ Model/Systems.cs | 26 +- 21 files changed, 1552 insertions(+), 108 deletions(-) create mode 100644 FO/Views/Account/CertOk3IPIN2.cshtml create mode 100644 FO/Views/Account/CertOk3MOBI2.cshtml create mode 100644 FO/Views/Account/CertOk3MOBI_old.cshtml diff --git a/Base/Base.csproj b/Base/Base.csproj index a2deec8..68e2ba5 100644 --- a/Base/Base.csproj +++ b/Base/Base.csproj @@ -76,7 +76,7 @@ ..\References\MySql.Data.dll - ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll False diff --git a/Base/Controller/BasePartialController.cs b/Base/Controller/BasePartialController.cs index d487cd8..f60aa92 100644 --- a/Base/Controller/BasePartialController.cs +++ b/Base/Controller/BasePartialController.cs @@ -1935,5 +1935,38 @@ namespace NP.Base Random r = new Random(); return r.Next(10000000, 99999999); } + + protected int GetRand2() + { + Random r = new Random(); + return r.Next(100000, 999999); + } + + protected string GetPostPage(string pageUrl = "", string paramStr = "", char divStr = ',') + { + string pageHtml = ""; + + if (pageUrl != "") + { + pageHtml = "
"; + string[] paramArr = paramStr.Split(divStr); + string[] paramValArr; + + foreach (var item in paramArr) + { + paramValArr = item.Split(':'); + + pageHtml += ""; + } + + pageHtml += "
"; + + pageHtml += ""; + } + + return pageHtml; + } } } \ No newline at end of file diff --git a/Base/Controller/FCommonMy.cs b/Base/Controller/FCommonMy.cs index 7daae0c..4c8b8aa 100644 --- a/Base/Controller/FCommonMy.cs +++ b/Base/Controller/FCommonMy.cs @@ -9,6 +9,9 @@ using System.Collections; using NP.Base.Auth; using NP.Base.ENUM; using QRCoder; +using Newtonsoft.Json.Linq; +using Newtonsoft.Json; + namespace NP.Base.Controllers { public partial class FCommonController : NP.Base.BaseController @@ -105,13 +108,58 @@ namespace NP.Base.Controllers var user = Dao.Get("users.users", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo } }).FirstOrDefault(); if (user != null) { - if (string.IsNullOrEmpty(user.di) || user.di == u.di) + OkCert3Result okCert3Result = new OkCert3Result(); + okCert3Result.no = 0; + okCert3Result.gubn = ""; + + if (!string.IsNullOrWhiteSpace(u.zstring0) && !string.IsNullOrWhiteSpace(u.zstring1)) + { + string certiOkData = Dao.Get("sys.okcert3.get", new Hashtable { { "no", u.zstring0 }, { "sn", u.zstring1 } }).FirstOrDefault(); + + if(certiOkData != null) + { + JObject data = JObject.FromObject(JsonConvert.DeserializeObject(certiOkData)); + + okCert3Result.no = long.Parse(u.zstring0); + okCert3Result.gubn = u.zstring2; + okCert3Result.ci = data["CI"].ToString(); + okCert3Result.di = data["DI"].ToString(); + okCert3Result.username = data["RSLT_NAME"].ToString(); + okCert3Result.birthday = data["RSLT_BIRTHDAY"].ToString(); + okCert3Result.mobile = data["TEL_NO"] == null ? "" : data["TEL_NO"].ToString(); + } + else + { + okCert3Result.no = -1; + } + } + + if ((string.IsNullOrEmpty(user.di) || user.di == u.di) && okCert3Result.no != -1) { u.userno = SUserInfo.UserNo; u.uno = SUserInfo.UserNo; u.uip = GetUserIP(); u.usertype = 1; u.userpass = string.IsNullOrEmpty(u.userpass) ? null : NP.Base.Lib.KISA_SHA256.SHA256Hash(u.userpass.Trim()); + + if(okCert3Result.gubn != "") + { + if (okCert3Result.gubn == "MOBI") + { + u.mobile = okCert3Result.mobile; + u.authplatform = Model.ENUM.AuthPlatform.Mobile; + } + else + { + u.authplatform = Model.ENUM.AuthPlatform.IPIN; + } + u.username = okCert3Result.username; + u.birthday = okCert3Result.birthday; // 이걸로 적용시 날짜형식에 맞는지 체크할 것 + u.di = okCert3Result.di; + u.ci = okCert3Result.ci; + // 이름도 인증이름으로 할지여부 + } + var telno = (u.telno ?? "").Replace("-", ""); u.telno = telno.Length == 11 ? string.Format("{0}-{1}-{2}", telno.Substring(0, 3), telno.Substring(3, 4), telno.Substring(7, 4)) : telno.Length == 10 ? string.Format("{0}-{1}-{2}", telno.Substring(0, 3), telno.Substring(3, 3), telno.Substring(6, 4)) : @@ -139,6 +187,10 @@ namespace NP.Base.Controllers //} return JsonOK(result); } + else + { + JsonOK(-1); + } } return JsonOK(0); } @@ -150,16 +202,62 @@ namespace NP.Base.Controllers if(vm.userno > 0) { - u.userpass = string.IsNullOrEmpty(u.userpass) ? null : NP.Base.Lib.KISA_SHA256.SHA256Hash(vm.User.userpass.Trim()); - if (u.userpass == null) + OkCert3Result okCert3Result = new OkCert3Result(); + okCert3Result.no = 0; + okCert3Result.gubn = ""; + + if (!string.IsNullOrWhiteSpace(u.zstring0) && !string.IsNullOrWhiteSpace(u.zstring1)) { - u.userpass = Request["User.userpass"]; + string certiOkData = Dao.Get("sys.okcert3.get", new Hashtable { { "no", u.zstring0 }, { "sn", u.zstring1 } }).FirstOrDefault(); + + + if (certiOkData != null) + { + JObject data = JObject.FromObject(JsonConvert.DeserializeObject(certiOkData)); + + okCert3Result.no = long.Parse(u.zstring0); + okCert3Result.gubn = u.zstring2; + //okCert3Result.ci = data["CI"].ToString(); + //okCert3Result.di = data["DI"].ToString(); + okCert3Result.username = data["RSLT_NAME"].ToString(); + okCert3Result.birthday = data["RSLT_BIRTHDAY"].ToString(); + okCert3Result.mobile = data["TEL_NO"] == null ? "" : data["TEL_NO"].ToString(); + + if (u.username != okCert3Result.username || u.birthday != okCert3Result.birthday) + { + passResult = -1; + } + + if (passResult == 0 && okCert3Result.gubn == "MOBI" && u.mobile != okCert3Result.mobile) + { + passResult = -1; + } + + Dao.Save("sys.okcert3.setUno", new Hashtable { { "no", u.zstring0 }, { "uno", vm.userno } }); + } + else + { + okCert3Result.no = -1; + } } - if (u.userpass != null) + if(passResult == 0 && okCert3Result.no != -1) { - u.userpass = NP.Base.Lib.KISA_SHA256.SHA256Hash(vm.User.userpass.Trim()); - passResult = Dao.Get("users.pass.check", new System.Collections.Hashtable() { { "userno", vm.userno }, { "userpass", u.userpass } }).FirstOrDefault(); + u.userpass = string.IsNullOrEmpty(u.userpass) ? null : NP.Base.Lib.KISA_SHA256.SHA256Hash(vm.User.userpass.Trim()); + if (u.userpass == null) + { + u.userpass = Request["User.userpass"]; + } + + if (u.userpass != null) + { + u.userpass = NP.Base.Lib.KISA_SHA256.SHA256Hash(vm.User.userpass.Trim()); + passResult = Dao.Get("users.pass.check", new System.Collections.Hashtable() { { "userno", vm.userno }, { "userpass", u.userpass } }).FirstOrDefault(); + } + } + else + { + passResult = (int)okCert3Result.no; } } else @@ -229,6 +327,18 @@ namespace NP.Base.Controllers //정상으로 된거로 판단 return JsonOK(1); } + + public JsonResult userGetMyinfo() + { + Users users = new Users(); + + if(SUserInfo.UserNo > 0) + { + users = Dao.Get("users.users", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo } }).FirstOrDefault(); + } + + return JsonObj(users); + } } } \ No newline at end of file diff --git a/Base/Controller/FOCommon.cs b/Base/Controller/FOCommon.cs index ddc7200..c980517 100644 --- a/Base/Controller/FOCommon.cs +++ b/Base/Controller/FOCommon.cs @@ -9,6 +9,8 @@ using System.Collections; using NP.Base.Auth; using NP.Base.ENUM; using System.Web.ModelBinding; +using Newtonsoft.Json.Linq; +using Newtonsoft.Json; namespace NP.Base.Controllers { @@ -248,7 +250,7 @@ namespace NP.Base.Controllers return JsonOK(GetInt(ht["asno"])); } [HttpPost] - public JsonResult Join(Users u) + public JsonResult Join_old(Users u) { u.uip = GetUserIP(); //이메일, 아이디 중복 체크 @@ -263,6 +265,49 @@ namespace NP.Base.Controllers Dao.Insert("users.in", u); return JsonOK(u.userno); } + public JsonResult Join(Users u) + { + if (!string.IsNullOrWhiteSpace(u.zstring0)) + { + // 인증 후 okcert3log.no와 sn 값으로 인증된 결과값 가져오기 + string decStr = DecString(u.zstring0); + string[] tempArr = decStr.Split(','); + string gubn = tempArr[2]; + ViewBag.reason = tempArr[3]; + ViewBag.rsltCd = tempArr[4]; + string certiOkData = Dao.Get("sys.okcert3.get", new Hashtable { { "no", tempArr[0] }, { "sn", tempArr[1] } }).FirstOrDefault(); + + JObject data = JObject.FromObject(JsonConvert.DeserializeObject(certiOkData)); + + // 인증 후 강제로 수정된 정보를 인증 정보로 대체하기 + u.username = data["RSLT_NAME"].ToString(); + u.ci = data["CI"].ToString(); + u.di = data["DI"].ToString(); + u.birthday = data["RSLT_BIRTHDAY"].ToString(); + if(gubn == "MOBI") + { + u.mobile = data["TEL_NO"] == null ? "" : data["TEL_NO"].ToString(); + } + u.vssn = data["VSSN"] == null ? "" : data["VSSN"].ToString(); + + u.uip = GetUserIP(); + //이메일, 아이디 중복 체크 + var u129 = Dao.Get("users.checkuser", new Hashtable() { { "userid", u.userid }, { "email", u.email }, { "mobile", u.mobile } }).First(); + if (u129 != 9) + { + return JsonOK(u129 * -1); + } + u.userpass = NP.Base.Lib.KISA_SHA256.SHA256Hash(u.userpass.Trim()); + u.birthday = u.birthday != null && u.birthday.Length == 8 ? (u.birthday ?? "").Substring(0, 4) + "-" + (u.birthday ?? "").Substring(4, 2) + "-" + (u.birthday ?? "").Substring(6, 2) : null; + u.usertype = u.status = 1; + Dao.Insert("users.in", u); + return JsonOK(u.userno); + } + else + { + return JsonOK(0); + } + } [HttpPost] public JsonResult FindMe(String email) { @@ -991,5 +1036,55 @@ namespace NP.Base.Controllers } return JsonOK(0); } + + public JsonResult GetOkCert3Rslt(string stringval) + { + stringval = string.IsNullOrWhiteSpace(stringval) ? "" : stringval.Trim(); + //string result = "NoCert"; // 초기값 + + OkCert3Result result = new OkCert3Result(); + result.rsltCd = "NoCert"; + + if (!string.IsNullOrWhiteSpace(stringval)) + { + stringval = HttpUtility.UrlDecode(stringval); + string decStr = DecString(stringval); + string tempStr = ""; + string[] tempArr = decStr.Split(','); + string gubn = tempArr[2]; + result.reasonNo = int.Parse(tempArr[3].ToString()); + result.rsltCd = tempArr[4]; + + string certiOkData = Dao.Get("sys.okcert3.get", new Hashtable { { "no", tempArr[0] }, { "sn", tempArr[1] } }).FirstOrDefault(); + + JObject data = JObject.FromObject(JsonConvert.DeserializeObject(certiOkData)); + + result.no = long.Parse(tempArr[0]); + result.sn = tempArr[1]; + result.gubn = gubn; + result.ci = data["CI"].ToString(); + result.di = data["DI"].ToString(); + result.username = data["RSLT_NAME"].ToString(); + result.birthday = data["RSLT_BIRTHDAY"].ToString(); + result.mobile = data["TEL_NO"] == null ? "" : data["TEL_NO"].ToString(); + result.vssn = data["VSSN"] == null ? "" : data["VSSN"].ToString(); + + if (!string.IsNullOrWhiteSpace(result.mobile)) + { + tempStr = result.mobile.Trim(); + if (tempStr.Length == 10) + { + result.mobile = tempStr.Substring(0, 3) + "-" + tempStr.Substring(3, 3) + "-" + tempStr.Substring(6, 4); + } + else if(tempStr.Length == 11) + { + result.mobile = tempStr.Substring(0, 3) + "-" + tempStr.Substring(3, 4) + "-" + tempStr.Substring(7, 4); + } + // 10,11 개 아닐 경우 그대로 표현 + } + } + + return JsonOKObj(result); + } } } diff --git a/Base/packages.config b/Base/packages.config index 3d8f274..5387088 100644 --- a/Base/packages.config +++ b/Base/packages.config @@ -9,7 +9,7 @@ - + diff --git a/Dao/MyBatis/Maps/System.xml b/Dao/MyBatis/Maps/System.xml index 4f6aa2a..9ce0368 100644 --- a/Dao/MyBatis/Maps/System.xml +++ b/Dao/MyBatis/Maps/System.xml @@ -10,6 +10,7 @@ + @@ -1375,5 +1376,29 @@ order by edno desc + + + insert into okcert3log (gubn, ret, reason, sn, rsltcd, rslt, dt) + select #gubn#, #retVal#, #reasonNo#, #sn#, #rsltCd#, #rslt#, now() + + SELECT LAST_INSERT_ID() + + + + + + update okcert3log set uno = $uno$ + where no = $no$; + + + + update okcert3log set enccd = #enccd# + where no = $no$; + + diff --git a/FO/Controllers/AccountController.cs b/FO/Controllers/AccountController.cs index b2345d8..12410f3 100644 --- a/FO/Controllers/AccountController.cs +++ b/FO/Controllers/AccountController.cs @@ -587,7 +587,106 @@ namespace NP.FO.Controllers } ViewBag.result = CP_CD + ":" + RSLT_CD + ":" + RSLT_MSG + ":" + MDL_TKN + ":" + TX_SEQ_No; return View(); - } + } + public ActionResult CertOk3Req2(String sel, String reason, String param1, String param2) + { + + String CP_CD = "V47690000000"; + String SITE_NAME = "YNICTE"; + String REQ_SITE_NM = "YNICTE"; + String REQ_URL = ""; + String RETURN_MSG = ""; + String SITE_URL = "https://" + Request.Url.Host; + //String SITE_URL = GetConfig("fronturl"); + //인증요청사유코드 + //00 : 회원가입 + //01 : 성인인증 + //02 : 회원정보수정 + //03 : 비밀번호찾기 + //04 : 상품구매 + //99 : 기타 + String RQST_CAUS_CD = reason == "Join" ? "00" : "02"; + String target = "PROD"; + String param = null; + String RSLT_CD = null; + String RSLT_MSG = null; + String MDL_TKN = null; + String TX_SEQ_No = null; + String RETURN_URL = ""; + String RTN_URL = ""; + String CHNL_CD = ""; + String license = ""; + String svcName = ""; + ViewBag.sel = sel; + ViewBag.tcUrl = ""; + ViewBag.PopupUrl = ""; + + //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") + { + license = "C:\\Windows\\SysWOW64\\" + CP_CD + "_IDS_01_" + target + "_AES_license.dat"; + svcName = "IDS_HS_POPUP_START"; + ViewBag.tcUrl = "kcb.oknm.online.safehscert.popup.cmd.P931_CertChoiceCmd"; + ViewBag.PopupUrl = "https://safe.ok-name.co.kr/CommonSvl"; + } + else if (sel == "IPIN") + { + license = "C:\\Windows\\SysWOW64\\" + CP_CD + "_TIS_01_" + target + "_AES_license.dat"; + svcName = "TIS_IPIN_POPUP_START"; + ViewBag.tcUrl = "kcb.tis.ti.cmd.LoginRPCert3Cmd"; + ViewBag.PopupUrl = "https://ipin.ok-name.co.kr/CommonSvl"; + } + + + JObject reqJson = new JObject(); + reqJson.Add("RETURN_URL", RETURN_URL); + reqJson.Add("REQ_SITE_NM", REQ_SITE_NM); + reqJson.Add("REQ_URL", REQ_URL); + reqJson.Add("RTN_URL", RTN_URL); + reqJson.Add("SITE_NAME", SITE_NAME); + reqJson.Add("SITE_URL", SITE_URL); + reqJson.Add("CHNL_CD", CHNL_CD); + reqJson.Add("RQST_CAUS_CD", RQST_CAUS_CD); + reqJson.Add("RETURN_MSG", RETURN_MSG); + + param = JsonConvert.SerializeObject(reqJson); + reqJson.RemoveAll(); + reqJson = null; + + //OkCert3 실행1 + OkCert3 myObject = new OkCert3Com.OkCert3() { }; + //객체생성실패 + if (myObject == null) + { + ViewBag.result = null; + } + else + { + //모듈호출, 결과 + dynamic ret = myObject.callOkCert3(target, CP_CD, svcName, param, license, out object mOut); + ViewBag.ret = ret; + + if (ret != 0) + { + ViewBag.result = null; + } + else + { + JObject outputobj = JObject.FromObject(JsonConvert.DeserializeObject(mOut.ToString())); + RSLT_CD = outputobj["RSLT_CD"].ToString(); + RSLT_MSG = outputobj["RSLT_MSG"].ToString(); + MDL_TKN = outputobj["MDL_TKN"].ToString(); + TX_SEQ_No = outputobj["TX_SEQ_NO"].ToString(); + } + } + ViewBag.result = CP_CD + ":" + RSLT_CD + ":" + RSLT_MSG + ":" + MDL_TKN + ":" + TX_SEQ_No; + return View(); + } #endregion #region 휴대폰인증 결과 @@ -791,9 +890,405 @@ namespace NP.FO.Controllers ViewBag.reason = reason; } return View(); - } + } + + public ActionResult CertOk3MOBI2(string reason, String param1, String param2) + { + String MDL_TKN = Request["MDL_TKN"]; + String CP_CD = "V47690000000"; + String target = "PROD"; + String svcName = "IDS_HS_POPUP_RESULT"; + String license = "C:\\Windows\\SysWOW64\\" + CP_CD + "_IDS_01_" + target + "_AES_license.dat"; + String TX_SEQ_NO = null; + String RSLT_CD = null; + String RSLT_MSG = null; + + String RSLT_NAME = null; + String RSLT_BIRTHDAY = null; + String RSLT_SEX_CD = null; + String RSLT_NTV_FRNR_CD = null; + String DI = null; + String CI = null; + String CI_UPDATE = null; + String TEL_COM_CD = null; + String TEL_NO = null; + String RETURN_MSG = null; + + int chkNo = 0; + + try + { + JObject reqJson = new JObject(); + JObject outputobj = new JObject(); + reqJson.Add("MDL_TKN", MDL_TKN); + + String param = JsonConvert.SerializeObject(reqJson); + reqJson.RemoveAll(); + reqJson = null; + + OkCert3 myObject = new OkCert3Com.OkCert3() { }; + + // 인증 후 결과값 + int reasonNo = -1; + string retVal = ""; + string rslt = ""; + string rsltCd = ""; + + switch (reason) + { + case "Join": + reasonNo = CertOkReason.Join.GetHashCode(); + break; + case "AuthPlatformChange": + reasonNo = CertOkReason.AuthPlatformChange.GetHashCode(); + break; + case "MobileNumberChange": + reasonNo = CertOkReason.MobileNumberChange.GetHashCode(); + break; + } + + if (myObject == null) + { + RETURN_MSG = null; + } + else + { + chkNo = 1; + dynamic ret = myObject.callOkCert3(target, CP_CD, svcName, param, license, out object mOut); + retVal = ((int)ret).ToString(); + myObject = null; + rslt = mOut.ToString(); + + outputobj = JObject.FromObject(JsonConvert.DeserializeObject(rslt)); + TX_SEQ_NO = outputobj["TX_SEQ_NO"].ToString(); + RSLT_CD = outputobj["RSLT_CD"].ToString(); + RSLT_MSG = outputobj["RSLT_MSG"].ToString(); + RETURN_MSG = outputobj["RETURN_MSG"].ToString(); + + if (RSLT_CD == "B000") + { + chkNo = 2; + RSLT_NAME = outputobj["RSLT_NAME"].ToString(); + RSLT_BIRTHDAY = outputobj["RSLT_BIRTHDAY"].ToString(); + RSLT_SEX_CD = outputobj["RSLT_SEX_CD"].ToString(); + RSLT_NTV_FRNR_CD = outputobj["RSLT_NTV_FRNR_CD"].ToString(); + DI = outputobj["DI"].ToString(); + CI = outputobj["CI"].ToString(); + CI_UPDATE = outputobj["CI_UPDATE"].ToString(); + TEL_COM_CD = outputobj["TEL_COM_CD"].ToString(); + TEL_NO = outputobj["TEL_NO"].ToString(); + + 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)) + { + rsltCd = CertOkRslt.Ok.ToString(); + + if (reason == "Join") + { + IList chk = Dao.Get("users.users", new System.Collections.Hashtable() { { "mobile", TEL_NO } }); + if (chk.Count() > 0) + { + RSLT_CD = "U000"; + rsltCd = CertOkRslt.DoubleMember.ToString(); + RSLT_MSG = "이미 해당 휴대폰번호로 등록된 회원이 존재합니다."; + } + else + { + IList chk2 = Dao.Get("users.users", new System.Collections.Hashtable() { { "di", DI } }); + if (chk2.Count() > 0) + { + RSLT_CD = "U000"; + rsltCd = CertOkRslt.DoubleCert.ToString(); + RSLT_MSG = "이미 해당 인증정보로 등록된 회원이 존재합니다."; + } + } + } + else if (reason == "AuthPlatformChange") + { + var user = Dao.Get("users.users", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo } }).FirstOrDefault(); + if (user != null) + { + if (string.IsNullOrEmpty(user.di)) + { + //정보수정시 본인제외 체크를 위해 usernonot추가 + IList chk = Dao.Get("users.users", new System.Collections.Hashtable() { { "mobile", TEL_NO }, { "usernonot", SUserInfo.UserNo } }); + if (chk.Count() > 0) + { + RSLT_CD = "U000"; + rsltCd = CertOkRslt.DoubleMember.ToString(); + RSLT_MSG = "이미 해당 휴대폰번호로 등록된 회원이 존재합니다."; + } + else + { + IList chk2 = Dao.Get("users.users", new System.Collections.Hashtable() { { "di", DI }, { "usernonot", SUserInfo.UserNo } }); + if (chk2.Count() > 0) + { + RSLT_CD = "U000"; + rsltCd = CertOkRslt.DoubleCert.ToString(); + RSLT_MSG = "이미 해당 인증정보로 등록된 회원이 존재합니다."; + } + } + } + else if (user.di == DI) + { + //정보수정시 본인제외 체크를 위해 usernonot추가 + IList chk = Dao.Get("users.users", new System.Collections.Hashtable() { { "mobile", TEL_NO }, { "usernonot", SUserInfo.UserNo } }); + if (chk.Count() > 0) + { + RSLT_CD = "U000"; + rsltCd = CertOkRslt.DoubleMember.ToString(); + RSLT_MSG = "이미 해당 휴대폰번호로 등록된 회원이 존재합니다."; + } + } + else + { + RSLT_CD = "U002"; + rsltCd = CertOkRslt.CertError.ToString(); + RSLT_MSG = "인증정보가 등록된 회원 인증정보와 일치하지 않습니다."; + } + } + else + { + RSLT_CD = "U999"; + rsltCd = CertOkRslt.NoMember.ToString(); + RSLT_MSG = "비로그인"; + } + + if (RSLT_CD == "B000") + { + // ci, di + } + } + else if (reason == "MobileNumberChange") + { + var user = Dao.Get("users.users", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo } }).FirstOrDefault(); + if (user != null) + { + if (string.IsNullOrEmpty(user.di)) + { + //정보수정시 본인제외 체크를 위해 usernonot추가 + IList chk = Dao.Get("users.users", new System.Collections.Hashtable() { { "mobile", TEL_NO }, { "usernonot", SUserInfo.UserNo } }); + if (chk.Count() > 0) + { + RSLT_CD = "U000"; + rsltCd = CertOkRslt.DoubleMember.ToString(); + RSLT_MSG = "이미 해당 휴대폰번호로 등록된 회원이 존재합니다."; + } + else + { + IList chk2 = Dao.Get("users.users", new System.Collections.Hashtable() { { "di", DI }, { "usernonot", SUserInfo.UserNo } }); + if (chk2.Count() > 0) + { + RSLT_CD = "U000"; + rsltCd = CertOkRslt.DoubleCert.ToString(); + RSLT_MSG = "이미 해당 인증정보로 등록된 회원이 존재합니다."; + } + } + } + else if (user.di == DI) + { + //정보수정시 본인제외 체크를 위해 usernonot추가 + IList chk = Dao.Get("users.users", new System.Collections.Hashtable() { { "mobile", TEL_NO }, { "usernonot", SUserInfo.UserNo } }); + if (chk.Count() > 0) + { + RSLT_CD = "U000"; + rsltCd = CertOkRslt.DoubleMember.ToString(); + RSLT_MSG = "이미 해당 휴대폰번호로 등록된 회원이 존재합니다."; + } + } + else + { + RSLT_CD = "U002"; + rsltCd = CertOkRslt.CertError.ToString(); + RSLT_MSG = "인증정보가 등록된 회원 인증정보와 일치하지 않습니다."; + } + } + else + { + RSLT_CD = "U999"; + rsltCd = CertOkRslt.NoMember.ToString(); + RSLT_MSG = "비로그인"; + } + } + } + else + { + RSLT_CD = "U001"; + rsltCd = CertOkRslt.NoPhone.ToString(); + RSLT_MSG = "휴대폰 번호 오류"; + } + } + else + { + rsltCd = CertOkRslt.NoCert.ToString(); + } + + chkNo = 3; + + outputobj = null; + mOut = null; + ViewBag.result = CP_CD + ":" + TX_SEQ_NO + ":" + RSLT_CD + ":" + RSLT_MSG + ":" + + RSLT_NAME + ":" + RSLT_BIRTHDAY + ":" + RSLT_SEX_CD + ":" + RSLT_NTV_FRNR_CD + ":" + + DI + ":" + CI + ":" + CI_UPDATE + ":" + TEL_COM_CD + ":" + + TEL_NO + ":" + RETURN_MSG; + Dao.Save("sys.kcblog.in", new Hashtable() { { "cp_cd", CP_CD }, { "mobile", TEL_NO }, { "logmsg", "RSLT_CD:" + RSLT_CD + "&RSLT_MSG:" + RSLT_MSG } }); + + //ViewBag.reason = reason; + } + + chkNo = 4; + // 인증 결과 데이터 저장 + string gubn = "MOBI"; + int sn1 = GetRand(); + int sn2 = GetRand2(); + string sn = sn1.ToString() + sn2.ToString(); + string dtStr = string.Format("{0:yyyyMMddHHmmss}", DateTime.Now); + Model.OkCert3Item okCert3item = new OkCert3Item(); + okCert3item.gubn = gubn; + okCert3item.retVal = retVal; + okCert3item.reasonNo = reasonNo; + okCert3item.sn = sn; + okCert3item.rsltCd = rsltCd; + okCert3item.rslt = rslt; + + chkNo = 5; + Dao.Insert("sys.okcert3.in", okCert3item); + bool errChk = false; + string paramStr = ""; + ViewBag.formUrl = ""; + ViewBag.result = ""; + ViewBag.rsltCd = rsltCd; + + chkNo = 6; + switch (reason) + { + case "Join": + if (RSLT_CD == "B000" && rsltCd == "Ok") + { + ViewBag.formUrl = "/Account/Join"; + paramStr += okCert3item.no; + paramStr += "," + sn; + paramStr += "," + gubn; + paramStr += "," + reasonNo; + paramStr += "," + rsltCd; + + //paramEncStr = "stringval:" + EncString(paramStr); + ViewBag.result = EncString(paramStr); + } + else + { + errChk = true; + ViewBag.result = rsltCd; + } + break; + case "AuthPlatformChange": + ViewBag.formUrl = ""; + if (RSLT_CD == "B000" && rsltCd == "Ok") + { + paramStr += okCert3item.no; + paramStr += "," + sn; + paramStr += "," + gubn; + paramStr += "," + reasonNo; + paramStr += "," + rsltCd; + + //paramEncStr = "stringval:" + EncString(paramStr); + ViewBag.result = EncString(paramStr); + } + else + { + errChk = true; + ViewBag.result = getOkCertErrMsg(rsltCd); + } + break; + case "MobileNumberChange": + ViewBag.formUrl = ""; + if (RSLT_CD == "B000" && rsltCd == "Ok") + { + paramStr += okCert3item.no; + paramStr += "," + sn; + paramStr += "," + gubn; + paramStr += "," + reasonNo; + paramStr += "," + rsltCd; + + //paramEncStr = "stringval:" + EncString(paramStr); + ViewBag.result = EncString(paramStr); + } + else + { + errChk = true; + ViewBag.result = getOkCertErrMsg(rsltCd); + } + break; + } + + chkNo = 7; + /* + * AuthPlatformChange, MobileNumberChange 에 맞춰서 + * 마이페이지 수정부분 체크하여 수정하기 + */ + + if (errChk) + { + ViewBag.result = getOkCertErrMsg(rsltCd); + } + else + { + ViewBag.result = HttpUtility.UrlEncode(ViewBag.result); + Dao.Save("sys.okcert3.setEnccd", new Hashtable { { "enccd", ViewBag.result }, { "no", okCert3item.no } }); + } + } + catch (Exception e) + { + ViewBag.result = "er.(" + chkNo + "||" + RSLT_CD + ")" + e.Message; + } + + return View(); + } #endregion + public string getOkCertErrMsg(string rsltCd) + { + string result = ""; + + switch (rsltCd) + { + case "DoubleMember": + result = "er.이미 해당 휴대폰번호로 등록된 회원이 존재합니다."; + break; + case "DoubleiPinMember": + result = "er.이미 해당 ipin으로 등록된 회원이 존재합니다."; + break; + case "DoubleCert": + result = "er.이미 해당 인증정보로 등록된 회원이 존재합니다."; + break; + case "CertError": + result = "er.인증정보가 등록된 회원 인증정보와 일치하지 않습니다."; + break; + case "NoMember": + result = "er.회원정보를 찾을 수 없습니다."; + break; + case "NoPhone": + result = "er.인증정보에 입력된 핸드폰정보를 찾을 수 없습니다."; + break; + case "iPinError": + result = "er.ipin 번호 오류 입니다."; + break; + case "CmiNo": + result = "er.잘못된 회차키 입니다."; + break; + case "LectNo": + result = "er.잘못된 강좌코드 입니다."; + break; + default: + // NoCert + result = "er.인증에 실패하였습니다."; + break; + } + + return result; + } + + #region IPIN인증 결과 /// /// IPIN인증 결과 @@ -1006,6 +1501,351 @@ namespace NP.FO.Controllers } return View(); } + public ActionResult CertOk3IPIN2(string reason, string param1, string param2) + { + String MDL_TKN = Request["MDL_TKN"]; + String CP_CD = "V47690000000"; + String target = "PROD"; + String svcName = "TIS_IPIN_POPUP_RESULT"; + String license = "C:\\Windows\\SysWOW64\\" + CP_CD + "_TIS_01_" + target + "_AES_license.dat"; + String TX_SEQ_NO = null; + String RSLT_CD = null; + String RSLT_MSG = null; + + String RSLT_NAME = null; + String RSLT_BIRTHDAY = null; + String RSLT_SEX_CD = null; + String RSLT_NTV_FRNR_CD = null; + String DI = null; + String CI = null; + String CI_UPDATE = null; + String VSSN = null; + String RETURN_MSG = null; + + try + { + JObject reqJson = new JObject(); + JObject outputobj = new JObject(); + reqJson.Add("MDL_TKN", MDL_TKN); + + String param = JsonConvert.SerializeObject(reqJson); + reqJson.RemoveAll(); + reqJson = null; + + OkCert3 myObject = new OkCert3Com.OkCert3() { }; + + // 인증 후 결과값 + int reasonNo = -1; + string retVal = ""; + string rslt = ""; + string rsltCd = ""; + + switch (reason) + { + case "Join": + reasonNo = CertOkReason.Join.GetHashCode(); + break; + case "AuthPlatformChange": + reasonNo = CertOkReason.AuthPlatformChange.GetHashCode(); + break; + case "MobileNumberChange": + reasonNo = CertOkReason.MobileNumberChange.GetHashCode(); + break; + } + + if (myObject == null) + { + RETURN_MSG = null; + } + else + { + dynamic ret = myObject.callOkCert3(target, CP_CD, svcName, param, license, out object mOut); + retVal = ((int)ret).ToString(); + myObject = null; + rslt = mOut.ToString(); + + outputobj = JObject.FromObject(JsonConvert.DeserializeObject(mOut.ToString())); + TX_SEQ_NO = outputobj["TX_SEQ_NO"].ToString(); + RSLT_CD = outputobj["RSLT_CD"].ToString(); + RSLT_MSG = outputobj["RSLT_MSG"].ToString(); + RETURN_MSG = outputobj["RETURN_MSG"].ToString(); + + if (RSLT_CD == "T000") + { + RSLT_NAME = outputobj["RSLT_NAME"].ToString(); + RSLT_BIRTHDAY = outputobj["RSLT_BIRTHDAY"].ToString(); + RSLT_SEX_CD = outputobj["RSLT_SEX_CD"].ToString(); + RSLT_NTV_FRNR_CD = outputobj["RSLT_NTV_FRNR_CD"].ToString(); + DI = outputobj["DI"].ToString(); + 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(); + if (reason == "Join") + { + IList chk = Dao.Get("users.users", new System.Collections.Hashtable() { { "vssn", VSSN } }); + if (chk.Count() > 0) + { + RSLT_CD = "U000"; + rsltCd = CertOkRslt.DoubleiPinMember.ToString(); + RSLT_MSG = "이미 해당 ipin으로 등록된 회원이 존재합니다."; + } + else + { + IList chk2 = Dao.Get("users.users", new System.Collections.Hashtable() { { "di", DI } }); + if (chk2.Count() > 0) + { + RSLT_CD = "U000"; + rsltCd = CertOkRslt.DoubleCert.ToString(); + RSLT_MSG = "이미 해당 인증정보로 등록된 회원이 존재합니다."; + } + } + } + else if (reason == "AuthPlatformChange") + { + var user = Dao.Get("users.users", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo } }).FirstOrDefault(); + if (user != null) + { + if (string.IsNullOrEmpty(user.di)) + { + //정보수정시 본인제외 체크를 위해 usernonot추가 + IList chk = Dao.Get("users.users", new System.Collections.Hashtable() { { "vssn", VSSN }, { "usernonot", SUserInfo.UserNo } }); + if (chk.Count() > 0) + { + RSLT_CD = "U000"; + rsltCd = CertOkRslt.DoubleCert.ToString(); + RSLT_MSG = "이미 해당 ipin으로 등록된 회원이 존재합니다."; + } + else + { + IList chk2 = Dao.Get("users.users", new System.Collections.Hashtable() { { "di", DI }, { "usernonot", SUserInfo.UserNo } }); + if (chk2.Count() > 0) + { + RSLT_CD = "U000"; + rsltCd = CertOkRslt.DoubleCert.ToString(); + RSLT_MSG = "이미 해당 인증정보로 등록된 회원이 존재합니다."; + } + } + } + else if (user.di == DI) + { + //정보수정시 본인제외 체크를 위해 usernonot추가 + IList chk = Dao.Get("users.users", new System.Collections.Hashtable() { { "vssn", VSSN }, { "usernonot", SUserInfo.UserNo } }); + if (chk.Count() > 0) + { + RSLT_CD = "U000"; + rsltCd = CertOkRslt.DoubleCert.ToString(); + RSLT_MSG = "이미 해당 ipin으로 등록된 회원이 존재합니다."; + } + } + else + { + RSLT_CD = "U002"; + rsltCd = CertOkRslt.CertError.ToString(); + RSLT_MSG = "인증정보가 등록된 회원 인증정보와 일치하지 않습니다."; + } + } + else + { + RSLT_CD = "U999"; + rsltCd = CertOkRslt.NoMember.ToString(); + RSLT_MSG = "비로그인"; + } + } + else if (reason == "LectinningAuth") + { + var user = Dao.Get("users.users", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo } }).FirstOrDefault(); + if (user != null) + { + if (string.IsNullOrEmpty(user.di) || user.di == DI) + { + + if (long.TryParse(param1, out long lectno)) + { + if (long.TryParse(param2, out long cmino)) + { + var lectInnings = Dao.Get("cr.cminnings", new System.Collections.Hashtable() { { "lectno", lectno }, { "userno", SUserInfo.UserNo } }); + if (lectInnings.Where(w => w.cmino == cmino).Count() > 0) + { + var Hashtable = new System.Collections.Hashtable() { + { "lectno", lectno }, + { "cmino", cmino }, + { "isattcheck", 1 }, + { "userno", SUserInfo.UserNo }, + { "uno", SUserInfo.UserNo }, + { "uip", GetUserIP() } + }; + Dao.Save("lect.lectinning.isatt.in", Hashtable); + ViewBag.lectno = lectno; + ViewBag.cmino = cmino; + } + else + { + RSLT_CD = "U998"; + rsltCd = CertOkRslt.CmiNo.ToString(); + RSLT_MSG = "cmino 에러"; + } + } + else + { + RSLT_CD = "U998"; + rsltCd = CertOkRslt.CmiNo.ToString(); + RSLT_MSG = "cmino 에러"; + } + } + else + { + RSLT_CD = "U998"; + rsltCd = CertOkRslt.LectNo.ToString(); + RSLT_MSG = "lectno 에러"; + } + } + else + { + RSLT_CD = "U002"; + rsltCd = CertOkRslt.CertError.ToString(); + RSLT_MSG = "인증정보가 등록된 회원 인증정보와 일치하지 않습니다."; + } + } + else + { + RSLT_CD = "U999"; + rsltCd = CertOkRslt.NoMember.ToString(); + RSLT_MSG = "비로그인"; + } + } + } + else + { + RSLT_CD = "U001"; + rsltCd = CertOkRslt.iPinError.ToString(); + RSLT_MSG = "ipin 번호 오류"; + } + } + else + { + rsltCd = CertOkRslt.NoCert.ToString(); + } + + outputobj = null; + mOut = null; + ViewBag.result = CP_CD + ":" + TX_SEQ_NO + ":" + RSLT_CD + ":" + RSLT_MSG + ":" + + 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 } }); + } + + string gubn = "IPIN"; + int sn1 = GetRand(); + int sn2 = GetRand2(); + string sn = sn1.ToString() + sn2.ToString(); + Model.OkCert3Item okCert3item = new OkCert3Item(); + okCert3item.gubn = "IPIN"; + okCert3item.retVal = retVal; + okCert3item.reasonNo = reasonNo; + okCert3item.sn = sn; + okCert3item.rsltCd = rsltCd; + okCert3item.rslt = rslt; + + Dao.Insert("sys.okcert3.in", okCert3item); + bool errChk = false; + string paramStr = ""; + ViewBag.formUrl = ""; + ViewBag.result = ""; + ViewBag.rsltCd = rsltCd; + + switch (reason) + { + case "Join": + if (RSLT_CD == "T000" && rsltCd == "Ok") + { + ViewBag.formUrl = "/Account/Join"; + paramStr += okCert3item.no; + paramStr += "," + sn; + paramStr += "," + gubn; + paramStr += "," + reasonNo; + paramStr += "," + rsltCd; + + //paramEncStr = "stringval:" + EncString(paramStr); + ViewBag.result = EncString(paramStr); + } + else + { + errChk = true; + ViewBag.result = rsltCd; + } + break; + case "AuthPlatformChange": + ViewBag.formUrl = ""; + if (RSLT_CD == "T000" && rsltCd == "Ok") + { + paramStr += okCert3item.no; + paramStr += "," + sn; + paramStr += "," + gubn; + paramStr += "," + reasonNo; + paramStr += "," + rsltCd; + + //paramEncStr = "stringval:" + EncString(paramStr); + ViewBag.result = EncString(paramStr); + } + else + { + errChk = true; + ViewBag.result = getOkCertErrMsg(rsltCd); + } + break; + case "MobileNumberChange": + ViewBag.formUrl = ""; + if (RSLT_CD == "T000" && rsltCd == "Ok") + { + paramStr += okCert3item.no; + paramStr += "," + sn; + paramStr += "," + gubn; + paramStr += "," + reasonNo; + paramStr += "," + rsltCd; + + //paramEncStr = "stringval:" + EncString(paramStr); + ViewBag.result = EncString(paramStr); + } + else + { + errChk = true; + ViewBag.result = getOkCertErrMsg(rsltCd); + } + break; + } + //ViewBag.reason = reason; + + if (errChk) + { + ViewBag.result = getOkCertErrMsg(rsltCd); + } + else + { + ViewBag.result = HttpUtility.UrlEncode(ViewBag.result); + Dao.Save("sys.okcert3.setEnccd", new Hashtable { { "enccd", ViewBag.result }, { "no", okCert3item.no } }); + } + } + catch (Exception e) + { + ViewBag.result = "er." + e.Message.Replace("\\r", "").Replace("\\n", ""); + } + + return View(); + } #endregion /// diff --git a/FO/Controllers/FOBaseController.cs b/FO/Controllers/FOBaseController.cs index 66af367..87867f4 100644 --- a/FO/Controllers/FOBaseController.cs +++ b/FO/Controllers/FOBaseController.cs @@ -34,11 +34,16 @@ 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("/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" + ) { //Response.Redirect("http://" + Request.Url.Host + Request.Url.PathAndQuery, true); filterContext.Result = new RedirectResult("http://" + Request.Url.Host + Request.Url.PathAndQuery); diff --git a/FO/FO.csproj b/FO/FO.csproj index 4401464..f4b6ab4 100644 --- a/FO/FO.csproj +++ b/FO/FO.csproj @@ -64,6 +64,9 @@ ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.7\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll + + ..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll + False ..\References\NPDao.dll @@ -167,9 +170,6 @@ - - ..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll - ..\packages\Microsoft.ApplicationInsights.2.2.0\lib\net45\Microsoft.ApplicationInsights.dll @@ -740,6 +740,8 @@ + + diff --git a/FO/Views/Account/CertOk3IPIN2.cshtml b/FO/Views/Account/CertOk3IPIN2.cshtml new file mode 100644 index 0000000..43a10a2 --- /dev/null +++ b/FO/Views/Account/CertOk3IPIN2.cshtml @@ -0,0 +1,16 @@ +@using NP.Model.ENUM +@{ + Layout = null; +} + + + + diff --git a/FO/Views/Account/CertOk3MOBI.cshtml b/FO/Views/Account/CertOk3MOBI.cshtml index dd5fe74..a619918 100644 --- a/FO/Views/Account/CertOk3MOBI.cshtml +++ b/FO/Views/Account/CertOk3MOBI.cshtml @@ -65,9 +65,9 @@ $(opener.document).find("#mform").find("#mobile").val("@(TEL_NO)".replaceAll("-", "")); $(opener.document).find("#mform").find("#mobile").prop("readonly", true); $(opener.document).find("#mform").find("#mobilestr").text("@(TEL_NO)".replaceAll("-", "")); - try { - $(opener.document).find("#mform").find("#txtbirthday").text(moment("@(RSLT_BIRTHDAY)").format('YYYY.MM.DD')); - } catch (error) { + try { + $(opener.document).find("#mform").find("#txtbirthday").text(moment("@(RSLT_BIRTHDAY)").format('YYYY.MM.DD')); + } catch (error) { } alert("인증완료"); } else { diff --git a/FO/Views/Account/CertOk3MOBI2.cshtml b/FO/Views/Account/CertOk3MOBI2.cshtml new file mode 100644 index 0000000..43a10a2 --- /dev/null +++ b/FO/Views/Account/CertOk3MOBI2.cshtml @@ -0,0 +1,16 @@ +@using NP.Model.ENUM +@{ + Layout = null; +} + + + + diff --git a/FO/Views/Account/CertOk3MOBI_old.cshtml b/FO/Views/Account/CertOk3MOBI_old.cshtml new file mode 100644 index 0000000..dd5fe74 --- /dev/null +++ b/FO/Views/Account/CertOk3MOBI_old.cshtml @@ -0,0 +1,88 @@ +@using NP.Model.ENUM +@{ + Layout = null; + var CP_CD = (ViewBag.result ?? "").Split(':')[0]; + var TX_SEQ_NO = (ViewBag.result ?? "").Split(':')[1]; + var RSLT_CD = (ViewBag.result ?? "").Split(':')[2]; + var RSLT_MSG = (ViewBag.result ?? "").Split(':')[3]; + var RSLT_NAME = (ViewBag.result ?? "").Split(':')[4]; + var RSLT_BIRTHDAY = (ViewBag.result ?? "").Split(':')[5]; + var RSLT_SEX_CD = (ViewBag.result ?? "").Split(':')[6]; + var RSLT_NTV_FRNR_CD = (ViewBag.result ?? "").Split(':')[7]; + var DI = (ViewBag.result ?? "").Split(':')[8]; + var CI = (ViewBag.result ?? "").Split(':')[9]; + var CI_UPDATE = (ViewBag.result ?? "").Split(':')[10]; + var TEL_COM_CD = (ViewBag.result ?? "").Split(':')[11]; + var TEL_NO = (ViewBag.result ?? "").Split(':')[12]; + var RETURN_MSG = (ViewBag.result ?? "").Split(':')[13]; +} + + +
+
+ + \ No newline at end of file diff --git a/FO/Views/Account/Join.cshtml b/FO/Views/Account/Join.cshtml index bedef7d..f86f0f3 100644 --- a/FO/Views/Account/Join.cshtml +++ b/FO/Views/Account/Join.cshtml @@ -31,7 +31,6 @@ else
  • 2. 신청서 작성
  • 3. 회원가입완료
  • -
    @Html.HiddenFor(w => w.User.birthday) @Html.HiddenFor(w => w.User.username) @@ -132,6 +131,7 @@ else 동의 후 가입 +
    @Html.Partial("./Partial/BoxAssign", null, new ViewDataDictionary { { "bindmethod", "bindassign" }, { "isjoin", 1 } }) diff --git a/FO/Views/Account/JoinIdVeri.cshtml b/FO/Views/Account/JoinIdVeri.cshtml index 9f9ee84..65497bb 100644 --- a/FO/Views/Account/JoinIdVeri.cshtml +++ b/FO/Views/Account/JoinIdVeri.cshtml @@ -7,31 +7,31 @@
    - @Html.HiddenFor(w=>w.User.birthday) - @Html.HiddenFor(w=>w.User.username) - @Html.HiddenFor(w=>w.User.mobile) - @Html.HiddenFor(w=>w.User.vssn) - @Html.HiddenFor(w=>w.User.di) - @Html.HiddenFor(w=>w.User.ci) - @Html.HiddenFor(w=>w.intval2) - @Html.HiddenFor(w=>w.User.jointype) - @Html.HiddenFor(w=>w.User.authplatform) + @Html.HiddenFor(w => w.User.birthday) + @Html.HiddenFor(w => w.User.username) + @Html.HiddenFor(w => w.User.mobile) + @Html.HiddenFor(w => w.User.vssn) + @Html.HiddenFor(w => w.User.di) + @Html.HiddenFor(w => w.User.ci) + @Html.HiddenFor(w => w.intval2) + @Html.HiddenFor(w => w.User.jointype) + @Html.HiddenFor(w => w.User.authplatform)
    -
    -
    - i-PIN 인증 -

    i-PIN 인증

    - 인증하기 -
    +
    +
    + i-PIN 인증 +

    i-PIN 인증

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

    휴대폰 본인인증

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

    휴대폰 본인인증

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

    카드인증

    @@ -40,4 +40,33 @@
    *@
    @Html.Partial("./Partial/OkCert3", null, new ViewDataDictionary { }) -

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

    \ No newline at end of file +

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

    + +
    + +
    + + +@*@{ + string errMsg = ""; + if (ViewBag.rsltCd != "") + { + errMsg = ((string)ViewBag.rsltCd).Replace("er.", ""); + + } +}*@ + diff --git a/FO/Views/My/MyInfoCheck.cshtml b/FO/Views/My/MyInfoCheck.cshtml index ae6329a..54ac5f2 100644 --- a/FO/Views/My/MyInfoCheck.cshtml +++ b/FO/Views/My/MyInfoCheck.cshtml @@ -24,14 +24,14 @@ - - - - + + + + - + @@ -83,67 +83,60 @@ - - + + - + @* - - - *@ + + + *@ @* - - - *@ + + + *@
    ID

    @u.userid

    이름(한글)

    @u.username

    이름(한글)

    @u.username

    비밀번호
    비밀번호 확인
    생년월일

    - @if (!string.IsNullOrEmpty(u.birthday)) - { - @(u.birthday.Replace("-", ".")) - } + @if (!string.IsNullOrEmpty(u.birthday)) + { + @(u.birthday.Replace("-", ".")) + }

    학습인증수단 -
    +

    @(u.authplatform == AuthPlatform.None ? "-" : "I-PIN 인증")

    - 휴대폰 인증으로 변경 -
    - +

    @(u.authplatform == AuthPlatform.None ? "-" : "휴대폰 인증")

    - I-PIN 인증으로 변경 + I-PIN 인증으로 변경

    ※ 인증수단 변경 시 추가 인증을 진행해야 합니다.
    ※ 추가 인증 후 하단의 [저장] 버튼을 클릭해야 변경이 완료됩니다.
    연락처
    - @if(u.authplatform == AuthPlatform.Mobile) - { - -

    @(u.mobile)

    수정 - } - else - { - - } + +

    @(u.mobile)

    수정
    소속 -
      -
    • -
    • -
    -
    소속 +
      +
    • +
    • +
    +
    직장 -
    - -

    @(u.asname ?? "-")

    - 수정 -
    -
    직장 +
    + +

    @(u.asname ?? "-")

    + 수정 +
    +
    학력 @@ -195,6 +188,9 @@ + + + @Html.Partial("./Partial/OkCert3", null, new ViewDataDictionary { })
      @@ -219,16 +215,22 @@
      문의 : 1544-7660
      @*
      탈퇴사유
      - - *@ + + *@ + +
      + +
      + + @Html.Partial("./Partial/BoxAssign", null, new ViewDataDictionary { { "bindmethod", "bindassign" } }) @section scriptsHeader{ @Html.Partial("./Partial/ScriptPost") @@ -249,7 +251,7 @@ var referrer = document.referrer; if (referrer.toLowerCase().indexOf('myinfocheck') > 0 || referrer.toLowerCase().indexOf('snslinkcallback') > 0) { selectTab("sns"); - + } $("input:radio[name='isCompany']").on("click", function () { @@ -266,10 +268,10 @@ } }); - $("#userpno2").on("keyup", function () { + $("#userpno2").on("keyup", function () { setbirthday(val("userpno1") + val("userpno2")); }); - }); + }); function chkassign() { var isCompany = $("input:radio[name='isCompany']:checked").val(); if (isCompany == "1") { @@ -277,9 +279,9 @@ } } function setbirthday(userpno) { - var birthday = ""; + var birthday = ""; if (userpno.length == 13 && moment(userpno.substr(0, 6), 'YYMMDD', true).isValid() && userpno.substr(6, 1) > 0) - { + { switch (userpno.substr(6, 1)) { case "1": @@ -310,7 +312,7 @@ break; } - birthday += userpno.substr(0, 2) + "-" + userpno.substr(2, 2) + "-" + userpno.substr(4, 2); + birthday += userpno.substr(0, 2) + "-" + userpno.substr(2, 2) + "-" + userpno.substr(4, 2); } if (val("birthday") == "" && birthday != "") { $("#txtbirthday").text(birthday.replace(/-/gi, ".")); @@ -348,12 +350,23 @@ else if (val("userpass") != "" && !ispassword(val("userpass"))) { focus("userpass"); msg("(8자 이상, 영문/숫자/특수기호 포함) 규칙으로 비밀번호를 입력해주세요."); } else if (isRepeatedString(val("userpass"))) { focus("userpass"); msg("반복되는 문자/숫자를 사용할 수 없습니다."); } else if (val("userpass") != "" && val("userpass") != val("userpass2")) { focus("userpass2"); msg("비밀번호 확인이 다릅니다."); } - else if (check("mobile", null, "휴대전화번호를 입력해주세요.")) { } - else if (!ismobilenumber(val("mobile"))) { focus("mobile"); msg("휴대전화번호를 확인해주세요."); } + + // else if (check("mobile", null, "휴대전화번호를 입력해주세요.")) { } + // else if (!ismobilenumber(val("mobile"))) { focus("mobile"); msg("휴대전화번호를 확인해주세요."); } + else if (!isemail(val("email"))) { focus("email1"); msg("올바른 이메일주소를 입력해주세요."); } //else if ($("input:radio[name='isCompany']:checked").val() == "1" && check("asno", "btnassign", "직장을 선택해주세요.")) { } else { - cap("/fcommon/UserPassCheck", "mform", "save2"); + if ($("#authPlatform_IPIN").css("display") == "block") { + cap("/fcommon/UserPassCheck", "mform", "save2"); + } + else { + if (check("mobile", null, "휴대전화번호를 입력해주세요.")) { } + else if (!ismobilenumber(val("mobile"))) { focus("mobile"); msg("휴대전화번호를 확인해주세요."); } + else { + cap("/fcommon/UserPassCheck", "mform", "save2"); + } + } } } else if (idx == 0) { $('html, body').addClass('lock'); @@ -366,6 +379,8 @@ function save2() { if (capResult.obj == 0) { cap("/fcommon/usersave", "mform", "cbsave"); + }else if (capResult.obj == -1) { + msg("입력된 정보와 인증정보가 일치하지 않습니다."); } else { msg("이미 사용된 비밀번호는 사용할 수 없습니다."); @@ -385,6 +400,9 @@ function cbsave() { if (capResult.code == 1000) { msg("저장되었습니다."); + cap("/fcommon/userGetMyinfo", "mform", "cbsave2"); + } else if (capResult.obj == -1) { + msg("입력된 정보와 인증정보가 일치하지 않습니다."); } else if (capResult.obj == -2) { msg("이미 사용중인 이메일주소입니다. 다른 이메일주소를 사용해주세요."); } else { @@ -392,6 +410,36 @@ } } + function cbsave2() { + if (capResult.code == 1000) { + + $("#mobile").val(capResult.obj.mobile) + $("#mobilestr").text(capResult.obj.MobileFormat) + + if (capResult.obj.authplatform == 1) { + $("#authPlatform_IPIN").css("display", "") + $("#authPlatform_Mobile").css("display", "none") + } + else if (capResult.obj.authplatform == 2) { + $("#authPlatform_IPIN").css("display", "none") + $("#authPlatform_Mobile").css("display", "") + } + else { + $("#authPlatform_IPIN").css("display", "") + $("#authPlatform_Mobile").css("display", "") + } + $("#authplatform").val(capResult.obj.authplatform) + $("#post").val(capResult.obj.post) + $("#address1").val(capResult.obj.address1) + $("#address2").val(capResult.obj.address2) + + msg("저장되었습니다."); + } + else { + msg("사용자 정보를 불러오는데 실패하였습니다.") + } + } + function selectTab(type) { if (type == "user") { $("#liSnsTab").removeClass("current"); @@ -469,7 +517,7 @@ msg("구글 아이디로 로그인에 실패했습니다."); return; }); - } + } function loginWithNaver() { $("#naverIdLogin_loginButton > img").trigger("click"); @@ -479,6 +527,46 @@ naverLogin.init(); Kakao.init("@kakaoClientId"); } + + function certRslt(val) { + if (val.indexOf("er.") == -1) { + $("#frm #stringval").val(val) + var data = $("#frm").serialize() + capp("/focommon/GetOkCert3Rslt", data, "certOkRslt"); + } + else { + msg(val.replace("er.", "")) + } + } + + function certOkRslt() { + //console.log(capResult.obj); + + if (capResult.obj.username == $("#username").val().trim()) { + $("#okcert3no").val(capResult.obj.no); + $("#okcert3sn").val(capResult.obj.sn); + $("#okcert3gb").val(capResult.obj.gubn); + if (capResult.obj.gubn == "MOBI") { + $("#mobilestr").text(capResult.obj.mobile) + $("#mobile").val(capResult.obj.mobile.replace(/-/gi, "")) + } + if (capResult.obj.gubn == "IPIN") { + $("#authPlatform_IPIN").css("display", "") + $("#authPlatform_Mobile").css("display", "none") + + }else if (capResult.obj.gubn == "MOBI") { + $("#authPlatform_IPIN").css("display", "none") + $("#authPlatform_Mobile").css("display", "") + } + else { + $("#authPlatform_IPIN").css("display", "") + $("#authPlatform_Mobile").css("display", "") + } + } + else { + msg("입력된 정보와 인증정보가 일치하지 않습니다.") + } + } @*header가 아니라 하단에 위치해야 읽어올수있음*@ } diff --git a/FO/Views/Shared/Partial/OkCert3.cshtml b/FO/Views/Shared/Partial/OkCert3.cshtml index 5900718..b905689 100644 --- a/FO/Views/Shared/Partial/OkCert3.cshtml +++ b/FO/Views/Shared/Partial/OkCert3.cshtml @@ -25,4 +25,13 @@ popupWindow.focus(); } } + + function certok3request(sel, reason, param1, param2) { + var popupWindow = window.open("/Account/CertOk3Req2?sel=" + sel + "&reason=" + reason + (param1 ? "¶m1=" + param1 : "") + (param2 ? "¶m2=" + param2 : ""), "auth_popup", "width=450,height=640,scrollbar=yes,resizable=no"); + if (popupWindow == null) { + msg("팝업이 차단되어 있습니다. 차단을 해제해 주세요."); + } else { + popupWindow.focus(); + } + } \ No newline at end of file diff --git a/FO/Web.config b/FO/Web.config index 7abd95d..f069979 100644 --- a/FO/Web.config +++ b/FO/Web.config @@ -173,7 +173,7 @@ --> - + @@ -191,7 +191,7 @@ - + diff --git a/FO/packages.config b/FO/packages.config index 7f968ea..e7f920e 100644 --- a/FO/packages.config +++ b/FO/packages.config @@ -30,7 +30,7 @@ - + diff --git a/Model/ENUM.cs b/Model/ENUM.cs index 11a6580..8a5e51e 100644 --- a/Model/ENUM.cs +++ b/Model/ENUM.cs @@ -111,4 +111,68 @@ namespace NP.Model.ENUM /// Mobile } + + public enum CertOkReason + { + /// + /// 회원가입 + /// + Join, + /// + /// 인증정보변경 + /// + AuthPlatformChange, + /// + /// 핸드폰 번호 변경 + /// + MobileNumberChange + } + + public enum CertOkRslt + { + /// + /// 정상 + /// + Ok, + /// + /// (휴대폰 본인인증) 사용시 중복 핸드폰 번호 + /// + DoubleMember, + /// + /// 인증정보 사용중인 중복회원 + /// + DoubleCert, + /// + /// 인증결과의 회원정보가 일치하지 않음 + /// + CertError, + /// + /// 회원정보를 찾을 수 없음 + /// + NoMember, + /// + /// (휴대폰 본인인증) 입력된 핸드폰 번호 없음 + /// + NoPhone, + /// + /// 인증 실패 + /// + NoCert, + /// + /// (아이핀) 이미 해당 ipin으로 등록된 회원이 존재합니다. + /// + DoubleiPinMember, + /// + /// (아이핀) ipin 번호 오류 + /// + iPinError, + /// + /// cmino 에러 + /// + CmiNo, + /// + /// cmino 에러 + /// + LectNo, + } } diff --git a/Model/Systems.cs b/Model/Systems.cs index 8e71286..752584c 100644 --- a/Model/Systems.cs +++ b/Model/Systems.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Text; namespace NP.Model { @@ -612,4 +611,29 @@ namespace NP.Model public int? pno { get; set; } public String loginfo { get; set; } } + + public class OkCert3Item + { + public long no { get; set; } + public string gubn { get; set; } + public string retVal { get; set; } + public int reasonNo { get; set; } + public string sn { get; set; } + public string rsltCd { get; set; } + public string rslt { get; set; } + } + + public class OkCert3Result { + public long no { get; set; } + public string gubn { get; set; } + public int reasonNo { get; set; } + public string sn { get; set; } + public string rsltCd { get; set; } + public string ci { get; set; } + public string di { get; set; } + public string vssn { get; set; } + public string birthday { get; set; } + public string username { get; set; } + public string mobile { get; set; } + } }