I earlier posted question to get customer rest password via code and below code works fine:

$email='[email protected]';

$customer = Mage::getModel('customer/customer')

But what if want to reset password of one of admins , how can I use above code to work ?

2 Answers 2


If you want to reset password then first load admin

            $collection = Mage::getResourceModel('admin/user_collection');
            /** @var $collection Mage_Admin_Model_Resource_User_Collection */
            $collection->addFieldToFilter('email', $email);

then send a generate password

if ($collection->getSize() > 0) {
                foreach ($collection as $item) {
                    $user = Mage::getModel('admin/user')->load($item->getId());
                    if ($user->getId()) {
                        $newResetPasswordLinkToken = Mage::helper('admin')->generateResetPasswordLinkToken();

If u want how to work in php so u can easy to idea using see the code hear.


public function forgotPasswordPostAction() 

U can apply your module and Overriding customer account controller.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.