roykin/modules/be2bill/validation.php
Serveur preprod be83006fb6 push dev
2016-06-01 11:53:40 +02:00

35 lines
1.2 KiB
PHP

<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
include(dirname(__FILE__).'/../../config/config.inc.php');
include(dirname(__FILE__).'/classes/Be2billApi.php');
require_once(_PS_MODULE_DIR_.'be2bill/be2bill.php');
$parameters = $_GET;
/* Extract hash value */
$hash = $parameters['HASH'];
unset($parameters['HASH']);
$account = $parameters['EXTRADATA'];
$account = explode('-', $account);
$id_account = (int) $account[1];
/* Validate hash */
if ($hash == Be2billApi::buildHash($parameters, $id_account)) {
$link = new Link();
Tools::redirectLink($link->getModuleLink('be2bill', 'validation', array_merge($_GET, array(
'content_only' => true)), true));
} else {
die('bad hash.');
}