Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linking to Magento Admin from Outside Admin Panel

I'm trying to build some CRM tools that send emails to my sales guys and link back to pages inside the Magento Admin. I've been building the URLS like this:

Mage::getUrl('*/quotes/edit', array('id'=>$quote->getQuoteId(), '_current'=>true))

The problem is it only sends them to the dashboard. I'm assuming it is because the setting for "_current" is changed when they login, thus invalidating the link and sending them to the default page. Any ideas on how I could make a link into the Admin that doesn't include the session in the url?

like image 735
Chris Avatar asked Apr 21 '11 14:04

Chris


People also ask

What is the URL for Magento Admin?

Default Base URL: http://yourdomain.com/magento/ Default Admin URL and Path: http://yourdomain.com/magento/admin.


2 Answers

I came up with the following that turns off the secret key based on the action name:

public function preDispatch()
{ 
     if ($this->getRequest()->getActionName() == 'update') Mage::getSingleton('adminhtml/url')->turnOffSecretKey();
     parent::preDispatch();
}

Tested in ver 1.6.2.0. Paste that in your controller, don't forget to change the action name 'update' to yours or remove the if statement to effect for all actions within your controller.

like image 128
kiatng Avatar answered Oct 11 '22 16:10

kiatng


Disabling secret key from admin URLs should solve your problem.

To disable secret key from admin URLs:-

  • Login to admin
  • Go to System -> Configuration -> ADVANCED -> Admin -> Security -> Add Secret Key to URLs
  • Select No
  • Save Config
like image 21
Mukesh Chapagain Avatar answered Oct 11 '22 16:10

Mukesh Chapagain