Home » Magento9 March 2011

Magento: How to get admin user id, name, username, email, etc?

Here is a quick code to get the admin user’s data (id, name, username, email, password, etc).

By admin user, I mean the users that login through the admin panel and those who have access to the admin panel of Magento. The users can be administrator, or with some specific roles.

Hope this helps. Thanks.


Get New Post by Email

Find me on

FacebookTwitterGoogle+LinkedInRSS Feed
  • Nmohanswe

    hi when i used this code in productcontroller.php it says the following error. please let me know the solution

    Fatal error: Call to a member function getUser() on a non-object in /opt/lampp/htdocs/enlarge/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php on line 175

  • Actually, getData was the problem.

    The following way will not give the error:-

    $user = Mage::getSingleton(‘admin/session’);$userId = $user->getUser()->getUserId();
    I have corrected/edited the post as well.

  • Padidiver56

    I don’t understand. How do I use this?

  • Sshegde123

    Hi Mukesh,

              I am a fan of you. Your all magento solutions are very easy to understand. Thank you.

  • JayDave90

    Thanks.  Helped

  • curcin2

    Where & how does this work now?

    I really want to try it out but lack the know how to use it though.

  • mariya

    hi ,
    its very siple code .its worked for me….thank you….

  • is was very helpful for me…thanks!!!

  • Really helpful…thnx sooo much

  • Nathan

    Thanks For your sharing.. Its working Great……

  • Rao

    thanks for this post. question: how can i get store id by admin user id?

  • champjr

    Thank you, it helps me a lot !

  • how can i get current user profile information?