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.
$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.
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.
$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.
$user = Mage::getModel('admin/user')->getCollection()->getData();
ReplyDeletefrom the above code you can get the collection data of admin. To get email see the code below
foreach($user as $userData=>$val){
$email=$val['email'];
}
oh thanks fine. this is also easy to get admin data
Delete