예제 #1
0
        public JsonResult IsOldPwdValid(string chkPassword)
        {
            FormsAuthenticationTicket ticket = null;

            try
            {
                bool isValid = false;
                _UserDetailsBusinessLogic = new UserDetailsBusinessLogic();

                HttpCookie authCookie = System.Web.HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName];
                ticket = FormsAuthentication.Decrypt(authCookie.Value);

                int userId = redirectedUserId == 0?_UserDetailsBusinessLogic.GetUserID(ticket.Name): redirectedUserId;

                isValid = _UserDetailsBusinessLogic.IsOldPwdValid(chkPassword, userId);

                return(Json(isValid));
            }
            catch (Exception ex)
            {
                currentFile = this.ControllerContext.RouteData.Values["controller"].ToString();  // System.Diagnostics.StackTrace(true).GetFrame(0).GetFileName();
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                methodName = sf.GetMethod().Name;
                ErrorLogHelper.UpdatingErrorLog(currentFile + "-" + methodName, ticket == null ? "N/A" : ticket.Name, ex);
                return(Json(false));
            }
        }