【发布时间】:2016-06-29 16:31:16
【问题描述】:
在 magento EE 1.13 中,重置忘记密码页面在应用补丁 6788 后未显示任何错误消息。这是我的 resetPasswordPostAction() 错误消息添加到会话并重定向到 changeForgotten 操作
if (!empty($errorMessages)) {
$this->_getSession()
->setCustomerFormData($this->getRequest()->getPost());
foreach ($errorMessages as $errorMessage) {
$this->_getSession()->addError($errorMessage);
}
$this->_redirect('*/*/changeforgotten');
return $this;
}
并在 resetforgottenpassword.phtml 中显示错误消息,例如
<?php echo $this->getMessagesBlock()->getGroupedHtml(); ?>
核心 changeForgottenAction 是:
public function changeForgottenAction()
{
try {
list($customerId, $resetPasswordLinkToken) = $this->_getRestorePasswordParameters($this->_getSession());
$this->_validateResetPasswordLinkToken($customerId, $resetPasswordLinkToken);
$this->loadLayout();
$this->renderLayout();
} catch (Exception $exception) {
$this->_getSession()->addError($this->_getHelper('customer')->__('Your password reset link has expired.'));
$this->_redirect('*/*/forgotpassword');
}
}
【问题讨论】: