[TASK] Remove change 'encryption key' and 'site name' from Install Tool 45/52245/5
authorMarc Wessels <mwessels@me.com>
Wed, 29 Mar 2017 12:31:17 +0000 (14:31 +0200)
committerBenni Mack <benni@typo3.org>
Thu, 30 Mar 2017 19:37:19 +0000 (21:37 +0200)
Important actions 'Change site name' is available in 'All configuration'
and has only been there for historical reasons.

'Change encryption key' can commit hazard to a system and shouldn't
be there as a casual button for non experienced users.

Resolves: #80553
Releases: master
Change-Id: I4751c394263d6d8185567b811816a14cdd82a515
Reviewed-on: https://review.typo3.org/52245
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Documentation/Changelog/master/Important-80553-SimplifyImportantActionsInInstallTool.rst [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/Action/Tool/ImportantActions.php
typo3/sysext/install/Resources/Private/Partials/Action/Tool/ImportantActions/ChangeSiteName.html [deleted file]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/ImportantActions/SetNewEncryptionKey.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/Action/Tool/ImportantActions.html

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Important-80553-SimplifyImportantActionsInInstallTool.rst b/typo3/sysext/core/Documentation/Changelog/master/Important-80553-SimplifyImportantActionsInInstallTool.rst
new file mode 100644 (file)
index 0000000..b36075f
--- /dev/null
@@ -0,0 +1,19 @@
+.. include:: ../../Includes.txt
+
+==============================================================
+Important: #80553 - Simplify important actions in Install Tool
+==============================================================
+
+See :issue:`80553`
+
+Description
+===========
+
+To simplify the Install Tool the following settings have been removed from the section "Important actions":
+
+- Change site name
+- Change encryption key
+
+The configuration can be still changed in the section "All configuration"
+
+.. index:: Backend
index 4a6f441..9eb29dc 100644 (file)
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Install\Controller\Action\Tool;
 
 use TYPO3\CMS\Core\Core\Bootstrap;
 use TYPO3\CMS\Core\Core\ClassLoadingInformation;
-use TYPO3\CMS\Core\Crypto\Random;
 use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Database\Schema\SchemaMigrator;
 use TYPO3\CMS\Core\Database\Schema\SqlReader;
@@ -36,17 +35,10 @@ class ImportantActions extends Action\AbstractAction
      */
     protected function executeAction()
     {
-        if (isset($this->postValues['set']['changeEncryptionKey'])) {
-            $this->setNewEncryptionKeyAndLogOut();
-        }
-
         $actionMessages = [];
         if (isset($this->postValues['set']['changeInstallToolPassword'])) {
             $actionMessages[] = $this->changeInstallToolPassword();
         }
-        if (isset($this->postValues['set']['changeSiteName'])) {
-            $actionMessages[] = $this->changeSiteName();
-        }
         if (isset($this->postValues['set']['createAdministrator'])) {
             $actionMessages[] = $this->createAdministrator();
         }
@@ -158,31 +150,6 @@ class ImportantActions extends Action\AbstractAction
     }
 
     /**
-     * Set new site name
-     *
-     * @return \TYPO3\CMS\Install\Status\StatusInterface
-     */
-    protected function changeSiteName()
-    {
-        $values = $this->postValues['values'];
-        if (isset($values['newSiteName']) && $values['newSiteName'] !== '') {
-            /** @var \TYPO3\CMS\Core\Configuration\ConfigurationManager $configurationManager */
-            $configurationManager = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class);
-            $configurationManager->setLocalConfigurationValueByPath('SYS/sitename', $values['newSiteName']);
-            /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
-            $message = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Status\OkStatus::class);
-            $message->setTitle('Site name changed');
-            $this->view->assign('siteName', $values['newSiteName']);
-        } else {
-            /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
-            $message = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Status\ErrorStatus::class);
-            $message->setTitle('Site name not changed');
-            $message->setMessage('Site name must be at least one character long.');
-        }
-        return $message;
-    }
-
-    /**
      * Dumps Extension Autoload Information
      *
      * @return \TYPO3\CMS\Install\Status\StatusInterface
@@ -201,26 +168,6 @@ class ImportantActions extends Action\AbstractAction
     }
 
     /**
-     * Set new encryption key
-     */
-    protected function setNewEncryptionKeyAndLogOut()
-    {
-        $newKey = GeneralUtility::makeInstance(Random::class)->generateRandomHexString(96);
-        /** @var \TYPO3\CMS\Core\Configuration\ConfigurationManager $configurationManager */
-        $configurationManager = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class);
-        $configurationManager->setLocalConfigurationValueByPath('SYS/encryptionKey', $newKey);
-        /** @var $formProtection \TYPO3\CMS\Core\FormProtection\InstallToolFormProtection */
-        $formProtection = \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get(
-            \TYPO3\CMS\Core\FormProtection\InstallToolFormProtection::class
-        );
-        $formProtection->clean();
-        /** @var \TYPO3\CMS\Install\Service\SessionService $session */
-        $session = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Service\SessionService::class);
-        $session->destroySession();
-        \TYPO3\CMS\Core\Utility\HttpUtility::redirect('Install.php?install[context]=' . $this->getContext());
-    }
-
-    /**
      * Create administrator user
      *
      * @return \TYPO3\CMS\Install\Status\StatusInterface
diff --git a/typo3/sysext/install/Resources/Private/Partials/Action/Tool/ImportantActions/ChangeSiteName.html b/typo3/sysext/install/Resources/Private/Partials/Action/Tool/ImportantActions/ChangeSiteName.html
deleted file mode 100644 (file)
index 5ae4942..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<h3>Change site name</h3>
-<form method="post" class="form-horizontal">
-       <f:render partial="Action/Common/HiddenFormFields" arguments="{_all}" />
-       <div class="form-group">
-               <label for="t3-install-form-sitename" class="col-sm-3 control-label">Site name:</label>
-               <div class="col-sm-9">
-                       <input
-                                       id="t3-install-form-sitename"
-                                       type="text"
-                                       name="install[values][newSiteName]"
-                                       value="{siteName}"
-                                       class="t3-install-form-input-text form-control"
-                                       />
-               </div>
-       </div>
-       <f:render partial="Action/Common/SubmitButton" arguments="{name:'changeSiteName', text:'Change name'}"/>
-</form>
diff --git a/typo3/sysext/install/Resources/Private/Partials/Action/Tool/ImportantActions/SetNewEncryptionKey.html b/typo3/sysext/install/Resources/Private/Partials/Action/Tool/ImportantActions/SetNewEncryptionKey.html
deleted file mode 100644 (file)
index 8ec9581..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<h3>Change encryption key</h3>
-<p>
-       The encryption key is a random string that should be unique for this TYPO3 CMS instance.
-       It is a security relevant value and is never output directly.
-       Setting a new encryption key will invalidate temporary information and might invalidate URLs, so all
-       caches should be cleared afterwards. Additionally, you will be logged out from the install tool.
-</p>
-<form method="post">
-       <f:render partial="Action/Common/HiddenFormFields" arguments="{_all}" />
-       <f:render partial="Action/Common/SubmitButton" arguments="{name:'changeEncryptionKey', text:'Set a new encryption key'}"/>
-</form>
index d9af37b..a97e8f9 100644 (file)
        <f:render partial="Action/Tool/ImportantActions/NewInstallToolPassword" arguments="{_all}"/>
        <hr />
 
-       <f:render partial="Action/Tool/ImportantActions/ChangeSiteName" arguments="{_all}"/>
-       <hr />
-
-       <f:render partial="Action/Tool/ImportantActions/SetNewEncryptionKey" arguments="{_all}"/>
-       <hr />
-
        <f:render partial="Action/Tool/ImportantActions/CreateAdministrator" arguments="{_all}"/>
 
 </f:section>