Using Community Edition 1.7.0.2

I found a solution for modifying a customer's password outside of issuing password reset emails.

   $write = Mage::getSingleton('core/resource')->getConnection('core_write');
   $passphrase = "topsecretpassword";
   $salt = "SC";
   $password = md5($salt . $passphrase) . ":SC";

   $write->query("update customer_entity_varchar set value='$password' where entity_id=$customer_id and attribute_id in (select attribute_id from eav_attribute where attribute_code='password_hash' and entity_type=1)");

But I'm not sure where to store this script or how to execute it. I've seen other programmatic solutions similar to this but do not recall the method they used to implement them. Thank you.

没有正确的解决方案

许可以下: CC-BY-SA归因
scroll top