开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