SHARE
TWEET

Untitled

a guest Oct 17th, 2019 129 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /**
  3.  * 2007-2017 PrestaShop
  4.  *
  5.  * NOTICE OF LICENSE
  6.  *
  7.  * This source file is subject to the Open Software License (OSL 3.0)
  8.  * that is bundled with this package in the file LICENSE.txt.
  9.  * It is also available through the world-wide-web at this URL:
  10.  * https://opensource.org/licenses/OSL-3.0
  11.  * If you did not receive a copy of the license and are unable to
  12.  * obtain it through the world-wide-web, please send an email
  13.  * to license@prestashop.com so we can send you a copy immediately.
  14.  *
  15.  * DISCLAIMER
  16.  *
  17.  * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
  18.  * versions in the future. If you wish to customize PrestaShop for your
  19.  * needs please refer to http://www.prestashop.com for more information.
  20.  *
  21.  * @author    PrestaShop SA <contact@prestashop.com>
  22.  * @copyright 2007-2017 PrestaShop SA
  23.  * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
  24.  * International Registered Trademark & Property of PrestaShop SA
  25.  */
  26. class Tools extends  ToolsCore
  27. {
  28.     /**
  29.      * Get guest token to prevent CSRF
  30.      *
  31.      * @param string $token token to encrypt
  32.      */
  33.     /*
  34.     * module: idea07_freshmail
  35.     * date: 2019-10-06 18:23:47
  36.     * version: 1.0.0
  37.     */
  38.     public static function getGuestToken($page = true, Context $context = null)
  39.     {
  40.         if (!$context) {
  41.             $context = Context::getContext();
  42.         }
  43.         if ($page === true) {
  44.             return (Tools::encrypt($context->cookie->id_guest.Tools::getRemoteAddr().$_SERVER['SCRIPT_NAME']));
  45.         } else {
  46.             return (Tools::encrypt($context->cookie->id_guest.Tools::getRemoteAddr().$page));
  47.         }
  48.     }
  49. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top