![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/extmag/shiplab/Controller/AccessPoint/ |
<?php /** * Copyright © Extmag. All rights reserved. */ namespace Extmag\Shiplab\Controller\AccessPoint; use Extmag\Shiplab\Controller\AccessPoint; use Magento\Framework\App\Action\HttpGetActionInterface; use Magento\Framework\App\Action\HttpPostActionInterface; class Callback extends AccessPoint implements HttpGetActionInterface, HttpPostActionInterface { public function execute() { $params = $this->getRequest()->getParams(); $html = '<!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body>'; if (isset($params['action'])) { $html .= '<script type="text/javascript"> window.onload = function () {'; if (isset($params['action']) && $params['action'] == "cancel") { $html .= 'window.top.CarrierAccessPoint.closeAccessPointPopup();'; } if (isset($params['action']) && $params['action'] == "select") { $arrUrl = []; foreach ($params as $k => $v) { if (in_array( $k, [ 'appuId', 'name', 'addLine1', 'addLine2', 'addLine3', 'city', 'state', 'postal', 'country', 'carrier', ] )) { $arrUrl[$k] = $v; } } if (!empty($arrUrl)) { $this->customerSession->setAccessPointData(json_encode($arrUrl)); $html .= 'window.top.CarrierAccessPoint.setAccessPointAddress();'; } else { $html .= 'window.top.CarrierAccessPoint.closeAccessPointPopup();'; } } $html .= '}</script>'; } else { $html .= 'Error cross origin or 302 Redirect<script type="text/javascript">setTimeout(function(){ window.top.CarrierAccessPoint.closeAccessPointPopup(); }, 7000)</script>'; } $html .= '</body> </html>'; $this->getResponse() ->setContent($html); } }