Showing posts with label details. Show all posts
Showing posts with label details. Show all posts

Monday, September 19, 2011

How to get magento admin username, id, email and password?

Here is a quick code to get the admin user’s data (id, username, email, password, etc).
$user = Mage::getSingleton('admin/session')->getData();
$userId = $user->getUser()->getUserId();
$userEmail = $user->getUser()->getEmail();
$userFirstname = $user->getUser()->getFirstname();
$userLastname = $user->getUser()->getLastname();
$userUsername = $user->getUser()->getUsername();
$userPassword = $user->getUser()->getPassword();
Hope this helps. Thanks.