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?
Default Base URL: http://yourdomain.com/magento/ Default Admin URL and Path: http://yourdomain.com/magento/admin.
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.
Disabling secret key from admin URLs should solve your problem.
To disable secret key from admin URLs:-
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With