Was in the process of writing this question, when I figured out how to solve it, so I'll go ahead and post my own answer here, in case it helps anyone else.
Looks like you need to overload the Mage_Admin_Model_User
class to do this. Since you'll probably be loading the class directly and calling the method to set the password, you probably won't need to worry about rewrites or event observing.
Here's how I did it:
class Me_Mymodule_Model_Admin_User extends Mage_Admin_Model_user
{
protected function _beforeSave()
{
parent::_beforeSave();
if ($this->getPasswordHash()) {
$this->setData('password', $this->getPasswordHash());
}
}
}
And then, to change it, do the following. In my case, I did this within a custom migration script that I wrote.
// This just sets the "password_hash" data on the model which has no function other
// than to be converted to the "password" value in the _beforeSave() above.
$adminUser = Mage::getModel('mymodule/admin_user')->load($id);
$adminUser->setPasswordHash('insert password hash here')->save();
The setPasswordHash()
and getPasswordHash()
methods are regular Magento magic getters / setters, so they don't need to be defined anywhere.
UPDATE: Don't downvote for answering own question, it's encouraged.