Esempio n. 1
0
        public IActionResult GetPassWord_Final()
        {
            if (!GetPwdStep.Equals("final"))
            {
                return(WriteErr("你无权访问该页面"));
            }
            string     newpwd  = RequestEx["TxtPassword"];
            string     cnewpwd = RequestEx["TxtConfirmPassword"];
            int        Uid     = DataConverter.CLng(RequestEx["uid"]);
            M_UserInfo mu      = buser.GetUserByName(GetPwdUName);

            if (Uid > 0)
            {
                mu = buser.SelReturnModel(Uid);
            }
            if (mu.IsNull)
            {
                return(WriteErr("[" + GetPwdUName + "]用户不存在"));
            }
            if (!newpwd.Equals(cnewpwd))
            {
                return(WriteErr("两次输入密码不一致"));
            }
            mu.UserPwd = StringHelper.MD5(cnewpwd);
            mu.seturl  = "";
            buser.UpDateUser(mu);
            return(WriteOK("密码修改成功!", "/User/"));
        }
Esempio n. 2
0
        public void GetPassWord_Final()
        {
            if (!GetPwdStep.Equals("final"))
            {
                function.WriteErrMsg("你无权访问该页面"); return;
            }
            string     newpwd  = Request.Form["TxtPassword"];
            string     cnewpwd = Request.Form["TxtConfirmPassword"];
            int        Uid     = DataConverter.CLng(Request.QueryString["uid"]);
            M_UserInfo mu      = buser.GetUserByName(GetPwdUName);

            if (Uid > 0)
            {
                mu = buser.SelReturnModel(Uid);
            }
            if (mu.IsNull)
            {
                function.WriteErrMsg("[" + Request["TxtUserName"] + "]用户不存在"); return;
            }
            if (!newpwd.Equals(cnewpwd))
            {
                function.WriteErrMsg("两次输入密码不一致"); return;
            }
            mu.UserPwd = StringHelper.MD5(cnewpwd);
            mu.seturl  = "";
            buser.UpDateUser(mu);
            function.WriteSuccessMsg("密码修改成功!", "/User/"); return;
        }