diff --git a/BO/Views/user/ur.cshtml b/BO/Views/user/ur.cshtml
index a9a7d7b..fedecf8 100644
--- a/BO/Views/user/ur.cshtml
+++ b/BO/Views/user/ur.cshtml
@@ -211,7 +211,14 @@
-
저장
+ @if (Model.User.userno > 0 && Model.viewname == "user" && Model.User.status == 8)
+ {
+
휴면해제
+ }
+ else
+ {
+
저장
+ }
@if (Model.User.userno > 0 && Model.viewname == "user")
{
탈퇴
@@ -454,18 +461,18 @@
$("#User_ccpositionetc").show().focus();
}
});
- $("#userpno1, #userpno2").on("keyup", function () {
+ $("#userpno1, #userpno2").on("keyup", function () {
var birthday = makebirthday(val("userpno1") + val("userpno2"));
if (birthday != "") {
setv("User_birthday", birthday);
- }
- });
+ }
+ });
});
function makebirthday(userpno) {
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":
@@ -496,12 +503,18 @@
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);
}
return birthday
}
function save() {
+
+ var txt = "저장하시겠습니까?";
+ if (getrv("User.status") == 8) {
+ txt = "휴면상태로 전환할 경우\n개인정보가 조회되지 않습니다.\n그래도 진행하시겠습니까?";
+ }
+
setv("User_userpno", val("userpno1")+val("userpno2"));
setv("User_mobile", formatmobile(val("User_mobile")));
setv("User_telno", formatphone(val("User_telno")));
@@ -517,10 +530,10 @@
else if (check("User_username", null, "이름을 입력해주세요.")) { }
else if (('@Model.viewname' == 'user') && check("User_email",null,"이메일을 입력해주세요")) { }
//else if (('@Model.viewname' == 'user') && check("User_mobile", null, "핸드폰 번호를 입력해주세요")) { }
- else if (!isnulloremt(val("User_email")) && !isemail(val("User_email"))) { focus("User_email"); msg("이메일주소를 올바르게 입력해주세요."); }
+ else if (!isnulloremt(val("User_email")) && !isemail(val("User_email"))) { focus("User_email"); msg("이메일주소를 올바르게 입력해주세요."); }
//else if (!isnulloremt(val("User_mobile")) && (!ismobile(val("User_mobile")) )) { focus("User_mobile"); msg("핸드폰번호를 올바르게 입력해주세요."); }
//else if ((val("User_usertype") == "1" || val("User_usertype") == "81") && val("User_asno") == "") { msg("소속을 등록해주세요.");}
- else if (confirm("저장하시겠습니까?")) {
+ else if (confirm(txt)) {
if (val("User_usertype") >= "92") {
setv("User_asno", "");
}
@@ -529,6 +542,7 @@
cdata = cdata == "
" ? "" : cdata;
setv("User_introhtml", cdata);
}
+
capfileform("/acommon/usersave", "mform", "cbsave");
}
}
@@ -548,6 +562,7 @@
}
else { msgdev(); }
}
+
function del() {
if (confirm(('@Model.viewname' == "user"?"탈퇴":"삭제")+"처리하시겠습니까?")) {
capp("/acommon/userexitjoin", { userno: @Model.User.userno}, "cbdel");
@@ -647,5 +662,22 @@
msgdev();
}
}
+
+ // 휴면 해제
+ function cancel() {
+ if (confirm("휴면을 해제하시겠습니까?")) {
+ capp("/acommon/dormantcancel", { userno: @Model.User.userno}, "cbcancel");
+ }
+ }
+ function cbcancel() {
+ if (capResult.code == 1000) {
+ msg("휴면이 해제되었습니다.", 0, null, null, true);
+ golist(500, true);
+ } else if (capResult.code == 1) {
+ msg("휴면데이터가 없어 휴면해제가 불가합니다.");
+ } else {
+ msgdev();
+ }
+ }
}
diff --git a/BO/Views/user/us.cshtml b/BO/Views/user/us.cshtml
index 0020bc0..28f5494 100644
--- a/BO/Views/user/us.cshtml
+++ b/BO/Views/user/us.cshtml
@@ -186,9 +186,9 @@ else if (Model.viewname == "admin")
}
else if (confirm("선택한 수강생을 " + str + "하시겠습니까?")) {
if (no == 0) {
- capp("/acommon/usersdormant", { usernos: unos.substr(1) }, "cbusersdormant");
+ capp("/acommon/usersdormant", { usernos: unos.substr(1) }, "cbusersdormant");
} else {
- capp("/acommon/usersdel", { usernos: unos.substr(1) }, "cbusersdel");
+ capp("/acommon/usersdel", { usernos: unos.substr(1) }, "cbusersdel");
}
}
}
diff --git a/Base/Controller/ACommonUser.cs b/Base/Controller/ACommonUser.cs
index ff404e9..c86b753 100644
--- a/Base/Controller/ACommonUser.cs
+++ b/Base/Controller/ACommonUser.cs
@@ -40,6 +40,7 @@ namespace NP.Base.Controllers
public JsonResult UserSave(VMUser vm)
{
vm.User.uno = SUserInfo.UserNo; vm.User.uip = GetUserIP();
+
if (!string.IsNullOrEmpty(vm.User.userpass)) { vm.User.userpass = NP.Base.Lib.KISA_SHA256.SHA256Hash(vm.User.userpass.Trim()); }
vm.User.userid = vm.User.userid.Replace(" ","");
if (!string.IsNullOrEmpty(vm.User.email)) { vm.User.email = vm.User.email.Trim(); }
@@ -60,6 +61,13 @@ namespace NP.Base.Controllers
if (vm.User.userno < 1)
{
Dao.Insert("users.in", vm.User);
+
+ // 상태값 휴면 선택시
+ if (vm.User.usertype == 1 && vm.User.status == 8)
+ {
+ Dao.Save("users.dormant", new Hashtable() { { "usernos", vm.User.userno }, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } });
+ }
+
if (vm.User.usertype > 1)
{
AuthSet(new AuthLog() { uno = SUserInfo.UserNo, uip = GetUserIP(),userno = vm.User.userno, logtype = 2, usertypeorg = vm.User.usertype, usertypenew = vm.User.usertype });
@@ -73,8 +81,17 @@ namespace NP.Base.Controllers
{
AuthSet(new AuthLog() { uno = SUserInfo.UserNo, uip = GetUserIP(), logtype = 1, usertypenew = vm.User.usertype, userno = vm.User.userno });
}
+ var result = Dao.Save("users.up", vm.User);
+
+ // 상태값 휴면 선택시
+ if (vm.User.usertype == 1 && vm.User.status == 8)
+ {
+ Dao.Save("users.dormant", new Hashtable() { { "usernos", vm.User.userno }, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } });
+ }
+
+ return JsonOK(result);
}
- return JsonOK(Dao.Save("users.up", vm.User));
+
}
[HttpPost]
public JsonResult UserExitJoin(int userno)
@@ -83,6 +100,8 @@ namespace NP.Base.Controllers
}
public JsonResult UsersDel(String usernos)
{
+ Dao.Save("users.dormant.delete", new Hashtable() { { "usernos", usernos }});
+
return JsonOK(Dao.Save("users.exitjoin", new Hashtable() { { "usernos", usernos }, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } }));
}
public JsonResult UsersDormant(String usernos)
@@ -90,6 +109,15 @@ namespace NP.Base.Controllers
return JsonOK(Dao.Save("users.dormant", new Hashtable() { { "usernos", usernos }, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } }));
}
[HttpPost]
+ public JsonResult DormantCancel(int userno)
+ {
+ if (Dao.Get
("users.dormants", new Hashtable() { { "userno", userno } }).Count() < 1)
+ {
+ return JsonBack(new JsonRtn() { code = 1 });
+ }
+ return JsonOK(Dao.Save("users.dormant.cancel", new Hashtable() { { "usernos", userno }, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } }));
+ }
+ [HttpPost]
public JsonResult UserEE(int userno)
{
var user = Dao.Get("users.ee", userno).FirstOrDefault();
diff --git a/Dao/MyBatis/Maps/User.xml b/Dao/MyBatis/Maps/User.xml
index fb3434f..9380f6f 100644
--- a/Dao/MyBatis/Maps/User.xml
+++ b/Dao/MyBatis/Maps/User.xml
@@ -262,22 +262,26 @@
and a.usertype in ($usertypes$)
and a.usertype =#usertype#
- and a.userid like concat('%',#userid#,'%')
- a.username like concat('%',#username#,'%')
+ and a.userid=#userid#
+ (a.username = #username#)
(a.username like concat('%',#usernameid#,'%') or a.userid like concat('%',#usernameid#,'%'))
a.status=#status#
a.asno=#asno#
(a.usertype=11 or (a.usertype > 80 and b.ismain=1))
b.asname like concat('%',#asname#,'%')
+
b.brno=#brno#
- CAST(AES_DECRYPT(UNHEX(a.email), ) AS char) like concat('%',#email#,'%')
+
+ a.email=HEX(AES_ENCRYPT(#email#, ))
- CAST(AES_DECRYPT(UNHEX(a.mobile), ) AS char) like concat('%',#mobile#,'%')
+
+ a.mobile=HEX(AES_ENCRYPT(#mobile#, ))
- CAST(AES_DECRYPT(UNHEX(a.userpno), ) AS char) like concat('%',#userpno#,'%')
+
+ a.userpno=HEX(AES_ENCRYPT(#userpno#, ))
a.usertype > #usertypeover#
a.vssn = #vssn#
@@ -379,15 +383,31 @@
update users set
- ,username='탈퇴회원',usernameeng=null,email=null,mobile=null,telno=null,userpno=null,bankno=null,post=null,address1=null,address2=null,birthday=null,di=null,ci=null,vssn=null,authplatform=0,status=99
+ ,username='삭제됨',usernameeng=null,email=null,mobile=null,telno=null,userpno=null,bankno=null,post=null,address1=null,address2=null,birthday=null,di=null,ci=null,vssn=null,authplatform=0,status=99
where
userno=#userno#
userno in ($usernos$)
-
+
+
+ insert into userdormant(userno,username,usernameeng,email,isacceptemail,mobile
+ ,telno,userpno,bankno,post,address1,address2,birthday,cdt)
+ select a.userno,a.username,a.usernameeng,a.email,a.isacceptemail,a.mobile
+ ,a.telno,a.userpno,a.bankno,a.post,a.address1,a.address2, a.birthday, cdt
+ from users a
+ left outer join userdormant b on b.userno = a.userno
+ where a.userno in ($usernos$)
+ and b.userno is null;
+
+ update users set
+ ,username='삭제됨',usernameeng=null,email=null,mobile=null,telno=null,userpno=null,bankno=null,post=null,address1=null,address2=null,birthday=null,status=8
+ where userno in ($usernos$);
+
+
+
+
+
+
+ update users a
+ left outer join userdormant b on b.userno = a.userno
+ set a.username = b.username
+ ,a.usernameeng = b.usernameeng
+ ,a.email = b.email
+ ,a.isacceptemail = b.isacceptemail
+ ,a.mobile = b.mobile
+ ,a.telno = b.telno
+ ,a.userpno = b.userpno
+ ,a.bankno = b.bankno
+ ,a.post = b.post
+ ,a.address1 = b.address1
+ ,a.address2 = b.address2
+ ,a.birthday = b.birthday
+ ,a.status =1
+ where a.userno in ($usernos$);
+
+ delete from userdormant where userno in ($usernos$);
+
+
+
+ delete from userdormant where userno in ($usernos$);
+
+
+
+ update users a
+ left outer join userdormant b on b.userno = a.userno
+ set status = 99
+ where date_add(b.cdt,interval 1 year) < now();
+
+ delete from userdormant where date_add(cdt,interval 1 year) < now();
+
+
+
+
+