0

在我的 magento 应用程序中,我们需要为客户介绍主密码。

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

http://www.magentocommerce.com/magento-connect/master-password-4683.html

以上是我们尝试的一个扩展。但它不适用于我们的 magento 版本。

我们正在使用 Magento 1.7.x。

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

4

1 回答 1

1

它很容易:

在班上:

Mage_Customer_Model_Customer

有一种方法叫:

validatePassword

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

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

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

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

您想在哪里存储 MASTERPASS 取决于您...我会使用 Store Config 并通过Mage::getStoreConfig('yourmodule/yourtab/yourfield')

于 2013-08-15T18:01:25.800 回答