This is a short post which will show you how to retrieve the current user on the Magento Admin Panel

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

You can use the $user->getData() to show all informations of the user object :

array
  'user_id' => string '58' (length=2)
  'firstname' => string 'MyFirstName' (length=11)
  'lastname' => string 'MyLastName' (length=10)
  'email' => string 'monmail@monmail.com' (length=19)
  'username' => string 'LOGIN' (length=5)
  'password' => string '400001467fc4b5c8bd8b972f5f378da7:sR' (length=35)
  'created' => string '2011-09-14 07:57:47' (length=19)
  'modified' => string '2011-09-14 08:00:14' (length=19)
  'logdate' => string '2014-03-31 08:43:34' (length=19)
  'lognum' => string '2109' (length=4)
  'reload_acl_flag' => string '0' (length=1)
  'is_active' => string '1' (length=1)
  'extra' => 
    array
      'configState' => 
        array
          'catalog_operations' => string '1' (length=1)
          [...]
          Some other custom attributes....

Of course, you need to be on the Admin context in order to get these datas, else, the getUser method will return false !

Get current Magento Admin User
Tagged on:             

Leave a Reply

Your email address will not be published. Required fields are marked *

We use cookies to ensure that we give you the best experience on our website.
Ok