From ff9dc70e9d6408f1e2d3bd7ea73ae1b838e8399b Mon Sep 17 00:00:00 2001 From: ihormandzyuk <75434014+ihormandzyuk@users.noreply.github.com> Date: Fri, 26 May 2023 13:08:56 +0300 Subject: [PATCH 1/3] Delete PredispathAdminActionControllerObserver.php --- ...redispathAdminActionControllerObserver.php | 55 ------------------- 1 file changed, 55 deletions(-) delete mode 100755 Observer/PredispathAdminActionControllerObserver.php diff --git a/Observer/PredispathAdminActionControllerObserver.php b/Observer/PredispathAdminActionControllerObserver.php deleted file mode 100755 index ff92b5e..0000000 --- a/Observer/PredispathAdminActionControllerObserver.php +++ /dev/null @@ -1,55 +0,0 @@ -_feedFactory = $feedFactory; - $this->_backendAuthSession = $backendAuthSession; - } - - /** - * Predispath admin action controller - * - * @param \Magento\Framework\Event\Observer $observer - * @return void - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function execute(\Magento\Framework\Event\Observer $observer) - { - if ($this->_backendAuthSession->isLoggedIn()) { - $feedModel = $this->_feedFactory->create(); - /* @var $feedModel \Magefan\LoginAsCustomer\Model\AdminNotificationFeed */ - $feedModel->checkUpdate(); - } - } -} From cae6846db176266f1c47d9a39d7ec5769fbb14c7 Mon Sep 17 00:00:00 2001 From: ihormandzyuk <75434014+ihormandzyuk@users.noreply.github.com> Date: Fri, 26 May 2023 13:09:09 +0300 Subject: [PATCH 2/3] Delete AdminNotificationFeed.php --- Model/AdminNotificationFeed.php | 169 -------------------------------- 1 file changed, 169 deletions(-) delete mode 100755 Model/AdminNotificationFeed.php diff --git a/Model/AdminNotificationFeed.php b/Model/AdminNotificationFeed.php deleted file mode 100755 index 4a19e27..0000000 --- a/Model/AdminNotificationFeed.php +++ /dev/null @@ -1,169 +0,0 @@ -_backendAuthSession = $backendAuthSession; - $this->_moduleList = $moduleList; - $this->_moduleManager = $moduleManager; - } - - /** - * Retrieve feed url - * - * @return string - */ - public function getFeedUrl() - { - if (is_null($this->_feedUrl)) { - $this->_feedUrl = 'https://mage'.'fan' - .'.c'.'om/community/notifications'.'/'.'feed/'; - } - - $urlInfo = parse_url($this->urlBuilder->getBaseUrl()); - $domain = isset($urlInfo['host']) ? $urlInfo['host'] : ''; - - $url = $this->_feedUrl . 'domain/' . urlencode($domain); - - $modulesParams = []; - foreach ($this->getMagefanModules() as $key => $module) { - $key = str_replace('Magefan_', '', $key); - $modulesParams[] = $key . ',' . $module['setup_version']; - } - - if (count($modulesParams)) { - $url .= '/modules/'.base64_encode(implode(';', $modulesParams)); - } - - return $url; - } - - /** - * Get Magefan Modules Info - * - * @return $this - */ - protected function getMagefanModules() - { - $modules = []; - foreach ($this->_moduleList->getAll() as $moduleName => $module) { - if (strpos($moduleName, 'Magefan_') !== false && $this->_moduleManager->isEnabled($moduleName)) { - $modules[$moduleName] = $module; - } - } - - return $modules; - } - - /** - * Check feed for modification - * - * @return $this - */ - public function checkUpdate() - { - $session = $this->_backendAuthSession; - $time = time(); - $frequency = $this->getFrequency(); - if (($frequency + $session->getMfNoticeLastUpdate() > $time) - || ($frequency + $this->getLastUpdate() > $time) - ) { - return $this; - } - - $session->setMfNoticeLastUpdate($time); - return parent::checkUpdate(); - } - - /** - * Retrieve Update Frequency - * - * @return int - */ - public function getFrequency() - { - return 86400; - } - - /** - * Retrieve Last update time - * - * @return int - */ - public function getLastUpdate() - { - return $this->_cacheManager->load('magefan_admin_notifications_lastcheck'); - } - - /** - * Set last update time (now) - * - * @return $this - */ - public function setLastUpdate() - { - $this->_cacheManager->save(time(), 'magefan_admin_notifications_lastcheck'); - return $this; - } -} From e2eeddeb2f77ce4da3e7e389717bcda8528ae0f6 Mon Sep 17 00:00:00 2001 From: ihormandzyuk <75434014+ihormandzyuk@users.noreply.github.com> Date: Fri, 26 May 2023 13:09:26 +0300 Subject: [PATCH 3/3] Delete events.xml --- etc/adminhtml/events.xml | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100755 etc/adminhtml/events.xml diff --git a/etc/adminhtml/events.xml b/etc/adminhtml/events.xml deleted file mode 100755 index 6d927c6..0000000 --- a/etc/adminhtml/events.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - -