Linking to Magento Admin from Outside Admin Panel

冷暖自知 提交于 2019-12-07 05:23:36

问题


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?


回答1:


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



回答2:


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.



来源:https://stackoverflow.com/questions/5745464/linking-to-magento-admin-from-outside-admin-panel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!