인증 DI 중복체크 로직 추가

This commit is contained in:
lch 2021-06-09 05:29:52 +00:00
parent d2048fbbe1
commit 1845e4274c
6 changed files with 185 additions and 65 deletions

View File

@ -101,6 +101,11 @@ namespace NP.Base.Controllers
} }
[HttpPost] [HttpPost]
public JsonResult UserSave(Users u) public JsonResult UserSave(Users u)
{
var user = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo } }).FirstOrDefault();
if (user != null)
{
if (string.IsNullOrEmpty(user.di) || user.di == u.di)
{ {
u.userno = SUserInfo.UserNo; u.userno = SUserInfo.UserNo;
u.uno = SUserInfo.UserNo; u.uno = SUserInfo.UserNo;
@ -113,7 +118,7 @@ namespace NP.Base.Controllers
telno.Length == 9 ? string.Format("{0}-{1}-{2}", telno.Substring(0, 2), telno.Substring(2, 3), telno.Substring(5, 4)) : telno.Length == 9 ? string.Format("{0}-{1}-{2}", telno.Substring(0, 2), telno.Substring(2, 3), telno.Substring(5, 4)) :
telno.Length == 8 ? string.Format("{0}-{1}", telno.Substring(0, 4), telno.Substring(4, 4)) : telno.Length == 8 ? string.Format("{0}-{1}", telno.Substring(0, 4), telno.Substring(4, 4)) :
telno.Length == 7 ? string.Format("{0}-{1}", telno.Substring(0, 3), telno.Substring(3, 4)) : u.telno; telno.Length == 7 ? string.Format("{0}-{1}", telno.Substring(0, 3), telno.Substring(3, 4)) : u.telno;
var check = Dao.Get<int>("users.checkuser", new Hashtable() { { "usernonot", SUserInfo.UserNo }, { "email", u.email },{"mobile",u.mobile } }).First(); var check = Dao.Get<int>("users.checkuser", new Hashtable() { { "usernonot", SUserInfo.UserNo }, { "email", u.email }, { "mobile", u.mobile } }).First();
if (check < 9) if (check < 9)
{ {
return JsonOK(check * -1); return JsonOK(check * -1);
@ -132,6 +137,9 @@ namespace NP.Base.Controllers
} }
return JsonOK(result); return JsonOK(result);
} }
}
return JsonOK(0);
}
[HttpPost] [HttpPost]
public JsonResult UserExit(String exitreason) public JsonResult UserExit(String exitreason)
{ {

View File

@ -238,7 +238,7 @@
,case when c.refcode='9' then a.ccpositionetc else c.cname end ccpositionname ,case when c.refcode='9' then a.ccpositionetc else c.cname end ccpositionname
,case when a.usertype=1 then '교육생' when d.authname is null then '-' else d.authname end usertypestr ,case when a.usertype=1 then '교육생' when d.authname is null then '-' else d.authname end usertypestr
,CAST(AES_DECRYPT(UNHEX(a.birthday), <include refid="sql.digest"></include>) AS char) birthday ,CAST(AES_DECRYPT(UNHEX(a.birthday), <include refid="sql.digest"></include>) AS char) birthday
,a.uduty,a.slevel,a.isacceptmobile,a.vssn,a.ischkatt,a.authplatform ,a.uduty,a.slevel,a.isacceptmobile,a.vssn,a.di,a.ci,a.ischkatt,a.authplatform
,row_number() over(order by <isNotNull property="orderby">$orderby$</isNotNull><isNull property="orderby">a.username</isNull>) rno ,row_number() over(order by <isNotNull property="orderby">$orderby$</isNotNull><isNull property="orderby">a.username</isNull>) rno
,count(a.cdt) over() pagetotalcount ,count(a.cdt) over() pagetotalcount
from users a from users a
@ -252,7 +252,7 @@
<isNull property="includesysadmin">and a.usertype &lt;&gt; 91</isNull> <isNull property="includesysadmin">and a.usertype &lt;&gt; 91</isNull>
<isNotNull property="userno">and a.userno =#userno#</isNotNull> <isNotNull property="userno">and a.userno =#userno#</isNotNull>
<isNotNull property="usernonot"> <isNotNull property="usernonot">
<isGreaterThan property="usernonot" compareValue="0">and a.userno &lt;&gt; #userno#</isGreaterThan> <isGreaterThan property="usernonot" compareValue="0">and a.userno &lt;&gt; #usernonot#</isGreaterThan>
</isNotNull> </isNotNull>
<isNotEmpty property="usertypes">and a.usertype in ($usertypes$)</isNotEmpty> <isNotEmpty property="usertypes">and a.usertype in ($usertypes$)</isNotEmpty>
<isNotNull property="usertype">and a.usertype =#usertype#</isNotNull> <isNotNull property="usertype">and a.usertype =#usertype#</isNotNull>
@ -272,6 +272,7 @@
</isNotEmpty> </isNotEmpty>
<isNotNull property="usertypeover" prepend="and">a.usertype &gt; #usertypeover#</isNotNull> <isNotNull property="usertypeover" prepend="and">a.usertype &gt; #usertypeover#</isNotNull>
<isNotNull property="vssn" prepend="and">a.vssn = #vssn#</isNotNull> <isNotNull property="vssn" prepend="and">a.vssn = #vssn#</isNotNull>
<isNotNull property="di" prepend="and">a.di = #di#</isNotNull>
) a ) a
<include refid="sql.pagedynamic"></include> <include refid="sql.pagedynamic"></include>
order by a.rno order by a.rno

