0

I would like to redirect the admin upon login to my custom module dashboard. I do not want to override the existing dashboard, but run them in parallel. So I've done the following:

config.xml:

<admin_session_user_login_success>
    <observers>
        <module>
            <type>singleton</type>
            <class>Namespace_Module_Model_Observer</class>
            <method>custom_dashboard_redirect</method>
        </module>
    </observers>
</admin_session_user_login_success>

Observer.php:

public function custom_dashboard_redirect(){
    Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('*/custom_dashboard/*'));
    Mage::app()->getResponse()->sendResponse();
    exit;
}

Unfortunately this seems to simply redirect to the standard dashboard.

However, if I redirect to sales_order instead of custom_dashboard, it does the redirect correctly.

P.S. I can acccess custom_dashboard fine through the menu I've created, just not via this redirect. Would appreciate some pointers

1 Answer 1

1

This is not an answer to the question, but it may be a solution to your problem.
You don't need an event to redirect the admin to a certain page.
There is a setting in the backend where you can set the startup admin page.
Go to System->Configuration->Admin->Startup Page and you should see all the menu items in one dropdown. Select your custom dashboard and save.

1
  • Perfect solution to my problem. The fewer events, the better IMO.
    – Moose
    Commented Oct 8, 2014 at 7:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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