Tagged with:  

5 Responses to “Magento: Check if an admin is logged in or not”

  1. Andreamweaver says:

    Hi, thanks for this snipped.
    I tried to put the code in my header.phtml but it return always “You need to be logged in as an admin.” even if I’m logged in the admin panel.
    What’s wrong? I’m running on Magento 1.5.

    Thank you

    • Make sure that your module’s adminhtml controller is extending Mage_Adminhtml_Controller_Action. You can’t check if an admin is logged in from a front end controller.

  2. Hello, thanks for this code.
    I tried to implement it in frontend, but it return always the message “You need to be logged in as an admin.” Any help?

  3. Make sure that your module’s adminhtml controller is extending Mage_Adminhtml_Controller_Action. You can’t check if an admin is logged in from a front end controller.

  4. Kevin says:

    Is there any way to get a block on the frontend that could check if the user is logged into the admin? My only idea is to wrap it in an iframe with a custom controller that extends Mage_Adminhtml_Controller_Action — but I’d rather not use an iframe if I don’t have to…

Leave a Reply

*

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...