인증 DI 중복체크 로직 추가
This commit is contained in:
parent
d2048fbbe1
commit
1845e4274c
|
|
@ -102,35 +102,43 @@ namespace NP.Base.Controllers
|
|||
[HttpPost]
|
||||
public JsonResult UserSave(Users u)
|
||||
{
|
||||
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());
|
||||
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)) :
|
||||
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 == 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();
|
||||
if (check < 9)
|
||||
var user = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo } }).FirstOrDefault();
|
||||
if (user != null)
|
||||
{
|
||||
return JsonOK(check * -1);
|
||||
}
|
||||
LogSet(new ActLog() { logtype = 30, logtarget = 21, logdata = u.username, userno = u.userno, uno = SUserInfo.UserNo, uip = GetUserIP() });
|
||||
u.savefrontbuy = 1;
|
||||
var result = Dao.Save("users.up", u);
|
||||
if (result > 0)
|
||||
{
|
||||
var asno = u.asno ?? 0;
|
||||
if (SUserInfo.ASNo != asno)
|
||||
if (string.IsNullOrEmpty(user.di) || user.di == u.di)
|
||||
{
|
||||
SUserInfo.ASNo = asno;
|
||||
AuthCookie(true);
|
||||
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());
|
||||
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)) :
|
||||
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 == 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();
|
||||
if (check < 9)
|
||||
{
|
||||
return JsonOK(check * -1);
|
||||
}
|
||||
LogSet(new ActLog() { logtype = 30, logtarget = 21, logdata = u.username, userno = u.userno, uno = SUserInfo.UserNo, uip = GetUserIP() });
|
||||
u.savefrontbuy = 1;
|
||||
var result = Dao.Save("users.up", u);
|
||||
if (result > 0)
|
||||
{
|
||||
var asno = u.asno ?? 0;
|
||||
if (SUserInfo.ASNo != asno)
|
||||
{
|
||||
SUserInfo.ASNo = asno;
|
||||
AuthCookie(true);
|
||||
}
|
||||
}
|
||||
return JsonOK(result);
|
||||
}
|
||||
}
|
||||
return JsonOK(result);
|
||||
return JsonOK(0);
|
||||
}
|
||||
[HttpPost]
|
||||
public JsonResult UserExit(String exitreason)
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@
|
|||
,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
|
||||
,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
|
||||
,count(a.cdt) over() pagetotalcount
|
||||
from users a
|
||||
|
|
@ -252,7 +252,7 @@
|
|||
<isNull property="includesysadmin">and a.usertype <> 91</isNull>
|
||||
<isNotNull property="userno">and a.userno =#userno#</isNotNull>
|
||||
<isNotNull property="usernonot">
|
||||
<isGreaterThan property="usernonot" compareValue="0">and a.userno <> #userno#</isGreaterThan>
|
||||
<isGreaterThan property="usernonot" compareValue="0">and a.userno <> #usernonot#</isGreaterThan>
|
||||
</isNotNull>
|
||||
<isNotEmpty property="usertypes">and a.usertype in ($usertypes$)</isNotEmpty>
|
||||
<isNotNull property="usertype">and a.usertype =#usertype#</isNotNull>
|
||||
|
|
@ -272,6 +272,7 @@
|
|||
</isNotEmpty>
|
||||
<isNotNull property="usertypeover" prepend="and">a.usertype > #usertypeover#</isNotNull>
|
||||
<isNotNull property="vssn" prepend="and">a.vssn = #vssn#</isNotNull>
|
||||
<isNotNull property="di" prepend="and">a.di = #di#</isNotNull>
|
||||
) a
|
||||
<include refid="sql.pagedynamic"></include>
|
||||
order by a.rno
|
||||
|
|
|
|||
|
|
@ -509,7 +509,7 @@ namespace NP.FO.Controllers
|
|||
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" || sel == "MCHK")
|
||||
if (sel == "MOBI")
|
||||
{
|
||||
license = "C:\\Windows\\SysWOW64\\" + CP_CD + "_IDS_01_" + target + "_AES_license.dat";
|
||||
svcName = "IDS_HS_POPUP_START";
|
||||
|
|
@ -653,17 +653,54 @@ namespace NP.FO.Controllers
|
|||
RSLT_CD = "U000";
|
||||
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")
|
||||
{
|
||||
if (SUserInfo.UserNo > 0)
|
||||
var user = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo } }).FirstOrDefault();
|
||||
if (user != null)
|
||||
{
|
||||
//정보수정시 본인제외 체크를 위해 usernonot추가
|
||||
IList<Users> chk = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "mobile", TEL_NO }, { "usernonot", SUserInfo.UserNo } });
|
||||
if (chk.Count() > 0)
|
||||
if (string.IsNullOrEmpty(user.di))
|
||||
{
|
||||
RSLT_CD = "U000";
|
||||
RSLT_MSG = "이미 해당 휴대폰번호로 등록된 회원이 존재합니다.";
|
||||
//정보수정시 본인제외 체크를 위해 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추가
|
||||
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
|
||||
|
|
@ -674,14 +711,42 @@ namespace NP.FO.Controllers
|
|||
}
|
||||
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)
|
||||
{
|
||||
//정보수정시 본인제외 체크를 위해 usernonot추가
|
||||
IList<Users> chk = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "mobile", TEL_NO }, { "usernonot", SUserInfo.UserNo } });
|
||||
if (chk.Count() > 0)
|
||||
if (string.IsNullOrEmpty(user.di))
|
||||
{
|
||||
RSLT_CD = "U000";
|
||||
RSLT_MSG = "이미 해당 휴대폰번호로 등록된 회원이 존재합니다.";
|
||||
//정보수정시 본인제외 체크를 위해 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추가
|
||||
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
|
||||
|
|
@ -790,17 +855,54 @@ namespace NP.FO.Controllers
|
|||
RSLT_CD = "U000";
|
||||
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")
|
||||
{
|
||||
if (SUserInfo.UserNo > 0)
|
||||
var user = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo } }).FirstOrDefault();
|
||||
if (user != null)
|
||||
{
|
||||
//정보수정시 본인제외 체크를 위해 usernonot추가
|
||||
IList<Users> chk = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "vssn", VSSN }, { "usernonot", SUserInfo.UserNo } });
|
||||
if (chk.Count() > 0)
|
||||
if (string.IsNullOrEmpty(user.di))
|
||||
{
|
||||
RSLT_CD = "U000";
|
||||
RSLT_MSG = "이미 해당 ipin으로 등록된 회원이 존재합니다.";
|
||||
//정보수정시 본인제외 체크를 위해 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추가
|
||||
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
|
||||
{
|
||||
RSLT_CD = "U002";
|
||||
RSLT_MSG = "인증정보가 등록된 회원 인증정보와 일치하지 않습니다.";
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -811,17 +913,20 @@ namespace NP.FO.Controllers
|
|||
}
|
||||
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(long.TryParse(param1, out long lectno))
|
||||
if (string.IsNullOrEmpty(user.di) || user.di == DI)
|
||||
{
|
||||
if (long.TryParse(param2, out long cmino))
|
||||
|
||||
if (long.TryParse(param1, out long lectno))
|
||||
{
|
||||
var lectInnings = Dao.Get<LectInning>("cr.cminnings", new System.Collections.Hashtable() { { "lectno", lectno }, { "userno", SUserInfo.UserNo } });
|
||||
if (lectInnings.Where(w => w.cmino == cmino).Count() > 0)
|
||||
if (long.TryParse(param2, out long cmino))
|
||||
{
|
||||
var Hashtable = new System.Collections.Hashtable() {
|
||||
var lectInnings = Dao.Get<LectInning>("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 },
|
||||
|
|
@ -829,9 +934,15 @@ namespace NP.FO.Controllers
|
|||
{ "uno", SUserInfo.UserNo },
|
||||
{ "uip", GetUserIP() }
|
||||
};
|
||||
Dao.Save("lect.lectinning.isatt.in", Hashtable);
|
||||
ViewBag.lectno = lectno;
|
||||
ViewBag.cmino = cmino;
|
||||
Dao.Save("lect.lectinning.isatt.in", Hashtable);
|
||||
ViewBag.lectno = lectno;
|
||||
ViewBag.cmino = cmino;
|
||||
}
|
||||
else
|
||||
{
|
||||
RSLT_CD = "U998";
|
||||
RSLT_MSG = "cmino 에러";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -842,13 +953,13 @@ namespace NP.FO.Controllers
|
|||
else
|
||||
{
|
||||
RSLT_CD = "U998";
|
||||
RSLT_MSG = "cmino 에러";
|
||||
RSLT_MSG = "lectno 에러";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
RSLT_CD = "U998";
|
||||
RSLT_MSG = "lectno 에러";
|
||||
RSLT_CD = "U002";
|
||||
RSLT_MSG = "인증정보가 등록된 회원 인증정보와 일치하지 않습니다.";
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ namespace NP.FO.Controllers
|
|||
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();
|
||||
//intval 회차intval2 출석인증제외 회원, intval3 출석인증제외 강좌
|
||||
//출석 인증 시만 보이게 제한 처리 (intval 회차, intval2 출석인증제외 회원, intval3 출석인증제외 강좌)
|
||||
if (data != null && (data.intval == 1 || data.intval2 == 1 || data.intval3 == 1))
|
||||
{
|
||||
//이어보기를 위해 페이지관리
|
||||
|
|
|
|||
Loading…
Reference in New Issue