Magento get admin user id


Magento get admin user id: You can get admin user id in magento from admin user session ie. Mage::getSingleton(‘admin/session’); You can get admin user name, username, email, first name and last name also from the admin user session. Here we are going to demonstrate this with syntax and example.


Magento get admin user id

Here is syntax for getting admin user details-

:


$userSession = Mage::getSingleton('admin/session'); 
$userId = $userSession->getUser()->getUserId();
$userEmail = $userSession->getUser()->getEmail();
$userFirstname = $userSession->getUser()->getFirstname();
$userLastname = $userSession->getUser()->getLastname();
$userUsername = $userSession->getUser()->getUsername();

The above example will give you current admin user id, name, email, username etc.


Add Comment

📖 Read More


Advertisements