简体   繁体   English

从magento从1.7升级到1.9.1后,客户无法登录

[英]Customer cannot login after magento upgrade from 1.7 to 1.9.1

I recently upgraded magento from 1.7 to 1.9.1. 我最近将magento从1.7升级到了1.9.1。 All the features seems to be working including added extensions. 所有功能似乎都可以使用,包括添加的扩展。

When a customer is trying to login, it redirects it back to the login page with error. 当客户尝试登录时,它将错误地重定向回登录页面。

Invalid login or password.

I tried adding formkey code to the login form but no success in logging in. I used both the formkey codes that I found posted by some users, which they say it works for lots of other users 我尝试将Formkey代码添加到登录表单中,但未成功登录。我使用了一些用户发现的两种Formkey代码,他们说这些代码对许多其他用户都有效

    <?php echo $this->getBlockHtml('formkey'); ?>

and

    <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />

Is this because password is stored in different format in Magento 1.9.1 than in Magento 1.7? 这是因为密码在Magento 1.9.1中的存储格式与在Magento 1.7中的存储格式不同吗?

Anyone has any other solutions? 有人还有其他解决方案吗?

Solution: In my case, it was the encryption method. 解决方案:就我而言,这是加密方法。 Previously, the Magento setup I had, used to have sha256 encryption rather than md5. 以前,我使用的Magento设置曾经使用sha256加密而不是md5。 FORMKEY should have worked I guess if I did not had this encryption. FORMKEY应该可以正常工作,我想我是否没有这种加密方法。 I just had to change 我只需要改变

app/code/local/Mage/Core/Model/Encryption.php 应用程序/代码/本地/法师/核心/模型/Encryption.php

public function hash($data) {return md5($data);}

to

public function hash($data) {return hash('sha256', $data);}

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

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