- To get Admin users collection or all admin users details in magento,
$user_collect = Mage::getModel('admin/user')->getCollection();
- To get users admin role in magento,
$get_user_admin = Mage::getSingleton('admin/session')->getUser();
$get_user_admin ->getRole()->getData('role_id');
- How to find and check username logged in magento admin,
Mage::getSingleton('core/session', array('name'=>'adminhtml'));
if( Mage::getSingleton('admin/session')->isLoggedIn() )
{
$get_user_admin = Mage::getSingleton('admin/session')->getUser();
echo $current_user_admin = $get_user_admin->getData('username');
}
// It prints 'saurabh.bansal' if username of magento is 'saurabh.bansal'
No comments:
Post a Comment