when I make a request for a link to reset an admin password, the URL is sent to the email without params, like this:
https://url_magento/index.php/customer/account/resetpassword/
So, without params, obviously the users can't reset their passwords.
The function sending the email is this:
public function forgotpasswordAction()
{
$email = (string) $this->getRequest()->getParam('email');
$params = $this->getRequest()->getParams();
if (!empty($email) && !empty($params)) {
// Validate received data to be an email address
if (Zend_Validate::is($email, 'EmailAddress')) {
$collection = Mage::getResourceModel('admin/user_collection');
/** @var $collection Mage_Admin_Model_Resource_User_Collection */
$collection->addFieldToFilter('email', $email);
$collection->load(false);
if ($collection->getSize() > 0) {
foreach ($collection as $item) {
$user = Mage::getModel('admin/user')->load($item->getId());
if ($user->getId()) {
$newResetPasswordLinkToken = Mage::helper('admin')->generateResetPasswordLinkToken();
$user->changeResetPasswordLinkToken($newResetPasswordLinkToken);
$user->save();
$user->sendPasswordResetConfirmationEmail();
}
break;
}
}
$this->_getSession()
->addSuccess(Mage::helper('adminhtml')->__('If there is an account associated with %s you will receive an email with a link to reset your password.', Mage::helper('adminhtml')->escapeHtml($email)));
$this->_redirect('*/*/login');
return;
} else {
$this->_getSession()->addError($this->__('Invalid email address.'));
}
} elseif (!empty($params)) {
$this->_getSession()->addError(Mage::helper('adminhtml')->__('The email address is empty.'));
}
$this->loadLayout();
$this->renderLayout();
}
Is the same of the core on:
app/code/core/Mage/Adminhtml/controllers/IndexController.php
This only happens with de administrator users, the customers from the stores are working fine.
The Magento version is: 1.9.1.0
The url code on the email template is:
{{store url="customer/account/resetpassword/" _query_id=$customer.id _query_token=$customer.rp_token}}
Any ideas?
Thanks a lot.