Jimmy87 Posted May 29, 2014 Share Posted May 29, 2014 Hello everyone, Can someone tel me, how the token is automatically generated in the system? and which files are involved in this process? Thank you in advance. Link to comment Share on other sites More sharing options...
vekia Posted May 30, 2014 Share Posted May 30, 2014 about what part of website you're talking? back office or front office? Link to comment Share on other sites More sharing options...
Jimmy87 Posted May 30, 2014 Author Share Posted May 30, 2014 Both, i need it for both views Link to comment Share on other sites More sharing options...
vekia Posted May 30, 2014 Share Posted May 30, 2014 okay so, function to "generate" token is called in two files for front office: classes/controllers/FrontController.php for back office: classes/controllers/AdminController.php front controller contains code (in initContent() function) $this->context->smarty->assign(array( ... 'token' => Tools::getToken(), admin contorller contains code (part of initHeader() function) $this->context->smarty->assign(array( ... 'token' => Tools::getToken(), as you can see both files calls Tools::getToken() function. classes/Tools.php public static function getToken($page = true, Context $context = null) { if (!$context) $context = Context::getContext(); if ($page === true) return (Tools::encrypt($context->customer->id.$context->customer->passwd.$_SERVER['SCRIPT_NAME'])); else return (Tools::encrypt($context->customer->id.$context->customer->passwd.$page)); } 2 Link to comment Share on other sites More sharing options...
Jimmy87 Posted May 30, 2014 Author Share Posted May 30, 2014 Thank you very Much Link to comment Share on other sites More sharing options...
vekia Posted May 30, 2014 Share Posted May 30, 2014 you're welcome :-) i marked topic title as solved if you will need any additional assistance related to this case just continue discussion below with regards, Milos 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