| Current Path : /var/www/www.indacotrentino.com/www/app/code/Torresani/Consent/Controller/Privacy/ |
| Current File : /var/www/www.indacotrentino.com/www/app/code/Torresani/Consent/Controller/Privacy/Update.php |
<?php
namespace Torresani\Consent\Controller\Privacy;
class Update extends \Magento\Framework\App\Action\Action {
/**
* @var \Magento\Framework\View\Result\PageFactory
*/
protected $resultPageFactory;
/**
* @param \Magento\Framework\App\Action\Context $context
* @param \Magento\Framework\View\Result\PageFactory resultPageFactory
*/
public function __construct(
\Magento\Framework\App\Action\Context $context,
\Magento\Framework\View\Result\PageFactory $resultPageFactory
)
{
$this->resultPageFactory = $resultPageFactory;
parent::__construct($context);
}
public function execute()
{
$key = 'my_secret_key';
$input = 'test@testi123.it';
$hmac = hash_hmac('sha256', $input, $key);
// echo "Hello World: " . $hmac . "<br/>";
//https://indaco2.38121.it/consent/privacy/update?m=test@testi123.it&k=287504c84d6c5630c96bc87e54eff60a47dae4b8eeac5d362c6e760d4d4c16c4
if (hash_hmac('sha256', ($_GET['m'] ?? ''), $key) == ($_GET['k'] ?? '')) {
// echo "OK <br/>";
} else {
}
// var_dump($_GET);
return $this->resultPageFactory->create();
}
}