[FEATURE] Allow to disable "Core Updater": not only optically 61/24661/3
authorErnesto Baschny <ernst@cron-it.de>
Sat, 12 Oct 2013 20:24:50 +0000 (22:24 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 12 Oct 2013 21:12:30 +0000 (23:12 +0200)
Follow-up to "Allow to disable the "Core Updater" through an env-variable".
Now it's not even possible to call the individual Ajax requests that do the
update if it is disabled.

Resolves: #52639
Releases: 6.2
Change-Id: Icfa18d619bbb8aabf1896920f28fe5a63bd5c345
Reviewed-on: https://review.typo3.org/24661
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/install/Classes/Controller/Action/Ajax/AbstractCoreUpdate.php
typo3/sysext/install/Classes/Controller/Action/Tool/ImportantActions.php
typo3/sysext/install/Classes/Service/CoreUpdateService.php

index 7df66bf..5056d8b 100644 (file)
@@ -62,6 +62,12 @@ abstract class AbstractCoreUpdate extends Action\AbstractAction {
         * @return void
         */
        protected function initializeCoreUpdate() {
+               if (!$this->coreUpdateService->isCoreUpdateEnabled()) {
+                       throw new \TYPO3\CMS\Install\Controller\Exception(
+                               'Core Update disabled in this environment',
+                               1381609294
+                       );
+               }
                $this->loadExtLocalconfDatabaseAndExtTables();
        }
 
index a1b98f8..7b1ec96 100644 (file)
@@ -78,8 +78,10 @@ class ImportantActions extends Action\AbstractAction implements Action\ActionInt
                        ? TRUE
                        : FALSE;
 
+               /** @var \TYPO3\CMS\Install\Service\CoreUpdateService $coreUpdateService */
+               $coreUpdateService = $this->objectManager->get('TYPO3\\CMS\\Install\\Service\\CoreUpdateService');
                $this->view
-                       ->assign('enableCoreUpdate', $this->isCoreUpdateEnabled())
+                       ->assign('enableCoreUpdate', $coreUpdateService->isCoreUpdateEnabled())
                        ->assign('operatingSystem', $operatingSystem)
                        ->assign('cgiDetected', $cgiDetected)
                        ->assign('databaseName', $GLOBALS['TYPO3_CONF_VARS']['DB']['database'])
@@ -94,15 +96,6 @@ class ImportantActions extends Action\AbstractAction implements Action\ActionInt
        }
 
        /**
-        * Check if this installation wants to enable the core updater
-        *
-        * @return boolean
-        */
-       protected function isCoreUpdateEnabled() {
-               return (getenv('TYPO3_DISABLE_CORE_UPDATER') !== '1');
-       }
-
-       /**
         * Set new password if requested
         *
         * @return \TYPO3\CMS\Install\Status\StatusInterface
index 08acd8d..09e4d5f 100644 (file)
@@ -89,6 +89,15 @@ class CoreUpdateService {
        }
 
        /**
+        * Check if this installation wants to enable the core updater
+        *
+        * @return boolean
+        */
+       public function isCoreUpdateEnabled() {
+               return (getenv('TYPO3_DISABLE_CORE_UPDATER') !== '1');
+       }
+
+       /**
         * In future implementations we might implement some sarter logic here
         *
         * @return string