0

I tried to upgrade Magento 1.9.0.1 to 1.9.1 via the Magento Connect facility and it seems to have stopped me being able to add users and roles for API access.

Here's the error:

Invalid method Mage_Admin_Model_User::validateCurrentPassword(Array

Has anyone ever come across this?

2 Answers2

0

this issues can be solve

1) open the file app/code/core/Mage/Adminhtml/Controller/Action.php 2) After that see the function on line number 395 and comment the internel code into this.

protected function _validateCurrentPassword($password){

   /*$user = Mage::getSingleton('admin/session')->getUser();
    return $user->validateCurrentPassword($password);*/

}

0

I recently came across this same issue after upgrading Magento to a newer version of 1.9.

It should be noted that you should never modify core files, and the password validation should not necessarily be removed.

In my personal case, I restored the original function to the core file, however, you could just as easily extend the Mage_Admin_Model_User class.

The version of the function I used can be found below.

/**
 * Validate password against current user password
 * Returns true or array of errors.
 *
 * @return mixed
 */
public function validateCurrentPassword($password)
{
    $result = array();

    if (!Zend_Validate::is($password, 'NotEmpty')) {
        $result[] = $this->_getHelper('adminhtml')->__('Current password field cannot be empty.');
    } elseif (is_null($this->getId()) || !$this->_getHelper('core')->validateHash($password, $this->getPassword())){
        $result[] = $this->_getHelper('adminhtml')->__('Invalid current password.');
    }

    if (empty($result)) {
        $result = true;
    }
    return $result;
}
Shaun Cockerill
  • 800
  • 8
  • 11