Magento 1.9 Admin – Changing Customer Password from Admin Panel

admin-paneladminformemail-templatesmagento-1.9password

In Customers/Manage Customers I can select a customer and then in tab "account information" I have a section "Password Management" where I can change a password for selected customer.

password management

I found out that code responsible for those fields is localized in Mage/Adminhtml/Block/Cusomer/Edit/Tab/Account.php and it is ok, but my question is how to find where and which method is calling to change the password after click the save button in administration panel and additionaly how to find where and which method is calling to send an e-mail with new password.

Best Answer

The code responsible for changing in the saveAction of the app/code/code/Mage/Adminhtml/controllers/CustomerController.php file:

if ($customer->getId()&& !empty($data['account']['new_password'])
                && Mage::helper('customer')->getIsRequireAdminUserToChangeUserPassword()
            ) {
                //Validate current admin password
                if (isset($data['account']['current_password'])) {
                    $currentPassword = $data['account']['current_password'];
                } else {
                    $currentPassword = null;
                }
                unset($data['account']['current_password']);
                $errors = $this->_validateCurrentPassword($currentPassword);
            }
Related Topic