![]() 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 Callback 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) { $arrUrl[$k] = $v; } $html .= 'window.top.setAccessPointAddress(' . json_encode($arrUrl) . ');'; } $html .= '}</script>'; } else { $html .= 'Error cross origin or 302 Redirect<script type="text/javascript">setTimeout(function(){ window.top.closeAccessPointPopup(); }, 7000)</script>'; } $html .= '</body></html>'; $this->getResponse()->setContent($html); } }