• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

重置密码,果园未更新

用户头像
it1352
帮助1

问题说明

使用果园1.6.在控制台的设置"部分中,我启用了显示链接以使用户可以重置密码"

Using Orchard 1.6. In the settings section in the Dashboard I have enabled 'Display a link to enable users to reset their password'

在服务器上更新此功能后,用户现在可以请求将丢失的密码电子邮件发送给他们,从而允许他们更改密码.一切正常,但是新密码不起作用.并且旧密码仍然有效?为什么会这样?

After updating this feature on the server the user can now request a lost password email be sent to them which allows them to change their password. This all works fine however the new password does not take affect. and the old password still works? why is this?

感谢您的答复

正确答案

#1

我刚刚遇到了这个问题.我正在使用Orchard 1.7.

I just had this issue. I am using Orchard 1.7.

问题似乎来自以下事实:尝试修改密码并将用户重定向到首页时,随机数为null.

The problems seem to come from the fact that the nonce is null when trying to modify the password, redirecting the user to the home page.

首先,我修改了Orchard.Users.AccountController LostPassword控制器,使其看起来像这样:

First, I modified the Orchard.Users.AccountController LostPassword controller to look like this :

 public ActionResult LostPassword(string nonce) {
        if ( _userService.ValidateLostPassword(nonce) == null ) {
            return RedirectToAction("LogOn");
        }
        ViewData["nonce"] = nonce; //add this line
        ViewData["PasswordLength"] = MinPasswordLength;

        return View();
    }

然后,您需要修改LostPassword.cshtml并将此行添加到表单中:

Then, you need to modify the LostPassword.cshtml and add this line within the form :

@Html.Hidden("nonce",ViewData["nonce"])

这可以确保在发布新密码时随机数会被传回并解决该问题.

This assures that the nonce gets passed back when posting the new password and fixes the issue.

希望这会有所帮助.

不要忘记,您还需要在主题的LostPassword.cshtml文件中添加该行.如果不这样做,您仍然会遇到此错误.

Don't forget that you need to add that line in your theme's LostPassword.cshtml file as well. If you don't you will still have this error.

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /reply/detail/tanhcciheg
系列文章
更多 icon
同类精品
更多 icon
继续加载