Magento Core Functions and Classes MasterPassword is overriding
MasterPassword is overriding some Magento Core Classes. So when experiencing conflicts with other Extensions, or having lost store customizations with MasterPassword being installed, these are the Classes it is overriding from the Magento Core:
Magento Core Class | by MasterPassword rewritten to | Remarks |
---|---|---|
Mage/Customer/Model/Customer.php | Pisc/Masterpassword/Model/Customer.php | To extend the Core Customer Model to allow password override and to introduce the events. |
Finding conflicts with another Extension
Look into the directories:
app/code/community
app/code/local
For each Extension to be found in these directories, check the etc/config.xml
if the Customer/Customer
Core Model is being rewritten like this:
<global> <models> <customer> <rewrite> <customer>Some_Other_Model_Here</customer> </rewrite> </customer> </models> </global>
Find the model file to which the Core Customer Model is being written (shown here as Some_Other_Model_Here
) and modify the validatePassword
function as described in the following.
Resolving an conflict with another Extension
Open the configuration file of MasterPassword and comment out the shown section to prevent rewriting the Magento Core Model:
app/code/local/Pisc/MasterPassword/etc/config.xml
<global> <models> <masterpassword> <class>Pisc_Masterpassword_Model</class> </masterpassword> <!-- To prevent conflicts with other Extensions <customer> <rewrite> <customer>Pisc_Masterpassword_Model_Customer_Customer</customer> </rewrite> </customer> --> </models>
In the Customer Model Class of the Extension - that is causing the conflict - add this Event or modify the code similar to as shown here:
/** * Validate password with salted hash * * @param string $password * @return boolean */ public function validatePassword($password) { /* if (!($hash = $this->getPasswordHash())) { return false; } return Mage::helper('core')->validateHash($password, $hash); */ // Replaced with this Event to handle the Password validation through MasterPassword return Mage::getModel('masterpassword/customer_customer')->validatePassword($password, $this); }