Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8371647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:12:51+00:00 2026-06-09T14:12:51+00:00

I have an existing admin_user that I’m basically migrating to an additional admin_user record,

  • 0

I have an existing admin_user that I’m basically migrating to an additional admin_user record, and I want to set the password hash for the new record with the value from the old record.

Because _beforeSave hooks setPassword() and encrypts it, it doesn’t seem possible.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T14:12:52+00:00Added an answer on June 9, 2026 at 2:12 pm

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have existing code that uses CMNewProfileSearch to find then iterate over the color
I have existing java code and need to create Design Document based on that.
I have existing code with their own makefiles which I want to load into
I'm new to stored procedure world. We have existing system with existing stored procedure,
I have an existing web service and I want it to expose 2 MEX
I have an existing database(myDatabse) that I created with Microsoft Sql Managenent studio and
I have written an ASP.NET web page with C# behind that runs an existing
I have a set of files for a custom-made CMS, and now that the
I have a Django app that is basically a web front end on a
I'm looking for some db design help. I have an existing application that I'd

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.