Reputation: 5042
I'm using Magento 1.5, and I need to check whether the currently-logged-in user is an admin user. I need to check this from the user end, because I need to do a process for members that depends on whether they're admin users or not.
Is this possible in Magento?
Upvotes: 4
Views: 4475
Reputation: 5042
Mage::getSingleton('admin/session')->getUser();
or
Mage::app()->getStore()->isAdmin();
Upvotes: 3
Reputation: 1839
Try,
$admin = Mage::getModel('customer/session')->getAdmin();
if($admin->getId() != '') {//Admin is logged in}
Upvotes: 1