1

I don't know is it possible or not.

I want to redirect user to system configuration when user logged in to admin.

Is it possible ?

1 Answer 1

3

Think something like this was already asked here: how to set start page in backend magento for different role user in magento.

You just have to change adminRedirect() mehtod to fit for your needs, like adjust getUrl('adminhtml/sales_order') to getUrl('adminhtml/system_config/edit/section/yor_tab'). Since you have no check for user role this should be enough for Observer.php:

$response = Mage::app()->getResponse();
$response->clearHeaders()
    ->setRedirect(Mage::helper('adminhtml')->getUrl('adminhtml/system_config'))
    ->sendHeadersAndExit();

Answer from linked question:

There is no native function too achive this.

But you can use admin_session_user_login_success event for this.

To implement magento event observer refer this link

then add event in your config.xml file

<adminhtml>
    <events>
        <admin_session_user_login_success>
            <observers>
                <some_unique_handle>
                    <class>[your_model]/observer</class> 
                    <method>adminRedirect</method>
                </some_unique_handle>
            </observers>
        </admin_session_user_login_success>
    </events>
</adminhtml>

Then add this code in you observer file.

i.e., Path : app/code/{your-codepool}/{namespace}/{module}/Model/Observer.php

public function adminRedirect($observer)
{
    //get admin user id from observer
    $currentUserId = $observer->getuser()->getId();
    //get User Role
    $userRole = Mage::getModel('admin/user')->load($currentUserId)->getRole()->getRoleName();
    if ($userRole == 'sales') {
             // If user role is sales then it'll redirect to the sales order list page
        $response = Mage::app()->getResponse();
        $response->clearHeaders()
            ->setRedirect(Mage::helper("adminhtml")->getUrl('adminhtml/sales_order'))
            ->sendHeadersAndExit();
    }
    return $this;
}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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