public GepLoginData TaAdminUserLoginProc(string id, string password, string taId) { GepLoginData resultdata = new GepLoginData(); //TA 유무확인 if (new LoginDac().Read(taId) != null) { // 아이디 패스워드 확인 resultdata = IdPwdCheckCorrect(id, password); if (resultdata.result == "S") { // 패스워드 찾기 string getPassword = new LoginDac().FindPassword(taId); if (getPassword != "") { resultdata.message = AdminTaUserLoginUrlMake(id, password, taId, getPassword); resultdata.result = "S"; } else { resultdata.result = "F"; resultdata.message = "TA 비밀번호 찾기 실패."; } } } else { resultdata.message = "존재하지 않는 TA 입니다."; resultdata.result = "F"; } return resultdata; }
public GepLoginData LogOut() { GepLoginData resultData = new GepLoginData(); try { HttpContext httpContext = HttpContext.Current; string[] cookieKeys = httpContext.Request.Cookies.AllKeys; foreach (var data in cookieKeys) { HttpCookie Cookie = new HttpCookie(data); Cookie.Domain = "gmarket.co.kr"; Cookie.Expires = DateTime.Now.AddDays(-1d); httpContext.Response.Cookies.Add(Cookie); } HttpCookie CookieAdmin = new HttpCookie("gepAdmin"); if (CookieAdmin != null) { CookieAdmin.Expires = DateTime.Now.AddDays(-1d); httpContext.Response.Cookies.Add(CookieAdmin); } resultData.result = "S"; } catch (Exception ex) { resultData.result = "F"; resultData.message = "로그아웃 실패"; } return resultData; }
private GepLoginData IdPwdCheckCorrect(string id, string pwd) { bool validation = true; GepLoginData resultClass = new GepLoginData(); string custPasswordCode = string.Empty; string custNo = string.Empty; //1. 아이디 Validation if (string.IsNullOrEmpty(id) == true) { resultClass.result = "F"; resultClass.message = "아이디가 입력되지 않았습니다."; validation = false; } if (id.Length > 10) { resultClass.result = "F"; resultClass.message = "아이디 길이를 초과하였습니다."; validation = false; } //2. 비밀번호 Validation if (string.IsNullOrEmpty(pwd) == true) { resultClass.result = "F"; resultClass.message = "비밀번호가 입력되지 않았습니다."; validation = false; } if (pwd.Length > 15) { if (pwd.Length > 16 && pwd.Length != 30) { resultClass.result = "F"; resultClass.message = "비밀번호가 잘못 입력되었습니다."; validation = false; } } if (validation) { custNo = new LoginDac().Authenticate(id, pwd, this.MakeStringCustPassCode(pwd)); if (custNo == "notexists" || custNo == "mismatch") { resultClass.result = "F"; resultClass.message = "아이디 암호가 맞지 않습니다."; } else { resultClass.result = "S"; resultClass.message = ""; } } return resultClass; }
public GepLoginData TaUserLoginProc(string id, string password) { GepLoginData resultdata = new GepLoginData(); //TA 유무확인 if (new LoginDac().Read(id) != null) { // 아이디 패스워드 확인 resultdata = IdPwdCheckCorrect(id, password); if (resultdata.result == "S") { resultdata.result = "S"; resultdata.message = TaUserLoginUrlMake(id, password); } } else { resultdata.message = "존재하지 않는 TA 입니다."; resultdata.result = "F"; } return resultdata; }