简体   繁体   English

如何允许用户在BrowserCMS中更改密码?

[英]How to allow user to change password in BrowserCMS?

I have generated normal reset password portlet for non-admin users and inserted it to the page, but it seems not to be working. 我已经为非管理员用户生成了正常的重置密码portlet,并将其插入到页面中,但是似乎无法正常工作。 It just does nothing while submitted. 提交时它什么也没做。

The code of portlet is the standard: portlet的代码是标准的:

<% if flash_scope = flash[:reset_password] -%>
  <% if flash_scope[:error] -%>
    <span class="reset-password-error"><%= flash_scope[:error] %></span>
  <% end -%>
  <% if flash_scope[:notice] -%>
    <span class="reset-password-notice"><%= flash_scope[:notice] %></span>
  <% end -%>
<% end -%>

<%= form_tag '' do %>
  <% if params[:token] -%>
  <%= hidden_field_tag "token", params[:token] %>
  <% end -%>

  <label for="password">New Password:</label>
  <%= password_field_tag "password" %><br>

  <label for="password_confirmation">Confirm New Password:</label>
  <%= password_field_tag "password_confirmation" %><br>

  <%= submit_tag "Reset Password" %>
<% end %>

Am I missing something? 我想念什么吗?

Thank you thisfeller for push to the right direction! 谢谢这位农夫向正确的方向前进!

The problem was that the default password change portlet is mentioned to be used only with password reset portlet that sends email to user etc. So I wrote my own portlet based on that reset password portlet but removed the finding of wanted user by token and instead just check who is logged in. 问题是,提到默认密码更改Portlet仅与向用户等发送电子邮件的密码重置Portlet一起使用。因此,我根据该重置密码Portlet编写了自己的Portlet,但通过令牌删除了所需的用户,而只是检查谁登录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM