diff --git a/BO/Controllers/userController.cs b/BO/Controllers/userController.cs index 8e167dd..2020351 100644 --- a/BO/Controllers/userController.cs +++ b/BO/Controllers/userController.cs @@ -302,5 +302,40 @@ namespace NP.BO.Controllers vm.User = Dao.Get("users.users", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo }, { "includesysadmin", 1 } }).First(); return View(vm); } + + /// + /// 개인정보 수정(우측 상단 드랍박스 내) + /// + /// + /// + public ActionResult editinfo(VMUser vm) + { + ViewBag.isadmin = SUserInfo.IsAdmin; + ViewBag.issiteadmin = SUserInfo.IsSiteAdmin; + ViewBag.isprofessor = SUserInfo.IsTeacher; + vm.FileList = new List() { }; + vm.User = Dao.Get("users.users", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo }, { "includesysadmin", 1 } }).First(); + if (SUserInfo.IsTeacher) + { + vm.ComCodes = GetComCodes("jobposition,job", true); + for (int i = vm.ComCodes.Count() - 1; i > -1; i--) + { + if (vm.ComCodes[i].isuse == 0 && (vm.ComCodes[i].cgroup != "jobposition" || (vm.ComCodes[i].cgroup == "jobposition" && vm.ComCodes[i].refcode != "9"))) + { + vm.ComCodes.RemoveAt(i); + } + } + } + else + { + vm.ComCodes = GetComCodes("jobposition,job"); + } + if ((vm.User.fgnoprofile ?? 0) > 0) + { + vm.FileList = GetFiles(vm.User.fgnoprofile.Value); + } + + return View(vm); + } } } diff --git a/BO/Views/Shared/_Layout.cshtml b/BO/Views/Shared/_Layout.cshtml index 4ab73c5..e6da317 100644 --- a/BO/Views/Shared/_Layout.cshtml +++ b/BO/Views/Shared/_Layout.cshtml @@ -96,6 +96,7 @@ {
  • 매뉴얼 다운로드
  • } +
  • 개인정보수정
  • 로그아웃
  • diff --git a/Base/Controller/ACommonUser.cs b/Base/Controller/ACommonUser.cs index c86b753..42e2596 100644 --- a/Base/Controller/ACommonUser.cs +++ b/Base/Controller/ACommonUser.cs @@ -295,6 +295,50 @@ namespace NP.Base.Controllers } return JsonOK(0); } + + /// + /// 개인정보수정 + /// + /// + /// + [HttpPost] + [ValidateInput(false)] + public JsonResult UserEdit(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); } + vm.User.userid = vm.User.userid.Trim(); + if (!string.IsNullOrEmpty(vm.User.email)) { vm.User.email = vm.User.email.Trim(); } + vm.User.mobile = vm.User.MobileFormat; + + var check = Dao.Get("users.checkuser", new Hashtable() { { "usernonot", vm.User.userno > 0 ? vm.User.userno : (int?)null }, { "userid", vm.User.userno > 0 ? null : vm.User.userid }, { "email", vm.User.email }, { "mobile", string.IsNullOrEmpty(vm.User.mobile) ? null : vm.User.mobile } }).First(); + + if (check < 9) + { + if (vm.User.usertype == 1 || check != 3) + { + return JsonOK(check * -1); + } + } + if (Request.Files.GetMultiple("file").Where(w => !string.IsNullOrEmpty(w.FileName)).Count() > 0) + { + vm.User.fgnoprofile = SetFile(Request.Files.GetMultiple("file").Where(w => !string.IsNullOrEmpty(w.FileName)).ToList(), vm.User.fgnoprofile ?? 0, "users", "fgnoprofile"); + } + if (vm.User.usertype > 90) + { + vm.User.asno = 1; + } + LogSet(new ActLog() { logtype = 30, logtarget = 21, logdata = vm.User.username + "(" + vm.User.userid + ")", userno = vm.User.userno, uno = SUserInfo.UserNo, uip = GetUserIP() }); + if (vm.User.usertype > 1) + { + AuthSet(new AuthLog() { uno = SUserInfo.UserNo, uip = GetUserIP(), logtype = 1, usertypenew = vm.User.usertype, userno = vm.User.userno }); + } + + return JsonOK(Dao.Save("users.edit", vm.User)); + + } + + } } \ No newline at end of file diff --git a/Dao/MyBatis/Maps/User.xml b/Dao/MyBatis/Maps/User.xml index 9380f6f..a0b69b5 100644 --- a/Dao/MyBatis/Maps/User.xml +++ b/Dao/MyBatis/Maps/User.xml @@ -852,7 +852,30 @@ from users a where a.usertype =1 and a.status=1 and date_format(date_add(a.logintime, interval 366 day),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d') - + + + + + update users set + ,usertype=#usertype# + ,userpass =#userpass# + ,username =case when #username# is not null then #username# else username end + ,email =HEX(AES_ENCRYPT(#email#, )) + ,mobile =HEX(AES_ENCRYPT(#mobile#, )) + ,asno =case when #asno# is not null then #asno# else asno end + ,depart =#depart# + ,ccposition =case when #ccposition# is not null then #ccposition# else ccposition end + ,ccpositionetc =case when #ccpositionetc# is not null then #ccpositionetc# else ccpositionetc end + ,fgnoprofile =#fgnoprofile# + ,userpno =case when #userpno# is not null then HEX(AES_ENCRYPT(#userpno#, )) else userpno end + ,bankname =case when #bankname# is not null then #bankname# else bankname end + ,bankno =case when #bankno# is not null then HEX(AES_ENCRYPT(#bankno#, )) else bankno end + ,post =case when #post# is not null then #post# else post end + ,address1 =case when #address1# is not null then #address1# else address1 end + ,address2 =case when #address2# is not null then #address2# else address2 end + ,introhtml =case when #introhtml# is not null then #introhtml# else introhtml end + where userno=#userno# + diff --git a/Model/Common.cs b/Model/Common.cs index 9961d9c..1d746ea 100644 --- a/Model/Common.cs +++ b/Model/Common.cs @@ -113,7 +113,7 @@ namespace NP.Model { get { - return usertype == 1 ? "교육생" : usertype == 11 ? "교강사" : usertype == 81 ? "고객사관리자" : usertype == 91 ? "통합관리자" : usertype == 92 ? "일반관리자" : "-"; + return usertype == 1 ? "교육생" : usertype == 11 ? "교강사" : usertype == 81 ? "고객사관리자" : usertype == 91 ? "통합관리자" : usertype == 92 ? "일반관리자" : usertype == 95 ? "일반관리자" : "-"; } } public String msgid { get; set; } diff --git a/Model/Users.cs b/Model/Users.cs index 821362e..f1f1a00 100644 --- a/Model/Users.cs +++ b/Model/Users.cs @@ -29,7 +29,7 @@ namespace NP.Model { get { - return usertype == 1 ? "교육생" : usertype == 11 ? "교강사" : usertype == 81 ? "고객사관리자" : usertype == 91 ? "통합관리자" : usertype == 92 ? "일반관리자" : "-"; + return usertype == 1 ? "교육생" : usertype == 11 ? "교강사" : usertype == 81 ? "고객사관리자" : usertype == 91 ? "통합관리자" : usertype == 92 ? "일반관리자" : usertype == 95 ? "일반관리자" : "-"; } } ///