diff --git a/Classes/Controller/BackendController.php b/Classes/Controller/BackendController.php index 487b23b5e0828cb3104608121d5e14bb335eb32d..3db08d161509b3d0b0b21df28311baa094ad2bb1 100644 --- a/Classes/Controller/BackendController.php +++ b/Classes/Controller/BackendController.php @@ -26,7 +26,6 @@ namespace SGalinski\SgNews\Controller; * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ -use SGalinski\SgNews\Service\LicensingService; use SGalinski\SgNews\Utility\BackendNewsUtility; use TYPO3\CMS\Backend\Routing\UriBuilder; use TYPO3\CMS\Backend\Template\Components\ButtonBar; @@ -114,17 +113,11 @@ class BackendController extends ActionController { $backendUser->pushModuleData('tools_beuser/index.php/web_SgNewsNews_' . $key, $menuSetting); } - $currentLanguageInfo = NULL; - - if (!LicensingService::checkKey()) { - $this->view->assign('showLicenseBanner', TRUE); - } else { - $this->language = $backendUser->getModuleData( - 'tools_beuser/index.php/web_SgNewsNews_language', 'ses' - ) ?: 0; - $languageOptions = BackendNewsUtility::getAvailableLanguages($this->pageUid); - $currentLanguageInfo = $languageOptions[$this->language] ?? NULL; - } + $this->language = $backendUser->getModuleData( + 'tools_beuser/index.php/web_SgNewsNews_language', 'ses' + ) ?: 0; + $languageOptions = BackendNewsUtility::getAvailableLanguages($this->pageUid); + $currentLanguageInfo = $languageOptions[$this->language] ?? NULL; $this->docHeaderComponent->setMetaInformation($this->pageInfo); $this->makeButtons(); @@ -223,9 +216,6 @@ class BackendController extends ActionController { * @throws \InvalidArgumentException */ private function makeLanguageMenu() { - if (!LicensingService::checkKey()) { - return; - } $languageMenu = $this->docHeaderComponent->getMenuRegistry()->makeMenu(); $languageMenu->setIdentifier('languageMenu'); $languages = BackendNewsUtility::getAvailableLanguages($this->pageUid); diff --git a/Classes/Hooks/PageLayoutController.php b/Classes/Hooks/PageLayoutController.php index cb59462ac1ef9f805ea143cc9bc60a6a3e7e3be4..253737b2c6dfe06c70bfcd236e6ded809e40d4ac 100644 --- a/Classes/Hooks/PageLayoutController.php +++ b/Classes/Hooks/PageLayoutController.php @@ -25,7 +25,6 @@ namespace SGalinski\SgNews\Hooks; * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ -use SGalinski\SgNews\Service\LicensingService; use SGalinski\SgNews\Utility\BackendNewsUtility; use TYPO3\CMS\Backend\Controller\PageLayoutController as CorePageLayoutController; use TYPO3\CMS\Backend\Utility\BackendUtility; @@ -50,9 +49,6 @@ class PageLayoutController { */ public function addNewsModuleLink(array $parameters = [], $controller): string { $out = ''; - if (!(int) $controller->id || !LicensingService::checkKey()) { - return $out; - } $pageRow = BackendUtility::getRecord('pages', $controller->id); $acceptedDoktypes = [BackendNewsUtility::NEWS_DOKTYPE, BackendNewsUtility::CATEGORY_DOKTYPE]; if ( diff --git a/Classes/Service/LicensingService.php b/Classes/Service/LicensingService.php deleted file mode 100644 index a29290a5aad70ae01323a1987f45123e16b5edaa..0000000000000000000000000000000000000000 --- a/Classes/Service/LicensingService.php +++ /dev/null @@ -1,118 +0,0 @@ -<?php - -namespace SGalinski\SgNews\Service; - -/*************************************************************** - * Copyright notice - * - * (c) sgalinski Internet Services (https://www.sgalinski.de) - * - * All rights reserved - * - * This script is part of the TYPO3 project. The TYPO3 project is - * free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * The GNU General Public License can be found at - * http://www.gnu.org/copyleft/gpl.html. - * - * This script is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * This copyright notice MUST APPEAR in all copies of the script! - ***************************************************************/ - -use Psr\Http\Message\ResponseInterface; -use Psr\Http\Message\ServerRequestInterface; -use SGalinski\SgNews\Utility\ExtensionUtility; -use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; -use TYPO3\CMS\Core\Http\NullResponse; -use TYPO3\CMS\Core\Utility\GeneralUtility; - -/** - * Class SGalinski\SgNews\Service\LicensingService - */ -class LicensingService { - /** - * Licensing Service Url - */ - const URL = 'https://www.sgalinski.de/?eID=sgLicensing'; - - /** - * Licensing Service Url - */ - const EXTENSION_KEY = 'sg_news'; - - /** @var bool|NULL */ - private static $isLicenseKeyValid; - - /** - * @return boolean - */ - public static function checkKey(): bool { - if (static::$isLicenseKeyValid === NULL) { - static::$isLicenseKeyValid = FALSE; - $configuration = $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][self::EXTENSION_KEY] ?? []; - if (isset($configuration['key']) && $key = trim($configuration['key'])) { - static::$isLicenseKeyValid = (bool) preg_match('/^([A-Z\d]{6}-?){4}$/', $key); - } - } - - return static::$isLicenseKeyValid; - } - - /** - * Licensing Service ping - * - * @param boolean $returnUrl - * @return string - */ - public static function ping($returnUrl = FALSE): string { - try { - $configuration = $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][self::EXTENSION_KEY] ?? []; - $key = ''; - if (isset($configuration['key'])) { - $key = trim($configuration['key']); - } - $params = [ - 'extension' => self::EXTENSION_KEY, - 'host' => GeneralUtility::getIndpEnv('HTTP_HOST'), - 'key' => $key - ]; - $params = http_build_query($params); - $pingUrl = self::URL; - $pingUrl .= $params !== '' ? (strpos($pingUrl, '?') === FALSE ? '?' : '&') . $params : ''; - if ($returnUrl) { - return $pingUrl; - } - - GeneralUtility::getUrl($pingUrl); - } catch (\Exception $exception) { - } - - return ''; - } - - /** - * Generates a random password string based on the configured password policies. - * - * @param ServerRequestInterface $request - * @param ResponseInterface $response - * @return ResponseInterface - * @throws \InvalidArgumentException - */ - public function ajaxPing(ServerRequestInterface $request, ResponseInterface $response = NULL): ResponseInterface { - /** @var BackendUserAuthentication $backendUser */ - $backendUser = $GLOBALS['BE_USER']; - if ($backendUser && !$backendUser->getModuleData('tools_beuser/index.php/web_SgNewsNews_pinged', 'ses')) { - $backendUser->pushModuleData('tools_beuser/index.php/web_SgNewsNews_pinged', TRUE); - self::ping(); - } - - return $response ?? new NullResponse(); - } -} diff --git a/Classes/ViewHelpers/Backend/ControlViewHelper.php b/Classes/ViewHelpers/Backend/ControlViewHelper.php index 4a9fd751ced353392293459bf932b53e22589794..9ec52630991bc5cd0841d9dcf47903d301c01cc7 100644 --- a/Classes/ViewHelpers/Backend/ControlViewHelper.php +++ b/Classes/ViewHelpers/Backend/ControlViewHelper.php @@ -26,7 +26,6 @@ namespace SGalinski\SgNews\ViewHelpers\Backend; * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ -use SGalinski\SgNews\Service\LicensingService; use SGalinski\SgNews\ViewHelpers\AbstractViewHelper; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Imaging\Icon; @@ -82,7 +81,7 @@ class ControlViewHelper extends AbstractViewHelper { } $out = $databaseRecordList->makeControl($table, $row); - if ($table === 'pages' && LicensingService::checkKey()) { + if ($table === 'pages') { /** @var IconFactory $iconFactory */ $iconFactory = GeneralUtility::makeInstance(IconFactory::class); $buttonLabel = LocalizationUtility::translate('backend.button.editPageContent', 'SgNews'); diff --git a/Classes/ViewHelpers/Backend/TranslationLinksViewHelper.php b/Classes/ViewHelpers/Backend/TranslationLinksViewHelper.php index ff0645abcb3bdb37f312e5ab31da56bf6a8abb11..56e190c67ee06cc7e394718159f450b8792bd630 100644 --- a/Classes/ViewHelpers/Backend/TranslationLinksViewHelper.php +++ b/Classes/ViewHelpers/Backend/TranslationLinksViewHelper.php @@ -26,7 +26,6 @@ namespace SGalinski\SgNews\ViewHelpers\Backend; * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ -use SGalinski\SgNews\Service\LicensingService; use SGalinski\SgNews\Utility\BackendNewsUtility; use SGalinski\SgNews\ViewHelpers\AbstractViewHelper; use TYPO3\CMS\Backend\Routing\UriBuilder; @@ -63,9 +62,6 @@ class TranslationLinksViewHelper extends AbstractViewHelper { $table = $this->arguments['table']; $pageUid = $this->arguments['pageUid']; $out = ''; - if (!LicensingService::checkKey()) { - return $out; - } $table = trim($table); if ($table !== 'pages' && !isset($GLOBALS['TCA'][$table]['ctrl']['languageField'])) { diff --git a/Configuration/Backend/AjaxRoutes.php b/Configuration/Backend/AjaxRoutes.php deleted file mode 100644 index 6b2f02dd2cbcb14bf3ae63c935a35010921d2c9f..0000000000000000000000000000000000000000 --- a/Configuration/Backend/AjaxRoutes.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php - -return [ - 'sg_news::ajaxPing' => [ - 'path' => '/sg_news/ajaxPing', - 'target' => SGalinski\SgNews\Service\LicensingService::class . '::ajaxPing', - ] -]; diff --git a/Resources/Private/Layouts/Backend.html b/Resources/Private/Layouts/Backend.html index 64e0cc27efc6450bd9a8ece23576cc25f4975990..11777dd28bf8a4a54fe506d87525c293a6f8f951 100644 --- a/Resources/Private/Layouts/Backend.html +++ b/Resources/Private/Layouts/Backend.html @@ -43,9 +43,6 @@ </div> <div id="typo3-docbody"> <div id="typo3-inner-docbody"> - <f:if condition="{showLicenseBanner}"> - <f:render partial="Backend/LicenseBanner" /> - </f:if> <h1> <f:render section="headline" /> </h1> diff --git a/Resources/Private/Partials/Backend/LicenseBanner.html b/Resources/Private/Partials/Backend/LicenseBanner.html deleted file mode 100644 index c394186a3a346752fa7484e126e8667866b5c13c..0000000000000000000000000000000000000000 --- a/Resources/Private/Partials/Backend/LicenseBanner.html +++ /dev/null @@ -1,17 +0,0 @@ -<div class="bannerContainer"> - <div class="row"> - <div class="col-xs-12"> - <div class="panel panel-info"> - <div class="panel-heading"> - <f:image width="150" height="33" src="{f:uri.resource(path: 'Images/logo.svg')}" /> - | <span><f:translate key="backend.licenceBannerTitle"/></span> - </div> - <div class="panel-body"> - <f:format.raw> - <f:translate key="backend.licenceBannerText"/> - </f:format.raw> - </div> - </div> - </div> - </div> -</div> \ No newline at end of file diff --git a/Resources/Public/JavaScript/Backend.js b/Resources/Public/JavaScript/Backend.js index b96871811a2cecdf3cf3786f86a8fed963e7131d..8a23a1f3793986483424c1a028a0decb234f66ec 100644 --- a/Resources/Public/JavaScript/Backend.js +++ b/Resources/Public/JavaScript/Backend.js @@ -31,7 +31,6 @@ define([ var SgNewsModule = { init: function() { - $.get(TYPO3.settings.ajaxUrls['sg_news::ajaxPing']); $('#filter-reset-btn').on('click', function(event) { event.preventDefault(); this.form.reset(); diff --git a/composer.json b/composer.json index 50286d89e69593efa72ba8ed141a6e436d75f97a..cb1fe76ff1e42a8f3575cac179d79db05d860eff 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "license": [ "GPL-2.0-or-later" ], - "version": "9.3.4", + "version": "9.3.7", "support": { }, "repositories": [ diff --git a/ext_emconf.php b/ext_emconf.php index 5b3d415f632a7075691063374b9b2f92151b22a1..864c3506be12b15e109fbf34caad97fc0d4eeea5 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -19,7 +19,7 @@ $EM_CONF['sg_news'] = [ 'modify_tables' => '', 'clearCacheOnLoad' => 0, 'lockType' => '', - 'version' => '9.3.4', + 'version' => '9.3.7', 'constraints' => [ 'depends' => [ 'typo3' => '9.5.0-10.4.99',