-
-
Save W4U-TOURS/b95a47e8653b66a28a3d829d35dea792 to your computer and use it in GitHub Desktop.
Handling guests user in Token::getToken() in PrestaShop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| public static function getToken($page = true, Context $context = null) | |
| { | |
| if (!$context) { | |
| $context = Context::getContext(); | |
| } | |
| if (!Validate::isLoadedObject($context->customer)) { | |
| $unique = $context->cookie->id_guest; | |
| } else { | |
| $unique = $context->customer->id.$context->customer->passwd; | |
| } | |
| $unique .= Tools::getRemoteAddr(); | |
| if ($page === true) { | |
| return (Tools::encrypt($unique.$_SERVER['SCRIPT_NAME'])); | |
| } else { | |
| return (Tools::encrypt($unique.$page)); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment