开发者

How can I tell whether a Magento user is an administrator?

开发者 https://www.devze.com 2023-03-19 02:08 出处:网络
I\'m using Magento 1.5, and I need to check whether the currently-logged-in user is an admin user.开发者_StackOverflow社区 I need to check this from the user end, because I need to do a process for me

I'm using Magento 1.5, and I need to check whether the currently-logged-in user is an admin user.开发者_StackOverflow社区 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?


Mage::getSingleton('admin/session')->getUser();

or

Mage::app()->getStore()->isAdmin();


Try,

$admin = Mage::getModel('customer/session')->getAdmin();
if($admin->getId() != '') {//Admin is logged in}


Mage::getSingleton('adminhtml/session')->getUser();
0

精彩评论

暂无评论...
验证码 换一张
取 消