[TASK] Hide new db settings in Configuration module 95/47995/3
authorJigal van Hemert <jigal.van.hemert@typo3.org>
Mon, 2 May 2016 21:12:04 +0000 (23:12 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 3 May 2016 10:13:14 +0000 (12:13 +0200)
Just like the old db settings the new settings for doctrine should
not be displayed in the Configuration module. Old settings are also
blinded as they can still exist in AdditionalConfiguration.php

Only existing settings are overwritten, previously the blinded options
were added to the settings if they didn't exist.

Resolves: #76020
Releases: master
Change-Id: I2a24b8c0841472a8415bd455c99b5ab8dd4f49f4
Reviewed-on: https://review.typo3.org/47995
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/lowlevel/Classes/View/ConfigurationView.php

index 77dc525..43d621d 100644 (file)
@@ -63,7 +63,17 @@ class ConfigurationView extends BaseScriptClass
                 'password' => '******',
                 'port' => '******',
                 'socket' => '******',
-                'username' => '******'
+                'username' => '******',
+                'Connections' => [
+                    'Default' => [
+                        'dbname' => '******',
+                        'host' => '******',
+                        'password' => '******',
+                        'port' => '******',
+                        'user' => '******',
+                        'unix_socket' => '******',
+                    ],
+                ],
             ],
             'SYS' => [
                 'encryptionKey' => '******'
@@ -78,6 +88,13 @@ class ConfigurationView extends BaseScriptClass
     {
         $this->view = GeneralUtility::makeInstance(StandaloneView::class);
         $this->view->getRequest()->setControllerExtensionName('lowlevel');
+        // Prepare blinding for all database connection types
+        foreach (array_keys($GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']) as $connectionName) {
+            if ($connectionName !== 'Default') {
+                $this->blindedConfigurationOptions['TYPO3_CONF_VARS']['DB']['Connections'][$connectionName] =
+                    $this->blindedConfigurationOptions['TYPO3_CONF_VARS']['DB']['Connections']['Default'];
+            }
+        }
     }
 
     /**
@@ -234,7 +251,7 @@ class ConfigurationView extends BaseScriptClass
         // mask sensitive information
         $varName = trim($arrayBrowser->varName, '$');
         if (isset($this->blindedConfigurationOptions[$varName])) {
-            ArrayUtility::mergeRecursiveWithOverrule($theVar, $this->blindedConfigurationOptions[$varName]);
+            ArrayUtility::mergeRecursiveWithOverrule($theVar, ArrayUtility::intersectRecursive($this->blindedConfigurationOptions[$varName], $theVar));
         }
         $tree = $arrayBrowser->tree($theVar, '', '');
         $this->view->assign('tree', $tree);