<추가사항>
1. 개인정보수정 팝업 (p8) - 비밀번호 변경 90일 경과일 때 개인정보 변경 안내 - 신규 페이지 권한 추가 /Account/Pwchange 2. 휴면해제 안내 (p9) - 1년간 로그인 이력 없을시 휴면해제 안내 - 신규 페이지 권한 추가 /Account/DormantCancel 3. ID/PW 찾기 휴면 테이블에서도 검색 (p10) - user 테이블 검색 없을 시 휴면테이블 까지 검색 # 커밋 파일 Base\Controller\FOCommon.cs Dao\MyBatis\Maps\User.xml FO\Controllers\AccountController.cs FO\Views\Account\DormantCancel.cshtml FO\Views\Account\IndexBase.cshtml FO\Views\Account\PwChange.cshtml FO.csproj # 테스트 결과 - 이상없음 # 특이사항 및 이슈사항 - 이상없음
This commit is contained in:
parent
3fd1a0816a
commit
dea76b7f2e
|
|
@ -121,12 +121,75 @@ namespace NP.Base.Controllers
|
|||
{
|
||||
return JsonBack(new JsonRtn() { code = 1000, obj = -1, msg = u.subdomain });
|
||||
}
|
||||
//비밀번호 변경 90일 경과
|
||||
if (u.udt.AddDays(90) < DateTime.Now)
|
||||
{
|
||||
return JsonBack(new JsonRtn() { code = 1000, msg = "-2", obj = u.userno });
|
||||
}
|
||||
// 휴면상태
|
||||
if (u.status == 8)
|
||||
{
|
||||
return JsonBack(new JsonRtn() { code = 1000, msg = "-3", obj = u.userno });
|
||||
}
|
||||
return JsonOK(u.userno);
|
||||
}
|
||||
}
|
||||
return JsonOK(0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 비밀번호 변경 저장 (비밀번호 변경 90일 지난 사용자)
|
||||
/// </summary>
|
||||
/// <param name="vm"></param>
|
||||
/// <returns></returns>
|
||||
public JsonResult PwChange(VMUser vm)
|
||||
{
|
||||
if (string.IsNullOrEmpty(vm.User.userpass) || vm.User.userpass.Trim() == "")
|
||||
{
|
||||
Dao.Save("users.resetuserpass", new Hashtable() { { "userno", vm.userno } });
|
||||
return JsonOK(1);
|
||||
}
|
||||
if (vm.userno > 0 && !string.IsNullOrEmpty(vm.User.userpass) && vm.User.userpass.Trim() != "")
|
||||
{
|
||||
if (Dao.Save("users.resetuserpass", new Hashtable() { { "userpass", NP.Base.Lib.KISA_SHA256.SHA256Hash(vm.User.userpass) }, { "userno", vm.userno } }) == 1)
|
||||
{
|
||||
var u = GoLogin(vm.User.userid, vm.User.userpass);
|
||||
if (u != null)
|
||||
{
|
||||
return JsonOK(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return JsonOK(0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 휴면해제
|
||||
/// </summary>
|
||||
/// <param name="userno"></param>
|
||||
/// <returns></returns>
|
||||
public JsonResult DormantCancel(int userno)
|
||||
{
|
||||
if (Dao.Get<Users>("users.dormants", new Hashtable() { { "userno", userno } }).Count() < 1)
|
||||
{
|
||||
return JsonBack(new JsonRtn() { code = 1 });
|
||||
}
|
||||
var result = Dao.Save("users.dormant.cancel", new Hashtable() { { "usernos", userno }, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } });
|
||||
var user = Dao.Get<Users>("users.findmes", new Hashtable() { { "userno", userno } }).FirstOrDefault();
|
||||
if (user != null)
|
||||
{
|
||||
var u = GoLogin(user.userid, "rhksflwkfhrmdls999");
|
||||
if (u != null)
|
||||
{
|
||||
return JsonOK(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
return JsonBack(new JsonRtn() { code = 2 });
|
||||
}
|
||||
}
|
||||
return JsonOK(0);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public JsonResult GetBoards(int btype, int pn, int prc, String sc)
|
||||
|
|
@ -179,11 +242,20 @@ namespace NP.Base.Controllers
|
|||
if (string.IsNullOrEmpty(email)) { return JsonOK(-1); }
|
||||
email = email.Replace(" ", "").Replace(" ", "");
|
||||
List<Users> users = new List<Users>() { };
|
||||
|
||||
bool IsEmail = false;
|
||||
if (email.Contains("@"))
|
||||
{
|
||||
IsEmail = true;
|
||||
users = Dao.Get<Users>("users.findme", new Hashtable() { { "email", email } }).ToList();
|
||||
|
||||
if(users.Count() < 1)
|
||||
{
|
||||
// user 테이블 검색 뒤 없을 경우 휴면테이블에서 검색
|
||||
users = Dao.Get<Users>("users.findmes", new Hashtable() { { "email", email } }).ToList();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
//else
|
||||
//{
|
||||
|
|
|
|||
|
|
@ -607,14 +607,14 @@
|
|||
where status<>99 <isNotNull property="usernos"> and userno in ($usernos$)</isNotNull>
|
||||
</update>-->
|
||||
<select id="users.userlogin" parameterClass="hashtable" resultClass="users">
|
||||
select a.userid,a.userno,a.username,a.status,usertype,a.asno
|
||||
select a.userid,a.userno,a.username,a.status,usertype,a.asno,a.udt
|
||||
,b.subdomain
|
||||
from users a
|
||||
left outer join assign b on b.asno=a.asno and b.issite=1 and b.isdel=0
|
||||
<!--<isNotNull property="subdomain">
|
||||
inner join assign b on b.asno=a.asno and b.subdomain=#subdomain#
|
||||
</isNotNull>-->
|
||||
where (userpass=#userpass# or #userpass# is null) and a.usertype=1 and a.status=1
|
||||
where (userpass=#userpass# or #userpass# is null) and a.usertype=1 and a.status<9
|
||||
<isNotNull property="userid">
|
||||
and a.userid=#userid#
|
||||
</isNotNull>
|
||||
|
|
@ -639,6 +639,30 @@
|
|||
and a.mobile=HEX(AES_ENCRYPT(#mobile#, <include refid="sql.digest"></include>))
|
||||
</isNotNull>
|
||||
</select>
|
||||
|
||||
<select id="users.findmes" parameterClass="hashtable" resultClass="users">
|
||||
select a.userno,a.username
|
||||
,a.userid
|
||||
,a.pwcallno
|
||||
,CAST(AES_DECRYPT(UNHEX(b.mobile), <include refid="sql.digest"></include>) AS char) mobile
|
||||
,CAST(AES_DECRYPT(UNHEX(b.email), <include refid="sql.digest"></include>) AS char) email
|
||||
from users a
|
||||
left outer join userdormant b on b.userno = a.userno
|
||||
where a.usertype in (1,11) and a.status < 9
|
||||
<isNotNull property="userno">
|
||||
and a.userno = #userno#
|
||||
</isNotNull>
|
||||
<isNotNull property="usertype">
|
||||
and a.usertype = #usertype#
|
||||
</isNotNull>
|
||||
<isNotNull property="email">
|
||||
and ( a.email=HEX(AES_ENCRYPT(#email#, <include refid="sql.digest"></include>)) or b.email=HEX(AES_ENCRYPT(#email#, <include refid="sql.digest"></include>)) )
|
||||
</isNotNull>
|
||||
<isNotNull property="mobile">
|
||||
and ( a.mobile=HEX(AES_ENCRYPT(#mobile#, <include refid="sql.digest"></include>)) or b.mobile=HEX(AES_ENCRYPT(#mobile#, <include refid="sql.digest"></include>)) )
|
||||
</isNotNull>
|
||||
</select>
|
||||
|
||||
<update id="users.pwcalltime" parameterClass="long">
|
||||
update users set pwcalltime=<include refid="sql.now"></include>,pwcallno=#pwcallno#<!--floor(RAND() * (30000-1)+1)--> where userno=#userno#
|
||||
</update>
|
||||
|
|
@ -649,7 +673,11 @@
|
|||
,usertype
|
||||
,pwcallno
|
||||
from users
|
||||
where userno=#userno# and pwcallno=#pwcallno# and pwcalltime is not null and date_add(pwcalltime, interval 24 hour) > <include refid="sql.now"></include>
|
||||
where userno=#userno#
|
||||
<isNotNull property="pwcallno">
|
||||
and pwcallno=#pwcallno# and pwcalltime is not null and date_add(pwcalltime, interval 24 hour) > <include refid="sql.now"></include>
|
||||
</isNotNull>
|
||||
|
||||
</select>
|
||||
<update id="users.resetuser" parameterClass="hashtable">
|
||||
update users set userpass=#userpass#, pwcalltime=null,pwcallno=null where userno=#userno# and pwcalltime is not null and pwcallno=#pwcallno# and date_add(pwcalltime, interval 24 hour) > <include refid="sql.now"></include>
|
||||
|
|
|
|||
|
|
@ -19,6 +19,11 @@ namespace NP.FO.Controllers
|
|||
{
|
||||
public class AccountController : FOOpenBaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// ID/PW 찾기
|
||||
/// </summary>
|
||||
/// <param name="vm"></param>
|
||||
/// <returns></returns>
|
||||
public ActionResult FindMe(VMUser vm)
|
||||
{
|
||||
vm.User = new Users() { };
|
||||
|
|
@ -992,6 +997,56 @@ namespace NP.FO.Controllers
|
|||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 개인정보 변경안내(비밀번호 변경 90일 경과)
|
||||
/// </summary>
|
||||
/// <param name="vm"></param>
|
||||
/// <returns></returns>
|
||||
public ActionResult PwChange(VMUser vm)
|
||||
{
|
||||
vm.User = new Users() { };
|
||||
if (SUserInfo.UserNo > 0)
|
||||
{
|
||||
vm.User = Dao.Get<Users>("users.pwuser", new Hashtable() { { "userno", SUserInfo.UserNo } }).FirstOrDefault();
|
||||
if (vm.User == null)
|
||||
{
|
||||
vm.User = new Users() { };
|
||||
vm.userno = -1;
|
||||
}
|
||||
vm.userno = vm.User.userno;
|
||||
}
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 휴면해제 안내
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public ActionResult DormantCancel()
|
||||
{
|
||||
ViewBag.UserNo = SUserInfo.UserNo;
|
||||
// 에듀윌 소스 (사용여부 ??)
|
||||
if (Request.Cookies.Get("RTNURL") != null)
|
||||
{
|
||||
var cookie = Request.Cookies.Get("RTNURL");
|
||||
ViewBag.RTNURL = cookie.Value;
|
||||
//원래 마케팅용이어서 expire는 제외
|
||||
//cookie.Expires = DateTime.Now.AddDays(-1);
|
||||
//Response.Cookies.Add(cookie);
|
||||
}
|
||||
|
||||
if (ViewBag.UserNo > 0)
|
||||
{
|
||||
//인증링크 클릭 확인
|
||||
Users User = Dao.Get<Users>("users.dormants", new Hashtable() { { "userno", SUserInfo.UserNo } }).FirstOrDefault();
|
||||
if (User == null)
|
||||
{
|
||||
ViewBag.UserNo = -1;
|
||||
}
|
||||
}
|
||||
return View();
|
||||
}
|
||||
|
||||
public ActionResult NaverCallback()
|
||||
{
|
||||
ViewBag.naverClientID = naverClientID;
|
||||
|
|
|
|||
|
|
@ -100,7 +100,22 @@
|
|||
if (capResult.code == 1000) {
|
||||
if (capResult.obj == -1) {
|
||||
msg("고객사 사용자는 고객사사이트를 이용해주세요.", null, null, null, "location.href='https://" + capResult.msg + ".cte.or.kr/Account/Index'");
|
||||
} else {
|
||||
}
|
||||
else if (capResult.msg == "-2") { // 비밀번호 변경 90일 경과
|
||||
$("#mform").attr("action", "/Account/Pwchange");
|
||||
if ('@(Model.ru??"")' != "") {
|
||||
$("#mform").attr("action", "@Model.ru".replace(/-/gi, '&'));
|
||||
}
|
||||
submit();
|
||||
}
|
||||
else if (capResult.msg == "-3") { // 휴면해제안내
|
||||
$("#mform").attr("action", "/Account/DormantCancel");
|
||||
if ('@(Model.ru??"")' != "") {
|
||||
$("#mform").attr("action", "@Model.ru".replace(/-/gi, '&'));
|
||||
}
|
||||
submit();
|
||||
}
|
||||
else {
|
||||
$("#mform").attr("action", "/");
|
||||
if ('@(Model.ru??"")' != "") {
|
||||
$("#mform").attr("action", "@Model.ru".replace(/-/gi, '&'));
|
||||
|
|
|
|||
Loading…
Reference in New Issue