diff --git a/Classes/Provider/BackendUserProvider.php b/Classes/Provider/BackendUserProvider.php new file mode 100644 index 0000000..7dd0612 --- /dev/null +++ b/Classes/Provider/BackendUserProvider.php @@ -0,0 +1,45 @@ + 0) { + $table = 'be_users'; + $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table); + + $users = []; + foreach ($backendUsers as $backendUser) { + $users[] = $queryBuilder->createNamedParameter($backendUser); + } + + $rows = $queryBuilder + ->select('username') + ->from($table) + ->where( + $queryBuilder->expr()->in('username', $users) + ) + ->execute() + ->fetchAll(); + + foreach ($rows as $backendUser) { + $data['backendUser'][] = $backendUser['username']; + } + }; + return $data; + } +} \ No newline at end of file diff --git a/Classes/Provider/ConfigurationProvider.php b/Classes/Provider/ConfigurationProvider.php new file mode 100644 index 0000000..b25fb93 --- /dev/null +++ b/Classes/Provider/ConfigurationProvider.php @@ -0,0 +1,60 @@ + [ + 'DB' => [ + 'database' => '******', + 'host' => '******', + 'password' => '******', + 'port' => '******', + 'socket' => '******', + 'username' => '******', + 'Connections' => [ + 'Default' => [ + 'dbname' => '******', + 'host' => '******', + 'password' => '******', + 'port' => '******', + 'user' => '******', + 'unix_socket' => '******', + ], + ], + ], + 'SYS' => [ + 'encryptionKey' => '******' + ] + ] + ]; + + public function get(array $data) + { + $configuration = $GLOBALS['TYPO3_CONF_VARS']; + ArrayUtility::mergeRecursiveWithOverrule( + $configuration, + ArrayUtility::intersectRecursive(self::$blindedConfigurationOptions['TYPO3_CONF_VARS'], $configuration) + ); + + $configurationValues = GeneralUtility::_GP('configurationValue'); + foreach ($configurationValues as $path) { + if (ArrayUtility::isValidPath($configuration, $path)) { + $data['configuration'][$path] = ArrayUtility::getValueByPath($configuration, $path); + } + } + + return $data; + } +} \ No newline at end of file diff --git a/ext_localconf.php b/ext_localconf.php index f3475db..78bef0c 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -17,6 +17,8 @@ if ($version >= 8) { $GLOBALS['TYPO3_CONF_VARS']['EXT']['t3monitoring_client']['provider'][] = 'T3Monitor\\T3monitoringClient\\Provider\\ServerInformation8xProvider'; + $GLOBALS['TYPO3_CONF_VARS']['EXT']['t3monitoring_client']['provider'][] = 'T3Monitor\\T3monitoringClient\\Provider\\ConfigurationProvider'; + $GLOBALS['TYPO3_CONF_VARS']['EXT']['t3monitoring_client']['provider'][] = 'T3Monitor\\T3monitoringClient\\Provider\\BackendUserProvider'; } else { $GLOBALS['TYPO3_CONF_VARS']['EXT']['t3monitoring_client']['provider'][] = 'T3Monitor\\T3monitoringClient\\Provider\\ServerInformationProvider'; }