I am new to magento, I am learning step by step with all your help. Thanks..

I have done admin login from the frontend. I have separate login for admin at front end footer, I did it successfully but when user-name and password is wrong then it redirect magento admin login form and display the error.

I don't need like that, I have to redirect it to front with error message.

Thanks in advance...

  • 1
    Put your code here. – Amit Bera Jul 28 '14 at 10:37

If you do the login with a form that points to /admin/index/login, you can add an additional hidden field to the form, for example is_login_from_frontend and check if this parameter is set in an observer for controller_action_postdispatch_admin_index_login like this:

public function redirectToFrontendAfterLoginFromFrontend(Varien_Event_Observer $observer)
    if (Mage::getSingleton('admin/session')->isLoggedIn()) {
        return; // never redirect if login was successful
    $controller = $this->getControllerAction();
    if ($controller->getRequest()->getPost('is_login_from_frontend')) {
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.