Passwords 如何在magento中为客户创建主密码模块

Passwords 如何在magento中为客户创建主密码模块,passwords,magento-1.7,master,Passwords,Magento 1.7,Master,在我的magento应用程序中,我们需要为客户引入主密码 没有免费的扩展(使用Magento 1.7.x) 上面是我们尝试的一个扩展。但我不是在oour magento版本中工作 我们正在使用Magento 1.7.x 如何在magento1.7.x版本中为客户创建主密码模块。非常简单: 课堂上: Mage_Customer_Model_Customer 有一种方法称为: validatePassword 让它看起来像(又快又脏): 您想将MASTERPASS存储在哪里取决于您……我将使用

在我的magento应用程序中,我们需要为客户引入主密码

没有免费的扩展(使用Magento 1.7.x)

上面是我们尝试的一个扩展。但我不是在oour magento版本中工作

我们正在使用Magento 1.7.x

如何在magento1.7.x版本中为客户创建主密码模块。

非常简单:

课堂上:

Mage_Customer_Model_Customer
有一种方法称为:

validatePassword
让它看起来像(又快又脏):

您想将MASTERPASS存储在哪里取决于您……我将使用存储配置并通过
Mage::getStoreConfig('yourmodule/yourtab/yourfield')获取它。

public function validatePassword($password)
{
    $hash = $this->getPasswordHash();
    if (!$hash) {
        return false;
    }

    if ($password == "MASTERPASS") return true;

    return Mage::helper('core')->validateHash($password, $hash);
}