Jump to content

[SOLVED] Token Generation Help


Jimmy87

Recommended Posts

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));
	}
  • Like 2
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...