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.


$userArray = Mage::getSingleton('admin/session')->getData();
// get individual data
$user = Mage::getSingleton('admin/session'); 
$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.