![]() 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/Adminhtml/AccessPoint/ |
<?php /** * Copyright © Extmag. All rights reserved. */ namespace Extmag\Shiplab\Controller\Adminhtml\AccessPoint; use Magento\Backend\App\Action; class CallbackOrder extends Action { /** * Authorization level of a basic admin session * * @see _isAllowed() */ public const ADMIN_RESOURCE = 'Extmag_Shiplab::shiplab_labels_save'; 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.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->_getSession()->setAccessPointData(json_encode($arrUrl)); $html .= 'window.top.setAccessPointAddress();'; } else { $html .= 'window.top.closeAccessPointPopup();'; } } $html .= '}</script>'; } else { $html .= '<b>Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://some-url-here.</b><script type="text/javascript">setTimeout(function(){window.top.closeAccessPointPopup();}, 7000)</script>'; } $html .= '</body></html>'; $this->getResponse()->setContent($html); } }