vukan71 Posted June 20, 2012 Share Posted June 20, 2012 (edited) I tried using: Tools::redirectAdmin($link); to redirect to the other admin page. Problem is token. on first page I have ?token=5e344f2e07efc53edec490439b0d049a when Tools::redirectAdmin($link) redirects me, I get: Invalid security token. and on the next page ?token=dc6adcb2f5d406e67293704da26da7a5 I tied to add: $link =' . '?tab=MyTab&token=' . Tools::getAdminToken('Some_Unknow_Value_Here'); $link =' . '?tab=MyTab&token=' . $this->token; ... I think that solution could be here: public static function getAdminToken($string) { return !empty($string) ? self::encrypt($string) : false; } in $string. But what should be string? Edited June 26, 2012 by vukan71 (see edit history) Link to comment Share on other sites More sharing options...
CartExpert.net Posted June 21, 2012 Share Posted June 21, 2012 Hi. The token is: $this->token = Tools::getAdminToken($className.(int)$this->id.(int)$cookie->id_employee); where $this->id = Tab::getCurrentTabId(); You can check this in AdminTab.php, __construct method. Regards. Robin. The CartExpert Team Link to comment Share on other sites More sharing options...
vukan71 Posted June 22, 2012 Author Share Posted June 22, 2012 Thanx for answer but I fond solution in presta shop code. if link where I want to redirect is: index.php?tab=MyTabName&token=dc6adcb2f5d406e67293704da26da7a5 Solution is not to use Tools::getAdminToken but Tools::getAdminTokenLite: Tools::redirectAdmin( $currentIndex.'index.php?tab=MyTabName&token='.Tools::getAdminTokenLite('MyTabName') ); And now it works perfectly. If you have tab that you want to redirect to, you just call Tools::getAdminTokenLite('MyTabName') and Insert tab name as parametar Link to comment Share on other sites More sharing options...
CartExpert.net Posted June 26, 2012 Share Posted June 26, 2012 Hi, Please mark the topic as [sOLVED] Regards. Robin. The CartExpert Team Link to comment Share on other sites More sharing options...
brandonc503 Posted May 20, 2013 Share Posted May 20, 2013 (edited) how do i use that to make a link ? im gana use the module tab token to make a module config link, since they have the same token Edited May 20, 2013 by brandonc503 (see edit history) Link to comment Share on other sites More sharing options...
brandonc503 Posted May 20, 2013 Share Posted May 20, 2013 nm duh i got it. used {Tools::getAdminTokenLite('AdminModules')} and makes the token.. was perfect. thanks Link to comment Share on other sites More sharing options...
Thierryh Posted October 14, 2014 Share Posted October 14, 2014 You say " {Tools::getAdminTokenLite('AdminModules')} ". What is the value 'AdminModules' ? is it the name of your module ? Link to comment Share on other sites More sharing options...
jojo89 Posted July 29, 2015 Share Posted July 29, 2015 Hello i used this solution and it's work for me for the token, But no redirection in my browser, but i have a redirection in my console in fierbug... any solution for this problem Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now