- To get Admin users collection or all the the admin users details,
Mage::getModel('admin/user')->getCollection();
- To get admin role,
$getUser = Mage::getSingleton('admin/session')->getUser();
$getUser->getRole()->getData('role_id');
- To check admin user logged in or not using,
Mage::getSingleton('core/session', array('name'=>'adminhtml'));
if( Mage::getSingleton('admin/session')->isLoggedIn() )
{
$getUser = Mage::getSingleton('admin/session')->getUser();
echo $getUser->getData('username');
}
if( Mage::getSingleton('admin/session')->isLoggedIn() )
{
$getUser = Mage::getSingleton('admin/session')->getUser();
echo $getUser->getData('username');
}
Thank you Ravichandran Jothi
ReplyDeleteHI
ReplyDeleteI am using a custom php file to access the admin session and the code you mentioned is not working.