magento 密码找回出错的解决方法

通过清心醉

magento 密码找回出错的解决方法

当密码找回邮件发送至客户邮箱时,客户打开邮箱链接系统会提示:
Fatal error: Call to a member function setCustomerId() on a non-object in /www1/app/code/core/Mage/Customer/controllers/AccountController.php on line 753

查看当前错误文件的源代码

$this->getLayout()->getBlock(‘resetPassword’)
->setCustomerId($customerId)   //这里报错
->setResetPasswordLinkToken($resetPasswordLinkToken);

即然这里调用了block,系统肯定在layout文件中有相关定义

打开布局文件

app/design/frontend/default/当前使用模板/layout/customer.xml

发现没有这个句柄。
源安装文件的模板中找到了,复制过去

<customer_account_resetpassword translate=”label”>
<label>Reset a Password</label>
<remove name=”right”/>
<remove name=”left”/>

<reference name=”head”>

<action method=”setTitle” translate=”title” module=”customer”>
<title>Reset a Password</title>
</action>
</reference>
<reference name=”root”>
<action method=”setTemplate”>
<template>page/1column.phtml</template>
</action>
<action method=”setHeaderTitle” translate=”title” module=”customer”>
<title>Reset a Password</title>
</action>
</reference>
<reference name=”content”>
<block type=”customer/account_resetpassword” name=”resetPassword” template=”customer/form/resetforgottenpassword.phtml”/>
</reference>
</customer_account_resetpassword>

然后登陆后台,清除缓存等数据并刷新。密码找回项即可成功实现。

 

 

对于忘记后台超级管理密码的,可使用以下方法:

一:

直接修改数据库admin_user表里的密码(管理员帐号)

编辑会看到有password的长窜vaule值这就是你的密码 md5加密后的值。

具体MD5加密就不说了,直接GOOGLE搜索MD5就有结果了。

二:

用sql命令修改管理员新密码
执行以下语句:
UPDATE `admin_user` SET `password` = MD5(‘123456’) WHERE `username` = ‘admin’;

 

/***以下为注释

`password` = MD5(‘123456’) 为修改的密码

`username` = ‘admin’;为要修改的用户。 ****/

 

 

关于作者

清心醉 administrator

Albertjaw进行回复 取消回复

如果喜欢作者的文章,您可以打赏给作者:

TRC20(虚拟货币):


ERC20(虚拟货币):


Bitcoin(BTC):