Example #1
0
        public ActionResult SetPermPassword(vmAccountChangePassword model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    T_OE_USERS u = db_Accounts.GetT_OE_USERSByIDX(db_Accounts.GetUserIDX());
                    if (u != null)
                    {
                        if (Membership.ValidateUser(u.USER_ID, model.OldPassword) == true)
                        {
                            if (Membership.Provider.ChangePassword(u.USER_ID, model.OldPassword, model.Password))
                            {
                                FormsAuthentication.SetAuthCookie(u.USER_ID, true);
                                return(RedirectToAction("Index", "Dashboard"));
                            }
                        }
                    }
                }
                catch { }
            }

            //if got this far, failed
            TempData["Error"] = "Change password failed.";
            return(View(model));
        }
Example #2
0
        public ActionResult SetPermPassword()
        {
            var model = new vmAccountChangePassword();

            return(View(model));
        }