[FEATURE] Add a hook to hide credentials in the Configuration module 44/54644/14
authorChristian Wolff <chris@connye.com>
Wed, 15 Nov 2017 09:45:25 +0000 (10:45 +0100)
committerSusanne Moog <susanne.moog@typo3.org>
Sat, 9 Dec 2017 21:35:16 +0000 (22:35 +0100)
This allows extensions to hide their own credentials in the
Configuration module.

Resolves: #82999
Releases: master
Change-Id: Idb25ab98c7986fb6f7471948b684834b608a0f0d
Reviewed-on: https://review.typo3.org/54644
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
typo3/sysext/core/Documentation/Changelog/master/Feature-82999-AddAHookToHideCredentialsInTheConfigurationModule.rst [new file with mode: 0644]
typo3/sysext/lowlevel/Classes/Controller/ConfigurationController.php

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-82999-AddAHookToHideCredentialsInTheConfigurationModule.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-82999-AddAHookToHideCredentialsInTheConfigurationModule.rst
new file mode 100644 (file)
index 0000000..6506600
--- /dev/null
@@ -0,0 +1,22 @@
+.. include:: ../../Includes.txt
+
+============================================================================
+Feature: #82999 - Add a hook to hide credentials in the Configuration module
+============================================================================
+
+See :issue:`82999`
+
+Description
+===========
+
+To blind additional configuration options in the Configuration module a hook has been added:
+
+:php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Lowlevel\ControllerConfigurationController::class]['modifyBlindedConfigurationOptions']`
+
+
+Impact
+======
+
+Extension developers can use this hook to e.g. hide custom credentials in the Configuration module.
+
+.. index:: NotScanned
\ No newline at end of file
index e03a0e8..41403ca 100644 (file)
@@ -166,7 +166,15 @@ class ConfigurationController
         if ($selectedTreeDetails['type'] === 'global') {
             $globalArrayKey = $selectedTreeDetails['globalKey'];
             $renderArray = $GLOBALS[$globalArrayKey];
+
+            // Hook for Processing blindedConfigurationOptions
             $blindedConfigurationOptions = $this->blindedConfigurationOptions;
+
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['modifyBlindedConfigurationOptions'] ?? [] as $classReference) {
+                $processingObject = GeneralUtility::makeInstance($classReference);
+                $blindedConfigurationOptions = $processingObject->modifyBlindedConfigurationOptions($blindedConfigurationOptions, $this);
+            }
+
             if (isset($blindedConfigurationOptions[$globalArrayKey])) {
                 // Prepare blinding for all database connection types
                 foreach (array_keys($GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']) as $connectionName) {