View File

@ -509,7 +509,7 @@ namespace NP.FO.Controllers
RETURN_URL = GetConfig("fronturl") + "/Account/CertOk3" + sel + "?reason=" + reason + (!string.IsNullOrEmpty(param1) ? "&param1=" + param1 : "") + (!string.IsNullOrEmpty(param2) ? "&param2=" + param2 : ""); RETURN_URL = GetConfig("fronturl") + "/Account/CertOk3" + sel + "?reason=" + reason + (!string.IsNullOrEmpty(param1) ? "&param1=" + param1 : "") + (!string.IsNullOrEmpty(param2) ? "&param2=" + param2 : "");
RTN_URL = GetConfig("fronturl") + "/Account/CertOk3" + sel + "?reason=" + reason + (!string.IsNullOrEmpty(param1) ? "&param1=" + param1 : "") + (!string.IsNullOrEmpty(param2) ? "&param2=" + param2 : ""); RTN_URL = GetConfig("fronturl") + "/Account/CertOk3" + sel + "?reason=" + reason + (!string.IsNullOrEmpty(param1) ? "&param1=" + param1 : "") + (!string.IsNullOrEmpty(param2) ? "&param2=" + param2 : "");
//모바일팝업 //모바일팝업
if (sel == "MOBI" || sel == "MCHK") if (sel == "MOBI")
{ {
license = "C:\\Windows\\SysWOW64\\" + CP_CD + "_IDS_01_" + target + "_AES_license.dat"; license = "C:\\Windows\\SysWOW64\\" + CP_CD + "_IDS_01_" + target + "_AES_license.dat";
svcName = "IDS_HS_POPUP_START"; svcName = "IDS_HS_POPUP_START";
@ -653,10 +653,41 @@ namespace NP.FO.Controllers
RSLT_CD = "U000"; RSLT_CD = "U000";
RSLT_MSG = "이미 해당 휴대폰번호로 등록된 회원이 존재합니다."; RSLT_MSG = "이미 해당 휴대폰번호로 등록된 회원이 존재합니다.";
} }
else
{
IList<Users> chk2 = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "di", DI } });
if (chk2.Count() > 0)
{
RSLT_CD = "U000";
RSLT_MSG = "이미 해당 인증정보로 등록된 회원이 존재합니다.";
}
}
} }
else if (reason == "AuthPlatformChange") else if (reason == "AuthPlatformChange")
{ {
if (SUserInfo.UserNo > 0) var user = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo } }).FirstOrDefault();
if (user != null)
{
if (string.IsNullOrEmpty(user.di))
{
//정보수정시 본인제외 체크를 위해 usernonot추가
IList<Users> chk = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "mobile", TEL_NO }, { "usernonot", SUserInfo.UserNo } });
if (chk.Count() > 0)
{
RSLT_CD = "U000";
RSLT_MSG = "이미 해당 휴대폰번호로 등록된 회원이 존재합니다.";
}
else
{
IList<Users> chk2 = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "di", DI }, { "usernonot", SUserInfo.UserNo } });
if (chk2.Count() > 0)
{
RSLT_CD = "U000";
RSLT_MSG = "이미 해당 인증정보로 등록된 회원이 존재합니다.";
}
}
}
else if (user.di == DI)
{ {
//정보수정시 본인제외 체크를 위해 usernonot추가 //정보수정시 본인제외 체크를 위해 usernonot추가
IList<Users> chk = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "mobile", TEL_NO }, { "usernonot", SUserInfo.UserNo } }); IList<Users> chk = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "mobile", TEL_NO }, { "usernonot", SUserInfo.UserNo } });
@ -667,6 +698,12 @@ namespace NP.FO.Controllers
} }
} }
else else
{
RSLT_CD = "U002";
RSLT_MSG = "인증정보가 등록된 회원 인증정보와 일치하지 않습니다.";
}
}
else
{ {
RSLT_CD = "U999"; RSLT_CD = "U999";
RSLT_MSG = "비로그인"; RSLT_MSG = "비로그인";
@ -674,7 +711,10 @@ namespace NP.FO.Controllers
} }
else if (reason == "MobileNumberChange") else if (reason == "MobileNumberChange")
{ {
if (SUserInfo.UserNo > 0) var user = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo } }).FirstOrDefault();
if (user != null)
{
if (string.IsNullOrEmpty(user.di))
{ {
//정보수정시 본인제외 체크를 위해 usernonot추가 //정보수정시 본인제외 체크를 위해 usernonot추가
IList<Users> chk = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "mobile", TEL_NO }, { "usernonot", SUserInfo.UserNo } }); IList<Users> chk = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "mobile", TEL_NO }, { "usernonot", SUserInfo.UserNo } });
@ -683,6 +723,31 @@ namespace NP.FO.Controllers
RSLT_CD = "U000"; RSLT_CD = "U000";
RSLT_MSG = "이미 해당 휴대폰번호로 등록된 회원이 존재합니다."; RSLT_MSG = "이미 해당 휴대폰번호로 등록된 회원이 존재합니다.";
} }
else
{
IList<Users> chk2 = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "di", DI }, { "usernonot", SUserInfo.UserNo } });
if (chk2.Count() > 0)
{
RSLT_CD = "U000";
RSLT_MSG = "이미 해당 인증정보로 등록된 회원이 존재합니다.";
}
}
}
else if (user.di == DI)
{
//정보수정시 본인제외 체크를 위해 usernonot추가
IList<Users> chk = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "mobile", TEL_NO }, { "usernonot", SUserInfo.UserNo } });
if (chk.Count() > 0)
{
RSLT_CD = "U000";
RSLT_MSG = "이미 해당 휴대폰번호로 등록된 회원이 존재합니다.";
}
}
else
{
RSLT_CD = "U002";
RSLT_MSG = "인증정보가 등록된 회원 인증정보와 일치하지 않습니다.";
}
} }
else else
{ {
@ -790,10 +855,41 @@ namespace NP.FO.Controllers
RSLT_CD = "U000"; RSLT_CD = "U000";
RSLT_MSG = "이미 해당 ipin으로 등록된 회원이 존재합니다."; RSLT_MSG = "이미 해당 ipin으로 등록된 회원이 존재합니다.";
} }
else
{
IList<Users> chk2 = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "di", DI } });
if (chk2.Count() > 0)
{
RSLT_CD = "U000";
RSLT_MSG = "이미 해당 인증정보로 등록된 회원이 존재합니다.";
}
}
} }
else if (reason == "AuthPlatformChange") else if (reason == "AuthPlatformChange")
{ {
if (SUserInfo.UserNo > 0) var user = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo } }).FirstOrDefault();
if (user != null)
{
if (string.IsNullOrEmpty(user.di))
{
//정보수정시 본인제외 체크를 위해 usernonot추가
IList<Users> chk = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "vssn", VSSN }, { "usernonot", SUserInfo.UserNo } });
if (chk.Count() > 0)
{
RSLT_CD = "U000";
RSLT_MSG = "이미 해당 ipin으로 등록된 회원이 존재합니다.";
}
else
{
IList<Users> chk2 = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "di", DI }, { "usernonot", SUserInfo.UserNo } });
if (chk2.Count() > 0)
{
RSLT_CD = "U000";
RSLT_MSG = "이미 해당 인증정보로 등록된 회원이 존재합니다.";
}
}
}
else if (user.di == DI)
{ {
//정보수정시 본인제외 체크를 위해 usernonot추가 //정보수정시 본인제외 체크를 위해 usernonot추가
IList<Users> chk = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "vssn", VSSN }, { "usernonot", SUserInfo.UserNo } }); IList<Users> chk = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "vssn", VSSN }, { "usernonot", SUserInfo.UserNo } });
@ -804,6 +900,12 @@ namespace NP.FO.Controllers
} }
} }
else else
{
RSLT_CD = "U002";
RSLT_MSG = "인증정보가 등록된 회원 인증정보와 일치하지 않습니다.";
}
}
else
{ {
RSLT_CD = "U999"; RSLT_CD = "U999";
RSLT_MSG = "비로그인"; RSLT_MSG = "비로그인";
@ -811,10 +913,13 @@ namespace NP.FO.Controllers
} }
else if (reason == "LectinningAuth") else if (reason == "LectinningAuth")
{ {
if (SUserInfo.UserNo > 0) var user = Dao.Get<Users>("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(param1, out long lectno))
{ {
if (long.TryParse(param2, out long cmino)) if (long.TryParse(param2, out long cmino))
{ {
@ -852,6 +957,12 @@ namespace NP.FO.Controllers
} }
} }
else else
{
RSLT_CD = "U002";
RSLT_MSG = "인증정보가 등록된 회원 인증정보와 일치하지 않습니다.";
}
}
else
{ {
RSLT_CD = "U999"; RSLT_CD = "U999";
RSLT_MSG = "비로그인"; RSLT_MSG = "비로그인";

View File

@ -80,7 +80,7 @@ namespace NP.FO.Controllers
if (SUserInfo.UserNo > 0 && vm.cmino > 0 && vm.lectno > 0) if (SUserInfo.UserNo > 0 && vm.cmino > 0 && vm.lectno > 0)
{ {
var data = Dao.Get<Data>("lect.lectinning.attcert.check", new Hashtable() { { "lectno", vm.lectno }, { "cmino", vm.cmino }, { "userno", SUserInfo.UserNo } }).FirstOrDefault(); var data = Dao.Get<Data>("lect.lectinning.attcert.check", new Hashtable() { { "lectno", vm.lectno }, { "cmino", vm.cmino }, { "userno", SUserInfo.UserNo } }).FirstOrDefault();
//intval 회차intval2 출석인증제외 회원, intval3 출석인증제외 강좌 //출석 인증 시만 보이게 제한 처리 (intval 회차, intval2 출석인증제외 회원, intval3 출석인증제외 강좌)
if (data != null && (data.intval == 1 || data.intval2 == 1 || data.intval3 == 1)) if (data != null && (data.intval == 1 || data.intval2 == 1 || data.intval3 == 1))
{ {
//이어보기를 위해 페이지관리 //이어보기를 위해 페이지관리