[FEATURE] Allow to disable the "Core Updater" through an env-variable 29/24629/2
authorErnesto Baschny <ernst@cron-it.de>
Sat, 12 Oct 2013 12:14:19 +0000 (14:14 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 12 Oct 2013 19:39:52 +0000 (21:39 +0200)
By setting the environment variable "TYPO3_DISABLE_CORE_UPDATER=1" the
Core Updater functionality is disabled in the Install Tool. This can
be useful for providers which have it's own means of upgrading the
Core.

Resolves: #52639
Releases: 6.2
Change-Id: I88272ea613d95512ad780cefa5e261cf2dc6a60c
Reviewed-on: https://review.typo3.org/24629
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
typo3/sysext/install/Classes/Controller/Action/Tool/ImportantActions.php
typo3/sysext/install/Resources/Private/Partials/Action/Tool/ImportantActions/CoreUpdateButton.html

index 21b5bd0..a1b98f8 100644 (file)
@@ -79,6 +79,7 @@ class ImportantActions extends Action\AbstractAction implements Action\ActionInt
                        : FALSE;
 
                $this->view
+                       ->assign('enableCoreUpdate', $this->isCoreUpdateEnabled())
                        ->assign('operatingSystem', $operatingSystem)
                        ->assign('cgiDetected', $cgiDetected)
                        ->assign('databaseName', $GLOBALS['TYPO3_CONF_VARS']['DB']['database'])
@@ -92,6 +93,15 @@ class ImportantActions extends Action\AbstractAction implements Action\ActionInt
                return $this->view->render();
        }
 
+       /**
+        * 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
         *
index 30cb8b8..709de3b 100644 (file)
@@ -4,28 +4,45 @@
        The install tool can automatically update the TYPO3 CMS core to its latest
        minor release if certain criteria are met.
 </p>
+
 <div id="coreUpdate">
-       <div id="messageTemplate">
-               <div class="typo3-message">
-                       <div class="header-container">
-                               <div class="message-header">
-                                       <strong></strong>
+       <f:if condition="{enableCoreUpdate}">
+               <f:then>
+                       <div id="messageTemplate">
+                               <div class="typo3-message">
+                                       <div class="header-container">
+                                               <div class="message-header">
+                                                       <strong></strong>
+                                               </div>
+                                       </div>
+                                       <div class="message-body">
+                                       </div>
                                </div>
+                               <p></p>
+                       </div>
+                       <div id="buttonTemplate">
+                               <fieldset class="t3-install-form-submit">
+                                       <ol>
+                                               <li>
+                                                       <button class="btn" type="submit" name="coreUpdateCheckForUpdate" data-action="checkForUpdate">
+                                                               Check for core updates
+                                                       </button>
+                                               </li>
+                                       </ol>
+                               </fieldset>
                        </div>
-                       <div class="message-body">
+               </f:then>
+               <f:else>
+                       <div class="typo3-message message-notice">
+                               <div class="header-container">
+                                       <div class="message-header">
+                                               <strong>Disabled</strong>
+                                       </div>
+                               </div>
+                               <div class="message-body">
+                                       This feature is disabled in this installation (through the environment variable <code>TYPO3_DISABLE_CORE_UPDATER=1</code>)
+                               </div>
                        </div>
-               </div>
-               <p></p>
-       </div>
-       <div id="buttonTemplate">
-               <fieldset class="t3-install-form-submit">
-                       <ol>
-                               <li>
-                                       <button class="btn" type="submit" name="coreUpdateCheckForUpdate" data-action="checkForUpdate">
-                                               Check for core updates
-                                       </button>
-                               </li>
-                       </ol>
-               </fieldset>
-       </div>
+               </f:else>
+       </f:if>
 </div>
\ No newline at end of file