first commit
This commit is contained in:
commit
1218dd1517
12716 files changed
+989233
No files matched your search
@@ -0,0 +1,288 @@
|
||||
<?php
|
||||
declare(strict_types = 1);
|
||||
namespace TYPO3\CMS\Reports\Controller;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use TYPO3\CMS\Backend\Routing\UriBuilder;
|
||||
use TYPO3\CMS\Backend\Template\ModuleTemplate;
|
||||
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
|
||||
use TYPO3\CMS\Core\Compatibility\PublicMethodDeprecationTrait;
|
||||
use TYPO3\CMS\Core\Http\HtmlResponse;
|
||||
use TYPO3\CMS\Core\Http\RedirectResponse;
|
||||
use TYPO3\CMS\Core\Localization\LanguageService;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Fluid\View\StandaloneView;
|
||||
use TYPO3\CMS\Reports\ReportInterface;
|
||||
use TYPO3\CMS\Reports\RequestAwareReportInterface;
|
||||
use TYPO3Fluid\Fluid\View\ViewInterface;
|
||||
|
||||
/**
|
||||
* Reports controller
|
||||
* @internal This class is a specific Backend controller implementation and is not considered part of the Public TYPO3 API.
|
||||
*/
|
||||
class ReportController
|
||||
{
|
||||
use PublicMethodDeprecationTrait;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $deprecatedPublicMethods = [
|
||||
'indexAction' => 'Using ReportController::indexAction() is deprecated and will not be possible anymore in TYPO3 v10.0.',
|
||||
'detailAction' => 'Using ReportController::detailAction() is deprecated and will not be possible anymore in TYPO3 v10.0.',
|
||||
];
|
||||
|
||||
/**
|
||||
* ModuleTemplate object
|
||||
*
|
||||
* @var ModuleTemplate
|
||||
*/
|
||||
protected $moduleTemplate;
|
||||
|
||||
/**
|
||||
* @var ViewInterface
|
||||
*/
|
||||
protected $view;
|
||||
|
||||
/**
|
||||
* Module name for the shortcut
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $shortcutName;
|
||||
|
||||
/**
|
||||
* Instantiate the report controller
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Injects the request object for the current request, and renders correct action
|
||||
*
|
||||
* @param ServerRequestInterface $request the current request
|
||||
* @return ResponseInterface the response with the content
|
||||
*/
|
||||
public function handleRequest(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
$action = $request->getQueryParams()['action'] ?? $request->getParsedBody()['action'] ?? '';
|
||||
$extension = $request->getQueryParams()['extension'] ?? $request->getParsedBody()['extension'];
|
||||
$isRedirect = $request->getQueryParams()['redirect'] ?? $request->getParsedBody()['redirect'] ?? false;
|
||||
|
||||
if ($action !== 'index' && !$isRedirect && !$extension
|
||||
&& is_array($GLOBALS['BE_USER']->uc['reports']['selection'])) {
|
||||
$previousSelection = $GLOBALS['BE_USER']->uc['reports']['selection'];
|
||||
if (!empty($previousSelection['extension']) && !empty($previousSelection['report'])) {
|
||||
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
|
||||
return new RedirectResponse((string)$uriBuilder->buildUriFromRoute('system_reports', [
|
||||
'action' => 'detail',
|
||||
'extension' => $previousSelection['extension'],
|
||||
'report' => $previousSelection['report'],
|
||||
'redirect' => 1,
|
||||
]), 303);
|
||||
}
|
||||
}
|
||||
if (empty($action)) {
|
||||
$action = 'index';
|
||||
}
|
||||
|
||||
$this->initializeView($action);
|
||||
|
||||
if ($action === 'index') {
|
||||
$this->indexAction();
|
||||
} elseif ($action === 'detail') {
|
||||
$response = $this->detailAction($request);
|
||||
if ($response instanceof ResponseInterface) {
|
||||
return $response;
|
||||
}
|
||||
} else {
|
||||
throw new \RuntimeException(
|
||||
'Reports module has only "index" and "detail" action, ' . (string)$action . ' given',
|
||||
1536322935
|
||||
);
|
||||
}
|
||||
|
||||
$this->generateMenu($request);
|
||||
$this->generateButtons();
|
||||
|
||||
$this->moduleTemplate->setContent($this->view->render());
|
||||
return new HtmlResponse($this->moduleTemplate->renderContent());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $templateName
|
||||
*/
|
||||
protected function initializeView(string $templateName)
|
||||
{
|
||||
$this->view = GeneralUtility::makeInstance(StandaloneView::class);
|
||||
$this->view->setTemplate($templateName);
|
||||
$this->view->setTemplateRootPaths(['EXT:reports/Resources/Private/Templates/Report']);
|
||||
$this->view->setPartialRootPaths(['EXT:reports/Resources/Private/Partials']);
|
||||
$this->view->setLayoutRootPaths(['EXT:reports/Resources/Private/Layouts']);
|
||||
$this->view->getRequest()->setControllerExtensionName('Reports');
|
||||
}
|
||||
|
||||
/**
|
||||
* Overview
|
||||
*/
|
||||
protected function indexAction()
|
||||
{
|
||||
$this->view->assign('reports', $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']);
|
||||
$this->saveState();
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a single report
|
||||
*
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface|null
|
||||
*/
|
||||
protected function detailAction(ServerRequestInterface $request)
|
||||
{
|
||||
$content = $error = '';
|
||||
$extension = $request->getQueryParams()['extension'] ?? $request->getParsedBody()['extension'];
|
||||
$report = $request->getQueryParams()['report'] ?? $request->getParsedBody()['report'];
|
||||
|
||||
$reportClass = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'][$extension][$report]['report'] ?? null;
|
||||
|
||||
if ($reportClass === null || !class_exists($reportClass)) {
|
||||
$this->resetState();
|
||||
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
|
||||
return new RedirectResponse((string)$uriBuilder->buildUriFromRoute('system_reports', [
|
||||
'action' => 'index',
|
||||
'redirect' => 1,
|
||||
]), 303);
|
||||
}
|
||||
|
||||
$reportInstance = GeneralUtility::makeInstance($reportClass, $this);
|
||||
|
||||
if ($reportInstance instanceof ReportInterface) {
|
||||
if ($reportInstance instanceof RequestAwareReportInterface) {
|
||||
$content = $reportInstance->getReport($request);
|
||||
} else {
|
||||
$content = $reportInstance->getReport();
|
||||
}
|
||||
$this->saveState($extension, $report);
|
||||
} else {
|
||||
$error = $reportClass . ' does not implement the Report Interface which is necessary to be displayed here.';
|
||||
}
|
||||
|
||||
$this->view->assignMultiple([
|
||||
'content' => $content,
|
||||
'error' => $error,
|
||||
'report' => $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'][$extension][$report],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the menu
|
||||
*
|
||||
* @param ServerRequestInterface $request
|
||||
*/
|
||||
protected function generateMenu(ServerRequestInterface $request)
|
||||
{
|
||||
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
|
||||
$lang = $this->getLanguageService();
|
||||
$lang->includeLLFile('EXT:reports/Resources/Private/Language/locallang.xlf');
|
||||
$menu = $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
|
||||
$menu->setIdentifier('WebFuncJumpMenu');
|
||||
$menuItem = $menu
|
||||
->makeMenuItem()
|
||||
->setHref(
|
||||
$uriBuilder->buildUriFromRoute('system_reports', ['action' => 'index'])
|
||||
)
|
||||
->setTitle($lang->getLL('reports_overview'));
|
||||
$menu->addMenuItem($menuItem);
|
||||
$this->shortcutName = $lang->getLL('reports_overview');
|
||||
|
||||
$extensionParam = $request->getQueryParams()['extension'] ?? $request->getParsedBody()['extension'];
|
||||
$reportParam = $request->getQueryParams()['report'] ?? $request->getParsedBody()['report'];
|
||||
|
||||
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports'] as $extKey => $reports) {
|
||||
foreach ($reports as $reportName => $report) {
|
||||
$menuItem = $menu
|
||||
->makeMenuItem()
|
||||
->setHref($uriBuilder->buildUriFromRoute(
|
||||
'system_reports',
|
||||
['action' => 'detail', 'extension' => $extKey, 'report' => $reportName]
|
||||
))
|
||||
->setTitle($this->getLanguageService()->sL($report['title']));
|
||||
if ($extensionParam === $extKey && $reportParam === $reportName) {
|
||||
$menuItem->setActive(true);
|
||||
$this->shortcutName = $menuItem->getTitle();
|
||||
}
|
||||
$menu->addMenuItem($menuItem);
|
||||
}
|
||||
}
|
||||
$this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->addMenu($menu);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all buttons for the docHeader
|
||||
*/
|
||||
protected function generateButtons()
|
||||
{
|
||||
$buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
|
||||
|
||||
$shortcutButton = $buttonBar->makeShortcutButton()
|
||||
->setModuleName('system_reports')
|
||||
->setGetVariables(['action', 'extension', 'report'])
|
||||
->setDisplayName($this->shortcutName);
|
||||
$buttonBar->addButton($shortcutButton);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the selected report
|
||||
*
|
||||
* @param string $extension Extension name
|
||||
* @param string $report Report name
|
||||
*/
|
||||
protected function saveState(string $extension = '', string $report = '')
|
||||
{
|
||||
$this->getBackendUser()->uc['reports']['selection'] = [
|
||||
'extension' => $extension,
|
||||
'report' => $report,
|
||||
];
|
||||
$this->getBackendUser()->writeUC();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset state in user settings
|
||||
*/
|
||||
protected function resetState(): void
|
||||
{
|
||||
$this->getBackendUser()->uc['reports']['selection'] = [];
|
||||
$this->getBackendUser()->writeUC();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BackendUserAuthentication
|
||||
*/
|
||||
protected function getBackendUser(): BackendUserAuthentication
|
||||
{
|
||||
return $GLOBALS['BE_USER'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return LanguageService
|
||||
*/
|
||||
protected function getLanguageService(): LanguageService
|
||||
{
|
||||
return $GLOBALS['LANG'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Reports;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
/**
|
||||
* Interface for classes which provide a status report entry.
|
||||
*/
|
||||
interface ExtendedStatusProviderInterface
|
||||
{
|
||||
/**
|
||||
* Returns the detailed status of an extension or (sub)system
|
||||
*
|
||||
* @return \TYPO3\CMS\Reports\Status[]
|
||||
*/
|
||||
public function getDetailedStatus();
|
||||
}
|
||||
@@ -0,0 +1,239 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Reports\Report;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Core\Exception;
|
||||
use TYPO3\CMS\Core\Utility\CommandUtility;
|
||||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Fluid\View\StandaloneView;
|
||||
use TYPO3\CMS\Reports\Controller\ReportController;
|
||||
use TYPO3\CMS\Reports\ReportInterface;
|
||||
|
||||
/**
|
||||
* This class provides a report displaying a list of all installed services
|
||||
*/
|
||||
class ServicesListReport implements ReportInterface
|
||||
{
|
||||
/**
|
||||
* @var ReportController
|
||||
*/
|
||||
protected $reportsModule;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param ReportController $reportsModule Back-reference to the calling reports module
|
||||
*/
|
||||
public function __construct(ReportController $reportsModule)
|
||||
{
|
||||
$this->reportsModule = $reportsModule;
|
||||
$this->getLanguageService()->includeLLFile('EXT:reports/Resources/Private/Language/locallang_servicereport.xlf');
|
||||
}
|
||||
|
||||
/**
|
||||
* This method renders the report
|
||||
*
|
||||
* @return string The status report as HTML
|
||||
*/
|
||||
public function getReport()
|
||||
{
|
||||
// Rendering of the output via fluid
|
||||
$view = GeneralUtility::makeInstance(StandaloneView::class);
|
||||
$view->getRequest()->setControllerExtensionName('Reports');
|
||||
$view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName(
|
||||
'EXT:reports/Resources/Private/Templates/ServicesListReport.html'
|
||||
));
|
||||
|
||||
$view->assignMultiple([
|
||||
'servicesList' => $this->getServicesList(),
|
||||
'searchPaths' => $this->getExecutablesSearchPathList()
|
||||
]);
|
||||
|
||||
return $view->render();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method assembles a list of all installed services
|
||||
*
|
||||
* @return array with data to display
|
||||
*/
|
||||
protected function getServicesList()
|
||||
{
|
||||
$servicesList = [];
|
||||
$services = $this->getInstalledServices();
|
||||
foreach ($services as $serviceType => $installedServices) {
|
||||
$servicesList[] = $this->getServiceTypeList($serviceType, $installedServices);
|
||||
}
|
||||
return $servicesList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the services list for a single service type.
|
||||
*
|
||||
* @param string $serviceType The service type to render the installed services list for
|
||||
* @param array $services List of services for the given type
|
||||
* @return array Service list as array for one service type
|
||||
*/
|
||||
protected function getServiceTypeList($serviceType, $services)
|
||||
{
|
||||
$lang = $this->getLanguageService();
|
||||
$serviceList = [];
|
||||
$serviceList['Type'] = sprintf($lang->getLL('service_type'), $serviceType);
|
||||
|
||||
$serviceList['Services'] = [];
|
||||
foreach ($services as $serviceKey => $serviceInformation) {
|
||||
$serviceList['Services'][] = $this->getServiceRow($serviceKey, $serviceInformation);
|
||||
}
|
||||
|
||||
return $serviceList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get data of a single service's row.
|
||||
*
|
||||
* @param string $serviceKey The service key to access the service.
|
||||
* @param array $serviceInformation registration information of the service.
|
||||
* @return array data for one row for the service.
|
||||
*/
|
||||
protected function getServiceRow($serviceKey, $serviceInformation)
|
||||
{
|
||||
$result = [
|
||||
'Key' => $serviceKey,
|
||||
'Information' => $serviceInformation,
|
||||
'Subtypes' => $serviceInformation['serviceSubTypes'] ? implode(', ', $serviceInformation['serviceSubTypes']) : '-',
|
||||
'OperatingSystem' => $serviceInformation['os'] ?: $this->getLanguageService()->getLL('any'),
|
||||
'RequiredExecutables' => $serviceInformation['exec'] ?: '-',
|
||||
'AvailabilityClass' => 'danger',
|
||||
'Available' => $this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:no'),
|
||||
];
|
||||
|
||||
try {
|
||||
$serviceDetails = ExtensionManagementUtility::findServiceByKey($serviceKey);
|
||||
if ($serviceDetails['available']) {
|
||||
$result['AvailabilityClass'] = 'success';
|
||||
$result['Available'] = $this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:yes');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method assembles a list of all defined executables search paths
|
||||
*
|
||||
* @return array data to display
|
||||
*/
|
||||
protected function getExecutablesSearchPathList()
|
||||
{
|
||||
$searchPaths = CommandUtility::getPaths(true);
|
||||
$result = [];
|
||||
|
||||
foreach ($searchPaths as $path => $isValid) {
|
||||
$searchPathData = $this->getServicePathStatus($isValid);
|
||||
$result[] = [
|
||||
'class' => $searchPathData['statusCSSClass'],
|
||||
'accessible' => 'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:' . $searchPathData['accessible'],
|
||||
'path' => GeneralUtility::fixWindowsFilePath($path),
|
||||
];
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method filters the $T3_SERVICES global array to return a relevant,
|
||||
* ordered list of installed services.
|
||||
*
|
||||
* Every installed service appears twice in $T3_SERVICES: once as a service key
|
||||
* for a given service type, and once a service type all by itself
|
||||
* The list of services to display must avoid these duplicates
|
||||
*
|
||||
* Furthermore, inside each service type, installed services must be
|
||||
* ordered by priority and quality
|
||||
*
|
||||
* @return array List of filtered and ordered services
|
||||
*/
|
||||
protected function getInstalledServices()
|
||||
{
|
||||
$filteredServices = [];
|
||||
foreach ($GLOBALS['T3_SERVICES'] as $serviceType => $serviceList) {
|
||||
// If the (first) key of the service list is not the same as the service type,
|
||||
// it's a "true" service type. Keep it and sort it.
|
||||
if (key($serviceList) !== $serviceType) {
|
||||
uasort($serviceList, [$this, 'sortServices']);
|
||||
$filteredServices[$serviceType] = $serviceList;
|
||||
}
|
||||
}
|
||||
return $filteredServices;
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method used to sort services according to their priority and
|
||||
* quality.
|
||||
*
|
||||
* @param array $a First service to compare
|
||||
* @param array $b Second service to compare
|
||||
* @return int 1, 0 or -1 if $a is smaller, equal or greater than $b, respectively
|
||||
*/
|
||||
protected function sortServices(array $a, array $b)
|
||||
{
|
||||
$result = 0;
|
||||
// If priorities are the same, test quality
|
||||
if ($a['priority'] === $b['priority']) {
|
||||
if ($a['quality'] !== $b['quality']) {
|
||||
// Service with highest quality should come first,
|
||||
// thus it must be marked as smaller
|
||||
$result = $a['quality'] > $b['quality'] ? -1 : 1;
|
||||
}
|
||||
} else {
|
||||
// Service with highest priority should come first,
|
||||
// thus it must be marked as smaller
|
||||
$result = $a['priority'] > $b['priority'] ? -1 : 1;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to check if the service in path is available
|
||||
* @param bool|string $isValid
|
||||
* @return array
|
||||
*/
|
||||
private function getServicePathStatus($isValid): array
|
||||
{
|
||||
$statusCSSClass = 'danger';
|
||||
$accessible = 'no';
|
||||
|
||||
if ($isValid) {
|
||||
$statusCSSClass = 'success';
|
||||
$accessible = 'yes';
|
||||
}
|
||||
return [
|
||||
'statusCSSClass' => $statusCSSClass,
|
||||
'accessible' => $accessible
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns LanguageService
|
||||
*
|
||||
* @return \TYPO3\CMS\Core\Localization\LanguageService
|
||||
*/
|
||||
protected function getLanguageService()
|
||||
{
|
||||
return $GLOBALS['LANG'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,344 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Reports\Report\Status;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Backend\Utility\BackendUtility;
|
||||
use TYPO3\CMS\Core\Core\Environment;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
|
||||
use TYPO3\CMS\Core\Localization\LanguageService;
|
||||
use TYPO3\CMS\Core\Registry;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Reports\Status as ReportStatus;
|
||||
use TYPO3\CMS\Reports\StatusProviderInterface;
|
||||
|
||||
/**
|
||||
* Performs some checks about the install tool protection status
|
||||
*/
|
||||
class ConfigurationStatus implements StatusProviderInterface
|
||||
{
|
||||
/**
|
||||
* Determines the Install Tool's status, mainly concerning its protection.
|
||||
*
|
||||
* @return array List of statuses
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
$statuses = [
|
||||
'emptyReferenceIndex' => $this->getReferenceIndexStatus(),
|
||||
];
|
||||
if ($this->isMemcachedUsed()) {
|
||||
$statuses['memcachedConnection'] = $this->getMemcachedConnectionStatus();
|
||||
}
|
||||
if (!Environment::isWindows()) {
|
||||
$statuses['createdFilesWorldWritable'] = $this->getCreatedFilesWorldWritableStatus();
|
||||
$statuses['createdDirectoriesWorldWritable'] = $this->getCreatedDirectoriesWorldWritableStatus();
|
||||
}
|
||||
if ($this->isMysqlUsed()) {
|
||||
$statuses['mysqlDatabaseUsesUtf8'] = $this->getMysqlDatabaseUtf8Status();
|
||||
}
|
||||
return $statuses;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if sys_refindex is empty.
|
||||
*
|
||||
* @return \TYPO3\CMS\Reports\Status An object representing whether the reference index is empty or not
|
||||
*/
|
||||
protected function getReferenceIndexStatus()
|
||||
{
|
||||
$value = $this->getLanguageService()->getLL('status_ok');
|
||||
$message = '';
|
||||
$severity = ReportStatus::OK;
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_refindex');
|
||||
$count = $queryBuilder
|
||||
->count('*')
|
||||
->from('sys_refindex')
|
||||
->execute()
|
||||
->fetchColumn(0);
|
||||
|
||||
$registry = GeneralUtility::makeInstance(Registry::class);
|
||||
$lastRefIndexUpdate = $registry->get('core', 'sys_refindex_lastUpdate');
|
||||
/** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
|
||||
$uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
|
||||
if (!$count && $lastRefIndexUpdate) {
|
||||
$value = $this->getLanguageService()->getLL('status_empty');
|
||||
$severity = ReportStatus::WARNING;
|
||||
$url = (string)$uriBuilder->buildUriFromRoute('system_dbint') . '&id=0&SET[function]=refindex';
|
||||
$message = sprintf($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:warning.backend_reference_index'), '<a href="' . htmlspecialchars($url) . '">', '</a>', BackendUtility::datetime($lastRefIndexUpdate));
|
||||
}
|
||||
return GeneralUtility::makeInstance(ReportStatus::class, $this->getLanguageService()->getLL('status_referenceIndex'), $value, $message, $severity);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether memcached is configured, if that's the case we assume it's also used.
|
||||
*
|
||||
* @return bool TRUE if memcached is used, FALSE otherwise.
|
||||
*/
|
||||
protected function isMemcachedUsed()
|
||||
{
|
||||
$memcachedUsed = false;
|
||||
$memcachedServers = $this->getConfiguredMemcachedServers();
|
||||
if (!empty($memcachedServers)) {
|
||||
$memcachedUsed = true;
|
||||
}
|
||||
return $memcachedUsed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the configured memcached server connections.
|
||||
*
|
||||
* @return array An array of configured memcached server connections.
|
||||
*/
|
||||
protected function getConfiguredMemcachedServers()
|
||||
{
|
||||
$configurations = $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'] ?? [];
|
||||
$memcachedServers = [];
|
||||
foreach ($configurations as $table => $conf) {
|
||||
if (is_array($conf)) {
|
||||
foreach ($conf as $key => $value) {
|
||||
if ($value === \TYPO3\CMS\Core\Cache\Backend\MemcachedBackend::class) {
|
||||
$memcachedServers = $configurations[$table]['options']['servers'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $memcachedServers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether TYPO3 can connect to the configured memcached servers.
|
||||
*
|
||||
* @return \TYPO3\CMS\Reports\Status An object representing whether TYPO3 can connect to the configured memcached servers
|
||||
*/
|
||||
protected function getMemcachedConnectionStatus()
|
||||
{
|
||||
$value = $this->getLanguageService()->getLL('status_ok');
|
||||
$message = '';
|
||||
$severity = ReportStatus::OK;
|
||||
$failedConnections = [];
|
||||
$defaultMemcachedPort = ini_get('memcache.default_port');
|
||||
$memcachedServers = $this->getConfiguredMemcachedServers();
|
||||
if (function_exists('memcache_connect') && is_array($memcachedServers)) {
|
||||
foreach ($memcachedServers as $testServer) {
|
||||
$configuredServer = $testServer;
|
||||
if (strpos($testServer, 'unix://') === 0) {
|
||||
$host = $testServer;
|
||||
$port = 0;
|
||||
} else {
|
||||
if (strpos($testServer, 'tcp://') === 0) {
|
||||
$testServer = substr($testServer, 6);
|
||||
}
|
||||
if (strstr($testServer, ':') !== false) {
|
||||
list($host, $port) = explode(':', $testServer, 2);
|
||||
} else {
|
||||
$host = $testServer;
|
||||
$port = $defaultMemcachedPort;
|
||||
}
|
||||
}
|
||||
$memcachedConnection = @memcache_connect($host, $port);
|
||||
if ($memcachedConnection != null) {
|
||||
memcache_close();
|
||||
} else {
|
||||
$failedConnections[] = $configuredServer;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($failedConnections)) {
|
||||
$value = $this->getLanguageService()->getLL('status_connectionFailed');
|
||||
$severity = ReportStatus::WARNING;
|
||||
$message = $this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:warning.memcache_not_usable') . '<br /><br />' . '<ul><li>' . implode('</li><li>', $failedConnections) . '</li></ul>';
|
||||
}
|
||||
return GeneralUtility::makeInstance(ReportStatus::class, $this->getLanguageService()->getLL('status_memcachedConfiguration'), $value, $message, $severity);
|
||||
}
|
||||
|
||||
/**
|
||||
* Warning, if fileCreateMask has write bit for 'others' set.
|
||||
*
|
||||
* @return \TYPO3\CMS\Reports\Status The writable status for 'others'
|
||||
*/
|
||||
protected function getCreatedFilesWorldWritableStatus()
|
||||
{
|
||||
$value = $this->getLanguageService()->getLL('status_ok');
|
||||
$message = '';
|
||||
$severity = ReportStatus::OK;
|
||||
if ((int)$GLOBALS['TYPO3_CONF_VARS']['SYS']['fileCreateMask'] % 10 & 2) {
|
||||
$value = $GLOBALS['TYPO3_CONF_VARS']['SYS']['fileCreateMask'];
|
||||
$severity = ReportStatus::WARNING;
|
||||
$message = $this->getLanguageService()->getLL('status_CreatedFilePermissions.writable');
|
||||
}
|
||||
return GeneralUtility::makeInstance(ReportStatus::class, $this->getLanguageService()->getLL('status_CreatedFilePermissions'), $value, $message, $severity);
|
||||
}
|
||||
|
||||
/**
|
||||
* Warning, if folderCreateMask has write bit for 'others' set.
|
||||
*
|
||||
* @return \TYPO3\CMS\Reports\Status The writable status for 'others'
|
||||
*/
|
||||
protected function getCreatedDirectoriesWorldWritableStatus()
|
||||
{
|
||||
$value = $this->getLanguageService()->getLL('status_ok');
|
||||
$message = '';
|
||||
$severity = ReportStatus::OK;
|
||||
if ((int)$GLOBALS['TYPO3_CONF_VARS']['SYS']['folderCreateMask'] % 10 & 2) {
|
||||
$value = $GLOBALS['TYPO3_CONF_VARS']['SYS']['folderCreateMask'];
|
||||
$severity = ReportStatus::WARNING;
|
||||
$message = $this->getLanguageService()->getLL('status_CreatedDirectoryPermissions.writable');
|
||||
}
|
||||
return GeneralUtility::makeInstance(ReportStatus::class, $this->getLanguageService()->getLL('status_CreatedDirectoryPermissions'), $value, $message, $severity);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the default connection is a MySQL compatible database instance.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function isMysqlUsed()
|
||||
{
|
||||
$connection = GeneralUtility::makeInstance(ConnectionPool::class)
|
||||
->getConnectionByName(ConnectionPool::DEFAULT_CONNECTION_NAME);
|
||||
|
||||
return strpos($connection->getServerVersion(), 'MySQL') === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the character set of the default database and reports an error if it is not utf-8.
|
||||
*
|
||||
* @return ReportStatus
|
||||
*/
|
||||
protected function getMysqlDatabaseUtf8Status()
|
||||
{
|
||||
$connection = GeneralUtility::makeInstance(ConnectionPool::class)
|
||||
->getConnectionByName(ConnectionPool::DEFAULT_CONNECTION_NAME);
|
||||
/** @var QueryBuilder $queryBuilder */
|
||||
$queryBuilder = $connection->createQueryBuilder();
|
||||
$defaultDatabaseCharset = (string)$queryBuilder->select('DEFAULT_CHARACTER_SET_NAME')
|
||||
->from('information_schema.SCHEMATA')
|
||||
->where(
|
||||
$queryBuilder->expr()->eq(
|
||||
'SCHEMA_NAME',
|
||||
$queryBuilder->createNamedParameter($connection->getDatabase(), \PDO::PARAM_STR)
|
||||
)
|
||||
)
|
||||
->setMaxResults(1)
|
||||
->execute()
|
||||
->fetchColumn();
|
||||
|
||||
$severity = ReportStatus::OK;
|
||||
$statusValue = $this->getLanguageService()->getLL('status_ok');
|
||||
// also allow utf8mb4
|
||||
if (strpos($defaultDatabaseCharset, 'utf8') !== 0) {
|
||||
// If the default character set is e.g. latin1, BUT all tables in the system are UTF-8,
|
||||
// we assume that TYPO3 has the correct charset for adding tables, and everything is fine
|
||||
$queryBuilder = $connection->createQueryBuilder();
|
||||
$nonUtf8TableCollationsFound = $queryBuilder->select('table_collation')
|
||||
->from('information_schema.tables')
|
||||
->where(
|
||||
$queryBuilder->expr()->andX(
|
||||
$queryBuilder->expr()->eq('table_schema', $queryBuilder->quote($connection->getDatabase())),
|
||||
$queryBuilder->expr()->notLike('table_collation', $queryBuilder->quote('utf8%'))
|
||||
)
|
||||
)
|
||||
->setMaxResults(1)
|
||||
->execute();
|
||||
|
||||
if ($nonUtf8TableCollationsFound->rowCount() > 0) {
|
||||
$message = sprintf($this->getLanguageService()
|
||||
->getLL('status_MysqlDatabaseCharacterSet_Unsupported'), $defaultDatabaseCharset);
|
||||
$severity = ReportStatus::ERROR;
|
||||
$statusValue = $this->getLanguageService()->getLL('status_wrongValue');
|
||||
} else {
|
||||
$message = $this->getLanguageService()->getLL('status_MysqlDatabaseCharacterSet_Info');
|
||||
$severity = ReportStatus::INFO;
|
||||
$statusValue = $this->getLanguageService()->getLL('status_info');
|
||||
}
|
||||
} elseif (isset($GLOBALS['TYPO3_CONF_VARS']['DB']['Connections'][ConnectionPool::DEFAULT_CONNECTION_NAME]['tableoptions'])) {
|
||||
$message = $this->getLanguageService()->getLL('status_MysqlDatabaseCharacterSet_Ok');
|
||||
|
||||
$tableOptions = $GLOBALS['TYPO3_CONF_VARS']['DB']['Connections'][ConnectionPool::DEFAULT_CONNECTION_NAME]['tableoptions'];
|
||||
if (isset($tableOptions['collate'])) {
|
||||
$collationConstraint = $queryBuilder->expr()->neq('table_collation', $queryBuilder->quote($tableOptions['collate']));
|
||||
$charset = $tableOptions['collate'];
|
||||
} elseif (isset($tableOptions['charset'])) {
|
||||
$collationConstraint = $queryBuilder->expr()->notLike('table_collation', $queryBuilder->quote($tableOptions['charset'] . '%'));
|
||||
$charset = $tableOptions['charset'];
|
||||
}
|
||||
|
||||
if (isset($collationConstraint)) {
|
||||
$queryBuilder = $connection->createQueryBuilder();
|
||||
$wrongCollationTablesFound = $queryBuilder->select('table_collation')
|
||||
->from('information_schema.tables')
|
||||
->where(
|
||||
$queryBuilder->expr()->andX(
|
||||
$queryBuilder->expr()->eq('table_schema', $queryBuilder->quote($connection->getDatabase())),
|
||||
$collationConstraint
|
||||
)
|
||||
)
|
||||
->setMaxResults(1)
|
||||
->execute();
|
||||
|
||||
if ($wrongCollationTablesFound->rowCount() > 0) {
|
||||
$message = sprintf($this->getLanguageService()->getLL('status_MysqlDatabaseCharacterSet_MixedCollations'), $charset);
|
||||
$severity = ReportStatus::ERROR;
|
||||
$statusValue = $this->getLanguageService()->getLL('status_checkFailed');
|
||||
} else {
|
||||
if (isset($tableOptions['collate'])) {
|
||||
$collationConstraint = $queryBuilder->expr()->neq('collation_name', $queryBuilder->quote($tableOptions['collate']));
|
||||
} elseif (isset($tableOptions['charset'])) {
|
||||
$collationConstraint = $queryBuilder->expr()->notLike('collation_name', $queryBuilder->quote($tableOptions['charset'] . '%'));
|
||||
}
|
||||
|
||||
$queryBuilder = $connection->createQueryBuilder();
|
||||
$wrongCollationColumnsFound = $queryBuilder->select('collation_name')
|
||||
->from('information_schema.columns')
|
||||
->where(
|
||||
$queryBuilder->expr()->andX(
|
||||
$queryBuilder->expr()->eq('table_schema', $queryBuilder->quote($connection->getDatabase())),
|
||||
$collationConstraint
|
||||
)
|
||||
)
|
||||
->setMaxResults(1)
|
||||
->execute();
|
||||
|
||||
if ($wrongCollationColumnsFound->rowCount() > 0) {
|
||||
$message = sprintf($this->getLanguageService()->getLL('status_MysqlDatabaseCharacterSet_MixedCollations'), $charset);
|
||||
$severity = ReportStatus::ERROR;
|
||||
$statusValue = $this->getLanguageService()->getLL('status_checkFailed');
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$message = $this->getLanguageService()->getLL('status_MysqlDatabaseCharacterSet_Ok');
|
||||
}
|
||||
|
||||
return GeneralUtility::makeInstance(
|
||||
ReportStatus::class,
|
||||
$this->getLanguageService()->getLL('status_MysqlDatabaseCharacterSet'),
|
||||
$statusValue,
|
||||
$message,
|
||||
$severity
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return LanguageService
|
||||
*/
|
||||
protected function getLanguageService()
|
||||
{
|
||||
return $GLOBALS['LANG'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Reports\Report\Status;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Core\Database\Connection;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Localization\LanguageService;
|
||||
use TYPO3\CMS\Core\Resource\StorageRepository;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Reports\Status as ReportStatus;
|
||||
use TYPO3\CMS\Reports\StatusProviderInterface;
|
||||
|
||||
/**
|
||||
* Performs several checks about the FAL status
|
||||
*/
|
||||
class FalStatus implements StatusProviderInterface
|
||||
{
|
||||
/**
|
||||
* Determines the status of the FAL index.
|
||||
*
|
||||
* @return array List of statuses
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
$statuses = [
|
||||
'MissingFiles' => $this->getMissingFilesStatus(),
|
||||
];
|
||||
return $statuses;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if there are files marked as missed.
|
||||
*
|
||||
* @return \TYPO3\CMS\Reports\Status An object representing whether there are files marked as missed or not
|
||||
*/
|
||||
protected function getMissingFilesStatus()
|
||||
{
|
||||
$value = $this->getLanguageService()->getLL('status_none');
|
||||
$count = 0;
|
||||
$maxFilesToShow = 100;
|
||||
$message = '';
|
||||
$severity = ReportStatus::OK;
|
||||
|
||||
/** @var StorageRepository $storageRepository */
|
||||
$storageRepository = GeneralUtility::makeInstance(StorageRepository::class);
|
||||
$storageObjects = $storageRepository->findAll();
|
||||
$storages = [];
|
||||
|
||||
/** @var \TYPO3\CMS\Core\Resource\ResourceStorage $storageObject */
|
||||
foreach ($storageObjects as $storageObject) {
|
||||
|
||||
// We only check missing files for storages that are online
|
||||
if ($storageObject->isOnline()) {
|
||||
$storages[$storageObject->getUid()] = $storageObject;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($storages)) {
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_file');
|
||||
|
||||
$count = $queryBuilder
|
||||
->count('*')
|
||||
->from('sys_file')
|
||||
->where(
|
||||
$queryBuilder->expr()->eq(
|
||||
'missing',
|
||||
$queryBuilder->createNamedParameter(1, \PDO::PARAM_INT)
|
||||
),
|
||||
$queryBuilder->expr()->in(
|
||||
'storage',
|
||||
$queryBuilder->createNamedParameter(array_keys($storages), Connection::PARAM_INT_ARRAY)
|
||||
)
|
||||
)
|
||||
->execute()
|
||||
->fetchColumn(0);
|
||||
}
|
||||
|
||||
if ($count) {
|
||||
$value = sprintf($this->getLanguageService()->getLL('status_missingFilesCount'), $count);
|
||||
$severity = ReportStatus::WARNING;
|
||||
|
||||
$queryBuilder->resetQueryParts();
|
||||
$files = $queryBuilder
|
||||
->select('identifier', 'storage')
|
||||
->from('sys_file')
|
||||
->where(
|
||||
$queryBuilder->expr()->eq(
|
||||
'missing',
|
||||
$queryBuilder->createNamedParameter(1, \PDO::PARAM_INT)
|
||||
),
|
||||
$queryBuilder->expr()->in(
|
||||
'storage',
|
||||
$queryBuilder->createNamedParameter(array_keys($storages), Connection::PARAM_INT_ARRAY)
|
||||
)
|
||||
)
|
||||
->setMaxResults($maxFilesToShow)
|
||||
->execute()
|
||||
->fetchAll();
|
||||
|
||||
$message = '<p>' . $this->getLanguageService()->getLL('status_missingFilesMessage') . '</p>';
|
||||
foreach ($files as $file) {
|
||||
$message .= $storages[$file['storage']]->getName() . ' ' . $file['identifier'] . '<br />';
|
||||
}
|
||||
|
||||
if ($count > $maxFilesToShow) {
|
||||
$message .= '...<br />';
|
||||
}
|
||||
}
|
||||
|
||||
return GeneralUtility::makeInstance(ReportStatus::class, $this->getLanguageService()->getLL('status_missingFiles'), $value, $message, $severity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return LanguageService
|
||||
*/
|
||||
protected function getLanguageService()
|
||||
{
|
||||
return $GLOBALS['LANG'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,248 @@
|
||||
<?php
|
||||
declare(strict_types = 1);
|
||||
namespace TYPO3\CMS\Reports\Report\Status;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use TYPO3\CMS\Backend\Routing\UriBuilder;
|
||||
use TYPO3\CMS\Core\Crypto\PasswordHashing\InvalidPasswordHashException;
|
||||
use TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashFactory;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
|
||||
use TYPO3\CMS\Core\Localization\LanguageService;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Reports\RequestAwareStatusProviderInterface;
|
||||
use TYPO3\CMS\Reports\Status as ReportStatus;
|
||||
|
||||
/**
|
||||
* Performs several checks about the system's health
|
||||
*/
|
||||
class SecurityStatus implements RequestAwareStatusProviderInterface
|
||||
{
|
||||
/**
|
||||
* @var ServerRequestInterface
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* Determines the security of this TYPO3 installation
|
||||
*
|
||||
* @param ServerRequestInterface|null $request
|
||||
* @return ReportStatus[] List of statuses
|
||||
*/
|
||||
public function getStatus(ServerRequestInterface $request = null)
|
||||
{
|
||||
$statuses = [
|
||||
'trustedHostsPattern' => $this->getTrustedHostsPatternStatus(),
|
||||
'adminUserAccount' => $this->getAdminAccountStatus(),
|
||||
'fileDenyPattern' => $this->getFileDenyPatternStatus(),
|
||||
'htaccessUpload' => $this->getHtaccessUploadStatus(),
|
||||
];
|
||||
|
||||
if ($request !== null) {
|
||||
$statuses['encryptedConnectionStatus'] = $this->getEncryptedConnectionStatus($request);
|
||||
$lockSslStatus = $this->getLockSslStatus($request);
|
||||
if ($lockSslStatus) {
|
||||
$statuses['getLockSslStatus'] = $lockSslStatus;
|
||||
}
|
||||
}
|
||||
|
||||
return $statuses;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the current connection is encrypted (HTTPS)
|
||||
*
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ReportStatus
|
||||
*/
|
||||
protected function getEncryptedConnectionStatus(ServerRequestInterface $request): ReportStatus
|
||||
{
|
||||
$value = $this->getLanguageService()->getLL('status_ok');
|
||||
$message = '';
|
||||
$severity = ReportStatus::OK;
|
||||
|
||||
/** @var \TYPO3\CMS\Core\Http\NormalizedParams $normalizedParams */
|
||||
$normalizedParams = $request->getAttribute('normalizedParams');
|
||||
|
||||
if (!$normalizedParams->isHttps()) {
|
||||
$value = $this->getLanguageService()->getLL('status_insecure');
|
||||
$severity = ReportStatus::WARNING;
|
||||
$message = $this->getLanguageService()->sL('LLL:EXT:reports/Resources/Private/Language/locallang_reports.xlf:status_encryptedConnectionStatus_insecure');
|
||||
}
|
||||
|
||||
return GeneralUtility::makeInstance(ReportStatus::class, $this->getLanguageService()->getLL('status_encryptedConnectionStatus'), $value, $message, $severity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ReportStatus
|
||||
*/
|
||||
protected function getLockSslStatus(ServerRequestInterface $request): ?ReportStatus
|
||||
{
|
||||
/** @var \TYPO3\CMS\Core\Http\NormalizedParams $normalizedParams */
|
||||
$normalizedParams = $request->getAttribute('normalizedParams');
|
||||
|
||||
if ($normalizedParams->isHttps()) {
|
||||
$value = $this->getLanguageService()->getLL('status_ok');
|
||||
$message = '';
|
||||
$severity = ReportStatus::OK;
|
||||
|
||||
if (!$GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL']) {
|
||||
$value = $this->getLanguageService()->getLL('status_insecure');
|
||||
$message = $this->getLanguageService()->getLL('status_lockSslStatus_insecure');
|
||||
$severity = ReportStatus::WARNING;
|
||||
}
|
||||
|
||||
return GeneralUtility::makeInstance(ReportStatus::class, $this->getLanguageService()->getLL('status_lockSslStatus'), $value, $message, $severity);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the trusted hosts pattern check is disabled.
|
||||
*
|
||||
* @return ReportStatus An object representing whether the check is disabled
|
||||
*/
|
||||
protected function getTrustedHostsPatternStatus(): ReportStatus
|
||||
{
|
||||
$value = $this->getLanguageService()->getLL('status_ok');
|
||||
$message = '';
|
||||
$severity = ReportStatus::OK;
|
||||
|
||||
if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] === GeneralUtility::ENV_TRUSTED_HOSTS_PATTERN_ALLOW_ALL) {
|
||||
$value = $this->getLanguageService()->getLL('status_insecure');
|
||||
$severity = ReportStatus::ERROR;
|
||||
$message = $this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:warning.install_trustedhosts');
|
||||
}
|
||||
|
||||
return GeneralUtility::makeInstance(ReportStatus::class, $this->getLanguageService()->getLL('status_trustedHostsPattern'), $value, $message, $severity);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether a BE user account named admin with default password exists.
|
||||
*
|
||||
* @return ReportStatus An object representing whether a default admin account exists
|
||||
*/
|
||||
protected function getAdminAccountStatus(): ReportStatus
|
||||
{
|
||||
$value = $this->getLanguageService()->getLL('status_ok');
|
||||
$message = '';
|
||||
$severity = ReportStatus::OK;
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('be_users');
|
||||
$queryBuilder->getRestrictions()
|
||||
->removeAll()
|
||||
->add(GeneralUtility::makeInstance(DeletedRestriction::class));
|
||||
|
||||
$row = $queryBuilder
|
||||
->select('uid', 'username', 'password')
|
||||
->from('be_users')
|
||||
->where(
|
||||
$queryBuilder->expr()->eq(
|
||||
'username',
|
||||
$queryBuilder->createNamedParameter('admin', \PDO::PARAM_STR)
|
||||
)
|
||||
)
|
||||
->execute()
|
||||
->fetch();
|
||||
|
||||
if (!empty($row)) {
|
||||
try {
|
||||
$hashInstance = GeneralUtility::makeInstance(PasswordHashFactory::class)->get($row['password'], 'BE');
|
||||
if ($hashInstance->checkPassword('password', $row['password'])) {
|
||||
// If the password for 'admin' user is 'password': bad idea!
|
||||
// We're checking since the (very) old installer created instances like this in dark old times.
|
||||
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
|
||||
$value = $this->getLanguageService()->getLL('status_insecure');
|
||||
$severity = ReportStatus::ERROR;
|
||||
$editUserAccountUrl = (string)$uriBuilder->buildUriFromRoute(
|
||||
'record_edit',
|
||||
[
|
||||
'edit[be_users][' . $row['uid'] . ']' => 'edit',
|
||||
'returnUrl' => (string)$uriBuilder->buildUriFromRoute('system_reports')
|
||||
]
|
||||
);
|
||||
$message = sprintf(
|
||||
$this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:warning.backend_admin'),
|
||||
'<a href="' . htmlspecialchars($editUserAccountUrl) . '">',
|
||||
'</a>'
|
||||
);
|
||||
}
|
||||
} catch (InvalidPasswordHashException $e) {
|
||||
// No hash class handling for current hash could be found. Not good, but ok in this case.
|
||||
}
|
||||
}
|
||||
|
||||
return GeneralUtility::makeInstance(ReportStatus::class, $this->getLanguageService()->getLL('status_adminUserAccount'), $value, $message, $severity);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if fileDenyPattern was changed which is dangerous on Apache
|
||||
*
|
||||
* @return ReportStatus An object representing whether the file deny pattern has changed
|
||||
*/
|
||||
protected function getFileDenyPatternStatus(): ReportStatus
|
||||
{
|
||||
$value = $this->getLanguageService()->getLL('status_ok');
|
||||
$message = '';
|
||||
$severity = ReportStatus::OK;
|
||||
$defaultParts = GeneralUtility::trimExplode('|', FILE_DENY_PATTERN_DEFAULT, true);
|
||||
$givenParts = GeneralUtility::trimExplode('|', $GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'], true);
|
||||
$result = array_intersect($defaultParts, $givenParts);
|
||||
|
||||
if ($defaultParts !== $result) {
|
||||
$value = $this->getLanguageService()->getLL('status_insecure');
|
||||
$severity = ReportStatus::ERROR;
|
||||
$message = sprintf(
|
||||
$this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:warning.file_deny_pattern_partsNotPresent'),
|
||||
'<br /><pre>' . htmlspecialchars(FILE_DENY_PATTERN_DEFAULT) . '</pre><br />'
|
||||
);
|
||||
}
|
||||
|
||||
return GeneralUtility::makeInstance(ReportStatus::class, $this->getLanguageService()->getLL('status_fileDenyPattern'), $value, $message, $severity);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if fileDenyPattern allows to upload .htaccess files which is
|
||||
* dangerous on Apache.
|
||||
*
|
||||
* @return ReportStatus An object representing whether it's possible to upload .htaccess files
|
||||
*/
|
||||
protected function getHtaccessUploadStatus(): ReportStatus
|
||||
{
|
||||
$value = $this->getLanguageService()->getLL('status_ok');
|
||||
$message = '';
|
||||
$severity = ReportStatus::OK;
|
||||
|
||||
if ($GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'] != FILE_DENY_PATTERN_DEFAULT
|
||||
&& GeneralUtility::verifyFilenameAgainstDenyPattern('.htaccess')) {
|
||||
$value = $this->getLanguageService()->getLL('status_insecure');
|
||||
$severity = ReportStatus::ERROR;
|
||||
$message = $this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:warning.file_deny_htaccess');
|
||||
}
|
||||
|
||||
return GeneralUtility::makeInstance(ReportStatus::class, $this->getLanguageService()->getLL('status_htaccessUploadProtection'), $value, $message, $severity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return LanguageService
|
||||
*/
|
||||
protected function getLanguageService(): LanguageService
|
||||
{
|
||||
return $GLOBALS['LANG'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,270 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Reports\Report\Status;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use TYPO3\CMS\Core\Localization\LanguageService;
|
||||
use TYPO3\CMS\Core\Registry;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Reports\ExtendedStatusProviderInterface;
|
||||
use TYPO3\CMS\Reports\RequestAwareReportInterface;
|
||||
use TYPO3\CMS\Reports\RequestAwareStatusProviderInterface;
|
||||
use TYPO3\CMS\Reports\Status as ReportStatus;
|
||||
use TYPO3\CMS\Reports\StatusProviderInterface;
|
||||
|
||||
/**
|
||||
* The status report
|
||||
*/
|
||||
class Status implements RequestAwareReportInterface
|
||||
{
|
||||
/**
|
||||
* @var StatusProviderInterface[][]
|
||||
*/
|
||||
protected $statusProviders = [];
|
||||
|
||||
/**
|
||||
* Constructor for class tx_reports_report_Status
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->getLanguageService()->includeLLFile('EXT:reports/Resources/Private/Language/locallang_reports.xlf');
|
||||
$this->getStatusProviders();
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes care of creating / rendering the status report
|
||||
*
|
||||
* @param ServerRequestInterface|null $request the currently handled request
|
||||
* @return string The status report as HTML
|
||||
*/
|
||||
public function getReport(ServerRequestInterface $request = null)
|
||||
{
|
||||
$content = '';
|
||||
$status = $this->getSystemStatus($request);
|
||||
$highestSeverity = $this->getHighestSeverity($status);
|
||||
// Updating the registry
|
||||
$registry = GeneralUtility::makeInstance(Registry::class);
|
||||
$registry->set('tx_reports', 'status.highestSeverity', $highestSeverity);
|
||||
$content .= '<p class="lead">' . $this->getLanguageService()->getLL('status_report_explanation') . '</p>';
|
||||
return $content . $this->renderStatus($status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all registered status providers and creates instances of them.
|
||||
*/
|
||||
protected function getStatusProviders()
|
||||
{
|
||||
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers'] as $key => $statusProvidersList) {
|
||||
$this->statusProviders[$key] = [];
|
||||
foreach ($statusProvidersList as $statusProvider) {
|
||||
$statusProviderInstance = GeneralUtility::makeInstance($statusProvider);
|
||||
if ($statusProviderInstance instanceof StatusProviderInterface) {
|
||||
$this->statusProviders[$key][] = $statusProviderInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs through all status providers and returns all statuses collected.
|
||||
*
|
||||
* @param ServerRequestInterface $request
|
||||
* @return \TYPO3\CMS\Reports\Status[]
|
||||
*/
|
||||
public function getSystemStatus(ServerRequestInterface $request = null)
|
||||
{
|
||||
$status = [];
|
||||
foreach ($this->statusProviders as $statusProviderId => $statusProviderList) {
|
||||
$status[$statusProviderId] = [];
|
||||
foreach ($statusProviderList as $statusProvider) {
|
||||
if ($statusProvider instanceof RequestAwareStatusProviderInterface) {
|
||||
$statuses = $statusProvider->getStatus($request);
|
||||
} else {
|
||||
$statuses = $statusProvider->getStatus();
|
||||
}
|
||||
$status[$statusProviderId] = array_merge($status[$statusProviderId], $statuses);
|
||||
}
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs through all status providers and returns all statuses collected, which are detailed.
|
||||
*
|
||||
* @return \TYPO3\CMS\Reports\Status[]
|
||||
*/
|
||||
public function getDetailedSystemStatus()
|
||||
{
|
||||
$status = [];
|
||||
foreach ($this->statusProviders as $statusProviderId => $statusProviderList) {
|
||||
$status[$statusProviderId] = [];
|
||||
foreach ($statusProviderList as $statusProvider) {
|
||||
if ($statusProvider instanceof ExtendedStatusProviderInterface) {
|
||||
$statuses = $statusProvider->getDetailedStatus();
|
||||
$status[$statusProviderId] = array_merge($status[$statusProviderId], $statuses);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines the highest severity from the given statuses.
|
||||
*
|
||||
* @param array $statusCollection An array of \TYPO3\CMS\Reports\Status objects.
|
||||
* @return int The highest severity found from the statuses.
|
||||
*/
|
||||
public function getHighestSeverity(array $statusCollection)
|
||||
{
|
||||
$highestSeverity = ReportStatus::NOTICE;
|
||||
foreach ($statusCollection as $statusProvider => $providerStatuses) {
|
||||
/** @var ReportStatus $status */
|
||||
foreach ($providerStatuses as $status) {
|
||||
if ($status->getSeverity() > $highestSeverity) {
|
||||
$highestSeverity = $status->getSeverity();
|
||||
}
|
||||
// Reached the highest severity level, no need to go on
|
||||
if ($highestSeverity == ReportStatus::ERROR) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $highestSeverity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the system's status
|
||||
*
|
||||
* @param array $statusCollection An array of statuses as returned by the available status providers
|
||||
* @return string The system status as an HTML table
|
||||
*/
|
||||
protected function renderStatus(array $statusCollection)
|
||||
{
|
||||
$content = '';
|
||||
$template = '
|
||||
<tr>
|
||||
<td class="###CLASS### col-xs-6">###HEADER###</td>
|
||||
<td class="###CLASS### col-xs-6">###STATUS###<br>###CONTENT###</td>
|
||||
</tr>
|
||||
';
|
||||
$statuses = $this->sortStatusProviders($statusCollection);
|
||||
$id = 0;
|
||||
foreach ($statuses as $provider => $providerStatus) {
|
||||
$providerState = $this->sortStatuses($providerStatus);
|
||||
$id++;
|
||||
$classes = [
|
||||
ReportStatus::NOTICE => 'notice',
|
||||
ReportStatus::INFO => 'info',
|
||||
ReportStatus::OK => 'success',
|
||||
ReportStatus::WARNING => 'warning',
|
||||
ReportStatus::ERROR => 'danger'
|
||||
];
|
||||
$messages = '';
|
||||
/** @var ReportStatus $status */
|
||||
foreach ($providerState as $status) {
|
||||
$severity = $status->getSeverity();
|
||||
$messages .= strtr($template, [
|
||||
'###CLASS###' => $classes[$severity],
|
||||
'###HEADER###' => $status->getTitle(),
|
||||
'###STATUS###' => $status->getValue(),
|
||||
'###CONTENT###' => $status->getMessage()
|
||||
]);
|
||||
}
|
||||
$header = '<h2>' . $provider . '</h2>';
|
||||
$table = '<table class="table table-striped table-hover">';
|
||||
$table .= '<tbody>' . $messages . '</tbody>';
|
||||
$table .= '</table>';
|
||||
|
||||
$content .= $header . $table;
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sorts the status providers (alphabetically and puts primary status providers at the beginning)
|
||||
*
|
||||
* @param array $statusCollection A collection of statuses (with providers)
|
||||
* @return array The collection of statuses sorted by provider (beginning with provider "_install")
|
||||
*/
|
||||
protected function sortStatusProviders(array $statusCollection)
|
||||
{
|
||||
// Extract the primary status collections, i.e. the status groups
|
||||
// that must appear on top of the status report
|
||||
// Change their keys to localized collection titles
|
||||
$primaryStatuses = [
|
||||
$this->getLanguageService()->getLL('status_typo3') => $statusCollection['typo3'],
|
||||
$this->getLanguageService()->getLL('status_system') => $statusCollection['system'],
|
||||
$this->getLanguageService()->getLL('status_security') => $statusCollection['security'],
|
||||
$this->getLanguageService()->getLL('status_configuration') => $statusCollection['configuration']
|
||||
];
|
||||
unset($statusCollection['typo3'], $statusCollection['system'], $statusCollection['security'], $statusCollection['configuration']);
|
||||
// Assemble list of secondary status collections with left-over collections
|
||||
// Change their keys using localized labels if available
|
||||
// @todo extract into getLabel() method
|
||||
$secondaryStatuses = [];
|
||||
foreach ($statusCollection as $statusProviderId => $collection) {
|
||||
$label = '';
|
||||
if (strpos($statusProviderId, 'LLL:') === 0) {
|
||||
// Label provided by extension
|
||||
$label = $this->getLanguageService()->sL($statusProviderId);
|
||||
} else {
|
||||
// Generic label
|
||||
$label = $this->getLanguageService()->getLL('status_' . $statusProviderId);
|
||||
}
|
||||
$providerLabel = empty($label) ? $statusProviderId : $label;
|
||||
$secondaryStatuses[$providerLabel] = $collection;
|
||||
}
|
||||
// Sort the secondary status collections alphabetically
|
||||
ksort($secondaryStatuses);
|
||||
$orderedStatusCollection = array_merge($primaryStatuses, $secondaryStatuses);
|
||||
return $orderedStatusCollection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sorts the statuses by severity
|
||||
*
|
||||
* @param array $statusCollection A collection of statuses per provider
|
||||
* @return array The collection of statuses sorted by severity
|
||||
*/
|
||||
protected function sortStatuses(array $statusCollection)
|
||||
{
|
||||
$statuses = [];
|
||||
$sortTitle = [];
|
||||
$header = null;
|
||||
/** @var ReportStatus $status */
|
||||
foreach ($statusCollection as $status) {
|
||||
if ($status->getTitle() === 'TYPO3') {
|
||||
$header = $status;
|
||||
continue;
|
||||
}
|
||||
$statuses[] = $status;
|
||||
$sortTitle[] = $status->getSeverity();
|
||||
}
|
||||
array_multisort($sortTitle, SORT_DESC, $statuses);
|
||||
// Making sure that the core version information is always on the top
|
||||
if (is_object($header)) {
|
||||
array_unshift($statuses, $header);
|
||||
}
|
||||
return $statuses;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return LanguageService
|
||||
*/
|
||||
protected function getLanguageService()
|
||||
{
|
||||
return $GLOBALS['LANG'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Reports\Report\Status;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Core\Localization\LanguageService;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Reports\Status as ReportStatus;
|
||||
use TYPO3\CMS\Reports\StatusProviderInterface;
|
||||
|
||||
/**
|
||||
* Performs several checks about the system's health
|
||||
*/
|
||||
class SystemStatus implements StatusProviderInterface
|
||||
{
|
||||
/**
|
||||
* Determines the Install Tool's status, mainly concerning its protection.
|
||||
*
|
||||
* @return array List of statuses
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
$statuses = [
|
||||
'PhpModules' => $this->getMissingPhpModulesOfExtensions()
|
||||
];
|
||||
return $statuses;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reports whether extensions need additional PHP modules different from standard core requirements
|
||||
*
|
||||
* @return \TYPO3\CMS\Reports\Status A status of missing PHP modules
|
||||
*/
|
||||
protected function getMissingPhpModulesOfExtensions()
|
||||
{
|
||||
$modules = [];
|
||||
if (is_array(${$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install/mod/class.tx_install.php']['requiredPhpModules']})) {
|
||||
foreach (${$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install/mod/class.tx_install.php']['requiredPhpModules']} as $className) {
|
||||
$hookObject = GeneralUtility::makeInstance($className);
|
||||
$modules = $hookObject->setRequiredPhpModules($modules, $this);
|
||||
}
|
||||
}
|
||||
$missingPhpModules = [];
|
||||
foreach ($modules as $module) {
|
||||
if (is_array($module)) {
|
||||
$detectedSubmodules = false;
|
||||
foreach ($module as $submodule) {
|
||||
if (extension_loaded($submodule)) {
|
||||
$detectedSubmodules = true;
|
||||
}
|
||||
}
|
||||
if ($detectedSubmodules === false) {
|
||||
$missingPhpModules[] = sprintf($this->getLanguageService()->getLL('status_phpModulesGroup'), '(' . implode(', ', $module) . ')');
|
||||
}
|
||||
} elseif (!extension_loaded($module)) {
|
||||
$missingPhpModules[] = $module;
|
||||
}
|
||||
}
|
||||
if (!empty($missingPhpModules)) {
|
||||
$value = $this->getLanguageService()->getLL('status_phpModulesMissing');
|
||||
$message = sprintf($this->getLanguageService()->getLL('status_phpModulesList'), implode(', ', $missingPhpModules));
|
||||
$message .= ' ' . $this->getLanguageService()->getLL('status_phpModulesInfo');
|
||||
$severity = ReportStatus::ERROR;
|
||||
} else {
|
||||
$value = $this->getLanguageService()->getLL('status_phpModulesPresent');
|
||||
$message = '';
|
||||
$severity = ReportStatus::OK;
|
||||
}
|
||||
return GeneralUtility::makeInstance(ReportStatus::class, $this->getLanguageService()->getLL('status_phpModules'), $value, $message, $severity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return LanguageService
|
||||
*/
|
||||
protected function getLanguageService()
|
||||
{
|
||||
return $GLOBALS['LANG'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Reports\Report\Status;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
use TYPO3\CMS\Core\Localization\LanguageService;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Reports\Status as ReportStatus;
|
||||
use TYPO3\CMS\Reports\StatusProviderInterface;
|
||||
|
||||
/**
|
||||
* Performs basic checks about the TYPO3 install
|
||||
*/
|
||||
class Typo3Status implements StatusProviderInterface
|
||||
{
|
||||
/**
|
||||
* Returns the status for this report
|
||||
*
|
||||
* @return array List of statuses
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
$statuses = [
|
||||
'registeredXclass' => $this->getRegisteredXclassStatus(),
|
||||
];
|
||||
return $statuses;
|
||||
}
|
||||
|
||||
/**
|
||||
* List any Xclasses registered in the system
|
||||
*
|
||||
* @return \TYPO3\CMS\Reports\Status
|
||||
*/
|
||||
protected function getRegisteredXclassStatus()
|
||||
{
|
||||
$message = '';
|
||||
$value = $this->getLanguageService()->getLL('status_none');
|
||||
$severity = ReportStatus::OK;
|
||||
|
||||
$xclassFoundArray = [];
|
||||
if (array_key_exists('Objects', $GLOBALS['TYPO3_CONF_VARS']['SYS'])) {
|
||||
foreach ($GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'] as $originalClass => $override) {
|
||||
if (array_key_exists('className', $override)) {
|
||||
$xclassFoundArray[$originalClass] = $override['className'];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($xclassFoundArray)) {
|
||||
$value = $this->getLanguageService()->getLL('status_xclassUsageFound');
|
||||
$message = $this->getLanguageService()->getLL('status_xclassUsageFound_message') . '<br />';
|
||||
$message .= '<ol>';
|
||||
foreach ($xclassFoundArray as $originalClass => $xClassName) {
|
||||
$messageDetail = sprintf(
|
||||
$this->getLanguageService()->getLL('status_xclassUsageFound_message_detail'),
|
||||
'<code>' . htmlspecialchars($originalClass) . '</code>',
|
||||
'<code>' . htmlspecialchars($xClassName) . '</code>'
|
||||
);
|
||||
$message .= '<li>' . $messageDetail . '</li>';
|
||||
}
|
||||
$message .= '</ol>';
|
||||
$severity = ReportStatus::NOTICE;
|
||||
}
|
||||
|
||||
return GeneralUtility::makeInstance(
|
||||
ReportStatus::class,
|
||||
$this->getLanguageService()->getLL('status_xclassUsage'),
|
||||
$value,
|
||||
$message,
|
||||
$severity
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return LanguageService
|
||||
*/
|
||||
protected function getLanguageService()
|
||||
{
|
||||
return $GLOBALS['LANG'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Reports\Report\Status;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
|
||||
use TYPO3\CMS\Core\Localization\LanguageService;
|
||||
use TYPO3\CMS\Core\Registry;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Reports\Status as ReportStatus;
|
||||
|
||||
/**
|
||||
* Post processes the warning messages found in about modules.
|
||||
*/
|
||||
class WarningMessagePostProcessor
|
||||
{
|
||||
/**
|
||||
* Tries to get the highest severity of the system's status first, if
|
||||
* something is found it is assumed that the status update task is set up
|
||||
* properly or the status report has been checked manually and we take over
|
||||
* control over the system warning messages.
|
||||
*
|
||||
* @param array $warningMessages An array of messages related to already found issues.
|
||||
*/
|
||||
public function displayWarningMessages_postProcess(array &$warningMessages)
|
||||
{
|
||||
if (!$this->getBackendUser()->isAdmin()) {
|
||||
return;
|
||||
}
|
||||
// Get highest severity
|
||||
/** @var Registry $registry */
|
||||
$registry = GeneralUtility::makeInstance(Registry::class);
|
||||
$highestSeverity = $registry->get('tx_reports', 'status.highestSeverity', null);
|
||||
if ($highestSeverity !== null) {
|
||||
if ($highestSeverity > ReportStatus::OK) {
|
||||
// Display a message that there's something wrong and that
|
||||
// the admin should take a look at the detailed status report
|
||||
$this->getLanguageService()->includeLLFile('EXT:reports/Resources/Private/Language/locallang_reports.xlf');
|
||||
$reportModuleIdentifier = 'system_ReportsTxreportsm1';
|
||||
$reportModuleParameters = [
|
||||
'tx_reports_system_reportstxreportsm1[extension]=tx_reports',
|
||||
'tx_reports_system_reportstxreportsm1[report]=status',
|
||||
'tx_reports_system_reportstxreportsm1[action]=detail',
|
||||
'tx_reports_system_reportstxreportsm1[controller]=Report',
|
||||
];
|
||||
$warningMessages['tx_reports_status_notification'] = sprintf(
|
||||
$this->getLanguageService()->getLL('status_problemNotification'),
|
||||
'<a href="javascript:top.goToModule(' . GeneralUtility::quoteJSvalue($reportModuleIdentifier) . ', 1, ' . GeneralUtility::quoteJSvalue('&' . implode('&', $reportModuleParameters)) . ');">',
|
||||
'</a>'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return LanguageService
|
||||
*/
|
||||
protected function getLanguageService()
|
||||
{
|
||||
return $GLOBALS['LANG'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BackendUserAuthentication
|
||||
*/
|
||||
protected function getBackendUser()
|
||||
{
|
||||
return $GLOBALS['BE_USER'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Reports;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
/**
|
||||
* Interface for classes which provide a report.
|
||||
*/
|
||||
interface ReportInterface
|
||||
{
|
||||
/**
|
||||
* Returns the content for a report
|
||||
*
|
||||
* @return string A reports rendered HTML
|
||||
*/
|
||||
public function getReport();
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
declare(strict_types = 1);
|
||||
namespace TYPO3\CMS\Reports;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
||||
/**
|
||||
* Interface for classes which provide a report using information from the current request
|
||||
*/
|
||||
interface RequestAwareReportInterface extends ReportInterface
|
||||
{
|
||||
/**
|
||||
* Returns the content for a report
|
||||
*
|
||||
* @param ServerRequestInterface|null $request the currently handled request
|
||||
* @return string A reports rendered HTML
|
||||
*/
|
||||
public function getReport(ServerRequestInterface $request = null);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
declare(strict_types = 1);
|
||||
namespace TYPO3\CMS\Reports;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
||||
/**
|
||||
* Interface for classes which provide a status report entry using information from the current request
|
||||
*/
|
||||
interface RequestAwareStatusProviderInterface extends StatusProviderInterface
|
||||
{
|
||||
/**
|
||||
* Returns the status of an extension or (sub)system
|
||||
*
|
||||
* @param ServerRequestInterface|null $request the currently handled request
|
||||
* @return array An array of \TYPO3\CMS\Reports\Status objects
|
||||
*/
|
||||
public function getStatus(ServerRequestInterface $request = null);
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Reports;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
use TYPO3\CMS\Core\Utility\MathUtility;
|
||||
|
||||
/**
|
||||
* A class representing a certain status
|
||||
*/
|
||||
class Status
|
||||
{
|
||||
const NOTICE = -2;
|
||||
const INFO = -1;
|
||||
const OK = 0;
|
||||
const WARNING = 1;
|
||||
const ERROR = 2;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $title;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $value;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $message;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $severity;
|
||||
|
||||
/**
|
||||
* Construct a status
|
||||
*
|
||||
* All values must be given as constructor arguments.
|
||||
* All strings should be localized.
|
||||
*
|
||||
* @param string $title Status title, eg. "Deprecation log"
|
||||
* @param string $value Status value, eg. "Disabled"
|
||||
* @param string $message Optional message further describing the title/value combination
|
||||
* Example:, eg "The deprecation log is important and does foo, to disable it do bar"
|
||||
* @param int $severity A severity level. Use one of the constants above!
|
||||
*/
|
||||
public function __construct($title, $value, $message = '', $severity = self::OK)
|
||||
{
|
||||
$this->title = (string)$title;
|
||||
$this->value = (string)$value;
|
||||
$this->message = (string)$message;
|
||||
$this->severity = MathUtility::forceIntegerInRange($severity, self::NOTICE, self::ERROR, self::OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the status' title
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the status' value
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the status' message (if any)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMessage()
|
||||
{
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the status' severity
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getSeverity()
|
||||
{
|
||||
return $this->severity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a string representation of a status.
|
||||
*
|
||||
* @return string String representation of this status.
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
$severity = [
|
||||
self::NOTICE => 'NOTE',
|
||||
self::INFO => 'INFO',
|
||||
self::OK => 'OK',
|
||||
self::WARNING => 'WARN',
|
||||
self::ERROR => 'ERR'
|
||||
];
|
||||
// Max length 80 characters
|
||||
$stringRepresentation = str_pad('[' . $severity[$this->severity] . ']', 7) . str_pad($this->title, 40) . ' - ' . substr($this->value, 0, 30);
|
||||
return $stringRepresentation;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Reports;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
/**
|
||||
* Interface for classes which provide a status report entry.
|
||||
*/
|
||||
interface StatusProviderInterface
|
||||
{
|
||||
/**
|
||||
* Returns the status of an extension or (sub)system
|
||||
*
|
||||
* @return array An array of \TYPO3\CMS\Reports\Status objects
|
||||
*/
|
||||
public function getStatus();
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Reports\Task;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Core\Localization\LanguageService;
|
||||
use TYPO3\CMS\Core\Mail\MailMessage;
|
||||
use TYPO3\CMS\Core\Registry;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Reports\Status;
|
||||
use TYPO3\CMS\Scheduler\Task\AbstractTask;
|
||||
|
||||
/**
|
||||
* A task that should be run regularly to determine the system's status.
|
||||
* @internal This class is a specific scheduler task implementation and is not considered part of the Public TYPO3 API.
|
||||
*/
|
||||
class SystemStatusUpdateTask extends AbstractTask
|
||||
{
|
||||
/**
|
||||
* Email addresses to send email notification to in case we find problems with
|
||||
* the system.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $notificationEmail;
|
||||
|
||||
/**
|
||||
* Checkbox for to send all types of notification, not only problems
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $notificationAll = false;
|
||||
|
||||
/**
|
||||
* Executes the System Status Update task, determining the highest severity of
|
||||
* status reports and saving that to the registry to be displayed at login
|
||||
* if necessary.
|
||||
*
|
||||
* @see \TYPO3\CMS\Scheduler\Task\AbstractTask::execute()
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
/** @var Registry $registry */
|
||||
$registry = GeneralUtility::makeInstance(Registry::class);
|
||||
/** @var \TYPO3\CMS\Reports\Report\Status\Status $statusReport */
|
||||
$statusReport = GeneralUtility::makeInstance(\TYPO3\CMS\Reports\Report\Status\Status::class);
|
||||
$systemStatus = $statusReport->getDetailedSystemStatus();
|
||||
$highestSeverity = $statusReport->getHighestSeverity($systemStatus);
|
||||
$registry->set('tx_reports', 'status.highestSeverity', $highestSeverity);
|
||||
if (($highestSeverity > Status::OK) || $this->getNotificationAll()) {
|
||||
$this->sendNotificationEmail($systemStatus);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the notification email addresses.
|
||||
*
|
||||
* @return string Notification email addresses.
|
||||
*/
|
||||
public function getNotificationEmail()
|
||||
{
|
||||
return $this->notificationEmail;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the notification email address.
|
||||
*
|
||||
* @param string $notificationEmail Notification email address.
|
||||
*/
|
||||
public function setNotificationEmail($notificationEmail)
|
||||
{
|
||||
$this->notificationEmail = $notificationEmail;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a notification email, reporting system issues.
|
||||
*
|
||||
* @param Status[] $systemStatus Array of statuses
|
||||
*/
|
||||
protected function sendNotificationEmail(array $systemStatus)
|
||||
{
|
||||
$systemIssues = [];
|
||||
foreach ($systemStatus as $statusProvider) {
|
||||
/** @var Status $status */
|
||||
foreach ($statusProvider as $status) {
|
||||
if ($this->getNotificationAll() || ($status->getSeverity() > Status::OK)) {
|
||||
$systemIssues[] = (string)$status . CRLF . $status->getMessage() . CRLF . CRLF;
|
||||
}
|
||||
}
|
||||
}
|
||||
$notificationEmails = GeneralUtility::trimExplode(LF, $this->notificationEmail, true);
|
||||
$sendEmailsTo = [];
|
||||
foreach ($notificationEmails as $notificationEmail) {
|
||||
$sendEmailsTo[] = $notificationEmail;
|
||||
}
|
||||
$subject = sprintf($this->getLanguageService()->getLL('status_updateTask_email_subject'), $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']);
|
||||
$message = $this->getNotificationAll() ? $this->getLanguageService()->getLL('status_allNotification') : $this->getLanguageService()->getLL('status_problemNotification');
|
||||
$message .= CRLF . CRLF;
|
||||
$message .= $this->getLanguageService()->getLL('status_updateTask_email_site') . ': ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
|
||||
$message .= CRLF . CRLF;
|
||||
$message .= $this->getLanguageService()->getLL('status_updateTask_email_issues') . ': ' . CRLF;
|
||||
$message .= implode(CRLF, $systemIssues);
|
||||
$message .= CRLF . CRLF;
|
||||
/** @var MailMessage $mail */
|
||||
$mail = GeneralUtility::makeInstance(MailMessage::class);
|
||||
$mail->setTo($sendEmailsTo);
|
||||
$mail->setSubject($subject);
|
||||
$mail->setBody($message);
|
||||
$mail->send();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function getNotificationAll(): bool
|
||||
{
|
||||
return $this->notificationAll;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $notificationAll
|
||||
*/
|
||||
public function setNotificationAll(bool $notificationAll)
|
||||
{
|
||||
$this->notificationAll = $notificationAll;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return LanguageService
|
||||
*/
|
||||
protected function getLanguageService()
|
||||
{
|
||||
return $GLOBALS['LANG'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Reports\Task;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Core\Localization\LanguageService;
|
||||
use TYPO3\CMS\Core\Messaging\FlashMessage;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Scheduler\AbstractAdditionalFieldProvider;
|
||||
use TYPO3\CMS\Scheduler\Controller\SchedulerModuleController;
|
||||
use TYPO3\CMS\Scheduler\Task\AbstractTask;
|
||||
use TYPO3\CMS\Scheduler\Task\Enumeration\Action;
|
||||
|
||||
/**
|
||||
* Additional field to set the notification email address(es) for system health
|
||||
* issue notifications.
|
||||
* @internal This class is a specific scheduler task implementation and is not considered part of the Public TYPO3 API.
|
||||
*/
|
||||
class SystemStatusUpdateTaskNotificationEmailField extends AbstractAdditionalFieldProvider
|
||||
{
|
||||
/**
|
||||
* Additional fields
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fields = ['notificationEmail', 'notificationAll'];
|
||||
|
||||
/**
|
||||
* Field prefix.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $fieldPrefix = 'SystemStatusUpdate';
|
||||
|
||||
/**
|
||||
* Gets additional fields to render in the form to add/edit a task
|
||||
*
|
||||
* @param array $taskInfo Values of the fields from the add/edit task form
|
||||
* @param AbstractTask|null $task When editing, reference to the current task. NULL when adding.
|
||||
* @param SchedulerModuleController $schedulerModule Reference to the scheduler backend module
|
||||
* @return array A two dimensional array, array('Identifier' => array('fieldId' => array('code' => '', 'label' => '', 'cshKey' => '', 'cshLabel' => ''))
|
||||
*/
|
||||
public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleController $schedulerModule)
|
||||
{
|
||||
$currentSchedulerModuleAction = $schedulerModule->getCurrentAction();
|
||||
|
||||
if ($currentSchedulerModuleAction->equals(Action::EDIT)) {
|
||||
$taskInfo[$this->fieldPrefix . 'NotificationEmail'] = $task->getNotificationEmail();
|
||||
$taskInfo[$this->fieldPrefix . 'NotificationAll'] = $task->getNotificationAll();
|
||||
}
|
||||
// build html for additional email field
|
||||
$fieldName = $this->getFullFieldName('notificationEmail');
|
||||
$fieldId = 'task_' . $fieldName;
|
||||
$fieldHtml = '<textarea class="form-control" ' . 'rows="5" cols="50" name="tx_scheduler[' . $fieldName . ']" ' . 'id="' . $fieldId . '" ' . '>' . htmlspecialchars($taskInfo[$fieldName]) . '</textarea>';
|
||||
|
||||
$additionalFields = [];
|
||||
$additionalFields[$fieldId] = [
|
||||
'code' => $fieldHtml,
|
||||
'label' => 'LLL:EXT:reports/Resources/Private/Language/locallang_reports.xlf:status_updateTaskField_notificationEmails',
|
||||
'cshKey' => '',
|
||||
'cshLabel' => $fieldId
|
||||
];
|
||||
|
||||
// build html for additional mail all checkbox field
|
||||
$fieldName = $this->getFullFieldName('notificationAll');
|
||||
$fieldId = 'task_' . $fieldName;
|
||||
$fieldHtml = '<input type="checkbox" name="tx_scheduler[' . $fieldName . ']" id="' . $fieldId . '" value="1"' . ($taskInfo[$fieldName] ? ' checked="checked"' : '') . '>';
|
||||
|
||||
$additionalFields[$fieldId] = [
|
||||
'code' => $fieldHtml,
|
||||
'label' => 'LLL:EXT:reports/Resources/Private/Language/locallang_reports.xlf:status_updateTaskField_notificationAll',
|
||||
'cshKey' => '',
|
||||
'cshLabel' => $fieldId
|
||||
];
|
||||
|
||||
return $additionalFields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the additional fields' values
|
||||
*
|
||||
* @param array $submittedData An array containing the data submitted by the add/edit task form
|
||||
* @param SchedulerModuleController $schedulerModule Reference to the scheduler backend module
|
||||
* @return bool TRUE if validation was ok (or selected class is not relevant), FALSE otherwise
|
||||
*/
|
||||
public function validateAdditionalFields(array &$submittedData, SchedulerModuleController $schedulerModule)
|
||||
{
|
||||
$validInput = true;
|
||||
$notificationEmails = GeneralUtility::trimExplode(LF, $submittedData[$this->fieldPrefix . 'NotificationEmail'], true);
|
||||
foreach ($notificationEmails as $notificationEmail) {
|
||||
if (!GeneralUtility::validEmail($notificationEmail)) {
|
||||
$validInput = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$validInput || empty($submittedData[$this->fieldPrefix . 'NotificationEmail'])) {
|
||||
$this->addMessage($this->getLanguageService()->sL('LLL:EXT:reports/Resources/Private/Language/locallang_reports.xlf:status_updateTaskField_notificationEmails_invalid'), FlashMessage::ERROR);
|
||||
$validInput = false;
|
||||
}
|
||||
return $validInput;
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes care of saving the additional fields' values in the task's object
|
||||
*
|
||||
* @param array $submittedData An array containing the data submitted by the add/edit task form
|
||||
* @param AbstractTask $task Reference to the scheduler backend module
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function saveAdditionalFields(array $submittedData, AbstractTask $task)
|
||||
{
|
||||
if (!$task instanceof SystemStatusUpdateTask) {
|
||||
throw new \InvalidArgumentException('Expected a task of type ' . SystemStatusUpdateTask::class . ', but got ' . get_class($task), 1295012802);
|
||||
}
|
||||
$task->setNotificationEmail($submittedData[$this->fieldPrefix . 'NotificationEmail']);
|
||||
$task->setNotificationAll(!empty($submittedData[$this->fieldPrefix . 'NotificationAll']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs the full field name which can be used in HTML markup.
|
||||
*
|
||||
* @param string $fieldName A raw field name
|
||||
* @return string Field name ready to use in HTML markup
|
||||
*/
|
||||
protected function getFullFieldName($fieldName)
|
||||
{
|
||||
return $this->fieldPrefix . ucfirst($fieldName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return LanguageService
|
||||
*/
|
||||
protected function getLanguageService()
|
||||
{
|
||||
return $GLOBALS['LANG'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
namespace TYPO3\CMS\Reports\ViewHelpers;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Core\Utility\PathUtility;
|
||||
use TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
|
||||
/**
|
||||
* Render the icon of a report
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class IconViewHelper extends AbstractBackendViewHelper
|
||||
{
|
||||
/**
|
||||
* As this ViewHelper renders HTML, the output must not be escaped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $escapeOutput = false;
|
||||
|
||||
/**
|
||||
* Initializes the arguments
|
||||
*/
|
||||
public function initializeArguments()
|
||||
{
|
||||
parent::initializeArguments();
|
||||
$this->registerArgument('icon', 'string', 'Icon to be used', true);
|
||||
$this->registerArgument('title', 'string', 'Optional title', false, '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the icon
|
||||
*
|
||||
* @return string Content rendered image
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return static::renderStatic(
|
||||
$this->arguments,
|
||||
$this->buildRenderChildrenClosure(),
|
||||
$this->renderingContext
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
|
||||
{
|
||||
$icon = $arguments['icon'];
|
||||
$title = $arguments['title'];
|
||||
|
||||
$icon = GeneralUtility::getFileAbsFileName($icon);
|
||||
|
||||
// use the extension icon from EXT:reports as fallback
|
||||
if (!$icon) {
|
||||
$fallbackIconPath = ExtensionManagementUtility::extPath('reports');
|
||||
$icon = ExtensionManagementUtility::getExtensionIcon($fallbackIconPath, true);
|
||||
}
|
||||
|
||||
return '<img src="' . htmlspecialchars(PathUtility::getAbsoluteWebPath($icon))
|
||||
. '" width="16" height="16" title="' . htmlspecialchars($title)
|
||||
. '" alt="' . htmlspecialchars($title) . '" />';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,345 @@
|
||||
Some icons used in the TYPO3 project are retrieved from the "Silk" icon set of
|
||||
Mark James, which can be found at http://famfamfam.com/lab/icons/silk/. This
|
||||
set is distributed under a Creative Commons Attribution 2.5 License. The
|
||||
license can be found at http://creativecommons.org/licenses/by/2.5/.
|
||||
---------------------------------
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
return [
|
||||
'TYPO3\\CMS\\Sv\\Report\\ServicesListReport' => \TYPO3\CMS\Reports\Report\ServicesListReport::class
|
||||
];
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
namespace {
|
||||
die('Access denied');
|
||||
}
|
||||
|
||||
namespace TYPO3\CMS\Sv\Report {
|
||||
class ServicesListReport extends \TYPO3\CMS\Reports\Report\ServicesListReport
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
|
||||
<file t3:id="1415814910" source-language="en" datatype="plaintext" original="EXT:reports/Resources/Private/Language/locallang.xlf" date="2011-10-17T20:22:35Z" product-name="reports">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="mlang_tabs_tab" resname="mlang_tabs_tab">
|
||||
<source>Reports</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="mlang_labels_tabdescr" resname="mlang_labels_tabdescr">
|
||||
<source>A collection of several system reports.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="mlang_labels_tablabel" resname="mlang_labels_tablabel">
|
||||
<source>System Reports</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="title" resname="title">
|
||||
<source>Reports</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="reports_overview" resname="reports_overview">
|
||||
<source>Overview</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="choose_report" resname="choose_report">
|
||||
<source>Report</source>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
@@ -0,0 +1,296 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
|
||||
<file t3:id="1415814909" source-language="en" datatype="plaintext" original="EXT:reports/Resources/Private/Language/locallang_reports.xlf" date="2011-10-17T20:22:35Z" product-name="reports">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="status_report_title" resname="status_report_title">
|
||||
<source>Status Report</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_report_description" resname="status_report_description">
|
||||
<source>Get a status report about your site's operation and any detected problems.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_report_explanation" resname="status_report_explanation">
|
||||
<source>Here you can find a short overview of your site's parameters as well as any problems detected with your installation. It may be useful to copy and paste this information into support requests filed on TYPO3's support mailinglists and project issue trackers.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_ok" resname="status_ok">
|
||||
<source>OK</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_wrongValue" resname="status_wrongValue">
|
||||
<source>Wrong value detected</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_info" resname="status_info">
|
||||
<source>Information</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_insecure" resname="status_insecure">
|
||||
<source>Insecure</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_disabled" resname="status_disabled">
|
||||
<source>Disabled</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_enabled" resname="status_enabled">
|
||||
<source>Enabled</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_enabledPermanently" resname="status_enabledPermanently">
|
||||
<source>Enabled permanently</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_enabledTemporarily" resname="status_enabledTemporarily">
|
||||
<source>Enabled temporarily</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_empty" resname="status_empty">
|
||||
<source>Empty</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_none" resname="status_none">
|
||||
<source>None</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_connectionFailed" resname="status_connectionFailed">
|
||||
<source>Connection Failed</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_checkFailed" resname="status_checkFailed">
|
||||
<source>Check Failed</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_updateComplete" resname="status_updateComplete">
|
||||
<source>Update Complete</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_updateIncomplete" resname="status_updateIncomplete">
|
||||
<source>Update Incomplete</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_problemNotification" resname="status_problemNotification">
|
||||
<source>One or more problems were detected with your TYPO3 installation. Please check the status report for more information.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_allNotification" resname="status_allNotification">
|
||||
<source>This report contains all System Status Notifications from your TYPO3 installation. Please check the status report for more information.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_typo3" resname="status_typo3">
|
||||
<source>TYPO3 System</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_system" resname="status_system">
|
||||
<source>System</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_security" resname="status_security">
|
||||
<source>Security</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_configuration" resname="status_configuration">
|
||||
<source>Configuration</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_referenceIndex" resname="status_referenceIndex">
|
||||
<source>Reference Index</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_fal" resname="status_fal">
|
||||
<source>File Abstraction Layer</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_missingFiles" resname="status_missingFiles">
|
||||
<source>Files flagged as missing</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_missingFilesCount" resname="status_missingFilesCount">
|
||||
<source>%1$s files</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_missingFilesMessage" resname="status_missingFilesMessage">
|
||||
<source>These files are flagged as missing. Restore the files and run the indexer to reset the missing flag.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_memcachedConfiguration" resname="status_memcachedConfiguration">
|
||||
<source>Memcached Configuration</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_PhpSafeMode" resname="status_PhpSafeMode">
|
||||
<source>PHP safe_mode</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_PhpMagicQuotesGpc" resname="status_PhpMagicQuotesGpc">
|
||||
<source>PHP magic_quotes_gpc</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_CreatedFilePermissions" resname="status_CreatedFilePermissions">
|
||||
<source>Permissions of created files</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_CreatedFilePermissions.writable" resname="status_CreatedFilePermissions.writable">
|
||||
<source>Files created by TYPO3 are configured to be world writable. Depending on your server configuration, this can be a security risk. It is usually better to configure the create mask to not allow writing to files by "others". A sane default is often '0660' for $GLOBALS['TYPO3_CONF_VARS']['SYS']['fileCreateMask']. This can be set in the install tool.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_CreatedDirectoryPermissions" resname="status_CreatedDirectoryPermissions">
|
||||
<source>Permissions of created directories</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_CreatedDirectoryPermissions.writable" resname="status_CreatedDirectoryPermissions.writable">
|
||||
<source>Directories created by TYPO3 are configured to be world writable. Depending on your server configuration, this can be a security risk. It is usually better to configure the create mask to not allow writing to directories by "others". A sane default is often '2770' for $GLOBALS['TYPO3_CONF_VARS']['SYS']['folderCreateMask']. This can be set in the install tool.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_MysqlDatabaseCharacterSet" resname="status_MysqlDatabaseCharacterSet">
|
||||
<source>MySQL Database Character Set</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_MysqlDatabaseCharacterSet_CheckFailed" resname="status_MysqlDatabaseCharacterSet_CheckFailed">
|
||||
<source>Checking database character set failed, got key "%1$s" instead of "character_set_database"</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_MysqlDatabaseCharacterSet_Unsupported" resname="status_MysqlDatabaseCharacterSet_Unsupported">
|
||||
<source>Your default database uses character set "%1$s", but only "utf8" or "utf8mb4" is supported with TYPO3.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_MysqlDatabaseCharacterSet_Ok" resname="status_MysqlDatabaseCharacterSet_Ok">
|
||||
<source>Your default database uses utf-8. All good.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_MysqlDatabaseCharacterSet_Info" resname="status_MysqlDatabaseCharacterSet_Info">
|
||||
<source>Your default database uses a different charset, but all tables uses utf-8. All good. But consider fixing your database collation and check the table creation settings.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_MysqlDatabaseCharacterSet_MixedCollations" resname="status_MysqlDatabaseCharacterSet_MixedCollations">
|
||||
<source>Your default database is set to create tables with character set "%1$s", but contains tables or columns with different collations. Please fix these tables to avoid "illegal mix of collations" errors.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_encryptedConnectionStatus" resname="status_encryptedConnectionStatus">
|
||||
<source>Encrypted backend connection (HTTPS)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_encryptedConnectionStatus_insecure" resname="status_encryptedConnectionStatus_insecure">
|
||||
<source>Your backend access is not secured using HTTPS but relies on HTTP which sends all your data (including login passwords) over an insecure connection. All modern web sites should rely on HTTPS and only sites secured differently, for instance some intranet installations may use HTTP only.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_lockSslStatus" resname="status_lockSslStatus">
|
||||
<source>Backend only accessible through HTTPS</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_lockSslStatus_insecure" resname="status_lockSslStatus_insecure">
|
||||
<source><![CDATA[It is highly recommended to activate the option (<code>$GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL']</code>).]]></source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_trustedHostsPattern" resname="status_trustedHostsPattern">
|
||||
<source>Trusted Hosts Pattern</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_adminUserAccount" resname="status_adminUserAccount">
|
||||
<source>Admin User Account</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_encryptionKey" resname="status_encryptionKey">
|
||||
<source>Encryption Key</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_fileDenyPattern" resname="status_fileDenyPattern">
|
||||
<source>File Deny Pattern</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_htaccessUploadProtection" resname="status_htaccessUploadProtection">
|
||||
<source>.htaccess Upload Protection</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_installToolPassword" resname="status_installToolPassword">
|
||||
<source>Install Tool Password</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_installTool" resname="status_installTool">
|
||||
<source>Install Tool</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_phpVersion" resname="status_phpVersion">
|
||||
<source>PHP Version</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_phpTooOld" resname="status_phpTooOld">
|
||||
<source>Your PHP installation is too old.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_phpMemory" resname="status_phpMemory">
|
||||
<source>PHP Memory Limit</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_phpMemoryRecommendation" resname="status_phpMemoryRecommendation">
|
||||
<source>Depending on your configuration, TYPO3 can run with a %1$s PHP memory limit. However, a %2$s PHP memory limit or above is recommended, especially if your site uses additional extensions.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_phpMemoryRequirement" resname="status_phpMemoryRequirement">
|
||||
<source>Depending on your configuration, TYPO3 can run with a %1$s PHP memory limit. However, a %2$s PHP memory limit or above is required especially if your site uses additional extensions.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_phpMemoryEditLimit" resname="status_phpMemoryEditLimit">
|
||||
<source>Increase the memory limit by editing the memory_limit parameter in the file %s and then restart your web server (or contact your system administrator or hosting provider for assistance).</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_phpMemoryContactAdmin" resname="status_phpMemoryContactAdmin">
|
||||
<source>Contact your system administrator or hosting provider for assistance with increasing your PHP memory limit.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_phpMemoryUnlimited" resname="status_phpMemoryUnlimited">
|
||||
<source>unlimited</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_phpPeakMemory" resname="status_phpPeakMemory">
|
||||
<source>PHP peak memory usage</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_phpPeakMemoryTooHigh" resname="status_phpPeakMemoryTooHigh">
|
||||
<source>During a request %2$s of the memory limit was used. On %4$s a request to %5$s used %1$s of %3$s.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_phpPeakMemoryClearFlag" resname="status_phpPeakMemoryClearFlag">
|
||||
<source>Clear this flag</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_phpRegisterGlobals" resname="status_phpRegisterGlobals">
|
||||
<source>PHP Register Globals</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_phpRegisterGlobalsEnabled" resname="status_phpRegisterGlobalsEnabled">
|
||||
<source>%s is enabled. TYPO3 requires this configuration directive to be disabled.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_phpRegisterGlobalsSecurity" resname="status_phpRegisterGlobalsSecurity">
|
||||
<source>Your site may not be secure when %s is enabled.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_phpRegisterGlobalsHowToChange" resname="status_phpRegisterGlobalsHowToChange">
|
||||
<source>how to change configuration settings</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_phpRegisterGlobalsPHPManual" resname="status_phpRegisterGlobalsPHPManual">
|
||||
<source>The PHP manual has instructions for %s.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_webServer" resname="status_webServer">
|
||||
<source>Web Server</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_webServer_infoText" resname="status_webServer_infoText">
|
||||
<source>For your Web Server some notifications have been found</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_webServer_threadStackSize" resname="status_webServer_threadStackSize" xml:space="preserve">
|
||||
<source><![CDATA[Fluid uses complex regular expressions which require a lot of stack space during the first processing.
|
||||
On Windows the default stack size for Apache is a lot smaller than on unix.
|
||||
You can increase the size to 8MB (default on unix) by adding to the httpd.conf:
|
||||
<br /><IfModule mpm_winnt_module>
|
||||
<br />ThreadStackSize 8388608
|
||||
<br /></IfModule>
|
||||
<br />Restart Apache after this change.]]></source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_phpModules" resname="status_phpModules">
|
||||
<source>PHP Modules</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_phpModulesMissing" resname="status_phpModulesMissing">
|
||||
<source>One or more modules are missing.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_phpModulesList" resname="status_phpModulesList">
|
||||
<source>The following PHP module(s) is/are missing: %s.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_phpModulesInfo" resname="status_phpModulesInfo">
|
||||
<source>You need to install and enable these modules to let TYPO3 function correctly.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_phpModulesGroup" resname="status_phpModulesGroup">
|
||||
<source>one of: %s</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_phpModulesPresent" resname="status_phpModulesPresent">
|
||||
<source>All required modules are installed.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_installEnabledTemporarily" resname="status_installEnabledTemporarily">
|
||||
<source>The Install Tool is temporarily enabled. Delete the file "%s" when you have finished setting up TYPO3. If not used the Install Tool will be disabled automatically in %s minutes.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_configuration_PhpSafeModeEnabled" resname="status_configuration_PhpSafeModeEnabled">
|
||||
<source>PHP INI setting safe_mode "On" is deprecated since PHP 5.3 and is not supported by TYPO3 anymore.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_configuration_PhpMagicQuotesGpcEnabled" resname="status_configuration_PhpMagicQuotesGpcEnabled">
|
||||
<source>PHP INI setting magic_quotes_gpc "On" is deprecated since PHP 5.3. You are advised to set it to "Off" until it gets completely removed.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_updateTaskTitle" resname="status_updateTaskTitle">
|
||||
<source>System Status Update</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_updateTaskDescription" resname="status_updateTaskDescription">
|
||||
<source>Runs a system status check and sends notifications if problems have been found.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_updateTaskField_notificationEmail" resname="status_updateTaskField_notificationEmail">
|
||||
<source>Notification Email Address</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_updateTaskField_notificationEmails" resname="status_updateTaskField_notificationEmails">
|
||||
<source>Notification Email Addresses (one per line)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_updateTaskField_notificationEmail_invalid" resname="status_updateTaskField_notificationEmail_invalid">
|
||||
<source>Empty or invalid notification email address.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_updateTaskField_notificationEmails_invalid" resname="status_updateTaskField_notificationEmails_invalid">
|
||||
<source>Empty or invalid notification email addresses.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_updateTaskField_notificationAll" resname="status_updateTaskField_notificationAll">
|
||||
<source>Always send notification mail (not only on errors or warnings)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_updateTask_email_subject" resname="status_updateTask_email_subject">
|
||||
<source>System Status Notification for site %s</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_updateTask_email_site" resname="status_updateTask_email_site">
|
||||
<source>Site</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_updateTask_email_issues" resname="status_updateTask_email_issues">
|
||||
<source>Issues</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_xclassUsage" resname="status_xclassUsage">
|
||||
<source>XCLASS used</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_xclassUsageFound" resname="status_xclassUsageFound">
|
||||
<source>Your system registers XCLASS</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_xclassUsageFound_message" resname="status_xclassUsageFound_message">
|
||||
<source>XCLASS can overwrite methods or classes of the core or other extensions. This is not necessarily a bad thing, but those XCLASS might break during extension or core upgrades. You should keep an eye on extension compatibility and make sure the intended functionality is still given after updates.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="status_xclassUsageFound_message_detail" resname="status_xclassUsageFound_message_detail">
|
||||
<source>%2$s registers an XCLASS of %1$s</source>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
|
||||
<file t3:id="1415814992" source-language="en" datatype="plaintext" original="EXT:reports/Resources/Private/Language/locallang_servicereport.xlf" date="2011-10-17T20:22:37Z" product-name="sv">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="report_title" resname="report_title">
|
||||
<source>Installed Services</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="report_description" resname="report_description">
|
||||
<source>List of all installed services with information and status for each of them.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="report_explanation" resname="report_explanation">
|
||||
<source>This report displays a list of installed services, with detailed information about each of them. The services are ordered by type, priority and quality. Unavailable services are highlighted with an error status.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="externals_explanation" resname="externals_explanation">
|
||||
<source>The "Externals" column shows which external programs a given service relies on. If such program is missing or not executable, the service will be unavailable. Search paths for executables are listed at the bottom of this report.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="service_type" resname="service_type">
|
||||
<source>Service type: %s</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="service" resname="service">
|
||||
<source>Service</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="description" resname="description">
|
||||
<source>Description</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="priority" resname="priority">
|
||||
<source>Priority</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="quality" resname="quality">
|
||||
<source>Quality</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="subtypes" resname="subtypes">
|
||||
<source>Subtypes</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="os" resname="os">
|
||||
<source>OS</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="externals" resname="externals">
|
||||
<source>Externals</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="available" resname="available">
|
||||
<source>Available</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="any" resname="any">
|
||||
<source>Any</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="search_paths" resname="search_paths">
|
||||
<source>Configured search paths for external programs</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="path" resname="path">
|
||||
<source>Path</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="valid" resname="valid">
|
||||
<source>Valid</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="no_search_paths" resname="no_search_paths">
|
||||
<source>No search paths configured.</source>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
@@ -0,0 +1 @@
|
||||
<f:render section="content" />
|
||||
@@ -0,0 +1,14 @@
|
||||
<f:layout name="Default" />
|
||||
|
||||
<f:section name="content">
|
||||
<h1><f:translate key="title" /></h1>
|
||||
|
||||
<f:if condition="{error}">
|
||||
<f:then>
|
||||
{error}
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:format.html parseFuncTSPath="">{content -> f:format.raw()}</f:format.html>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:section>
|
||||
@@ -0,0 +1,26 @@
|
||||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
|
||||
xmlns:r="http://typo3.org/ns/TYPO3/CMS/Reports/ViewHelpers"
|
||||
xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers"
|
||||
data-namespace-typo3-fluid="true">
|
||||
|
||||
<f:layout name="Default" />
|
||||
|
||||
<f:section name="content">
|
||||
<h1><f:translate key="title" /></h1>
|
||||
|
||||
<h2 class="uppercase"><f:translate key="reports_overview" /></h2>
|
||||
|
||||
<dl class="t3-overview-list">
|
||||
<f:for each="{reports}" as="reportOverview" key="extensionKey">
|
||||
<f:for each="{reportOverview}" key="reportName" as="report">
|
||||
<dt>
|
||||
<a href="{be:moduleLink(route:'system_reports',arguments:'{action:\'detail\', extension:extensionKey, report:reportName}')}">
|
||||
<r:icon icon="{report.icon}" title="{f:translate(key:report.title)}" />
|
||||
<f:translate key="{report.title}" />
|
||||
</a>
|
||||
</dt>
|
||||
<dd><f:translate key="{report.description}" /></dd>
|
||||
</f:for>
|
||||
</f:for>
|
||||
</dl>
|
||||
</f:section>
|
||||
@@ -0,0 +1,77 @@
|
||||
<p class="lead">
|
||||
<f:translate key="LLL:EXT:reports/Resources/Private/Language/locallang_servicereport.xlf:report_explanation" />
|
||||
</p>
|
||||
<p class="help">
|
||||
<f:translate key="LLL:EXT:reports/Resources/Private/Language/locallang_servicereport.xlf:externals_explanation" />
|
||||
</p>
|
||||
|
||||
<f:for each="{servicesList}" as="serviceList">
|
||||
<f:render section="ServiceTypeList" arguments="{serviceList: serviceList}" />
|
||||
</f:for>
|
||||
|
||||
<h3><f:translate key="LLL:EXT:reports/Resources/Private/Language/locallang_servicereport.xlf:search_paths" /></h3>
|
||||
<f:if condition="{searchPaths}">
|
||||
<f:then>
|
||||
<table class="table table-striped table-hover tx_sv_reportlist">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><f:translate key="LLL:EXT:reports/Resources/Private/Language/locallang_servicereport.xlf:path" /></th>
|
||||
<th><f:translate key="LLL:EXT:reports/Resources/Private/Language/locallang_servicereport.xlf:valid" /></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<f:for each="{searchPaths}" as="searchPath">
|
||||
<tr class="{searchPath.class}">
|
||||
<td class="first-cell">{searchPath.path}</td>
|
||||
<td class="last-cell"><f:translate key="{searchPath.accessible}" /></td>
|
||||
</tr>
|
||||
</f:for>
|
||||
</tbody>
|
||||
</table>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<p><f:translate key="LLL:EXT:reports/Resources/Private/Language/locallang_servicereport.xlf:no_search_paths" /></p>
|
||||
</f:else>
|
||||
</f:if>
|
||||
|
||||
|
||||
<f:section name="ServiceTypeList">
|
||||
<h3>{serviceList.Type}</h3>
|
||||
<table class="table table-striped table-hover tx_sv_reportlist">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><f:translate key="LLL:EXT:reports/Resources/Private/Language/locallang_servicereport.xlf:service" /></th>
|
||||
<th><f:translate key="LLL:EXT:reports/Resources/Private/Language/locallang_servicereport.xlf:description" /></th>
|
||||
<th><f:translate key="LLL:EXT:reports/Resources/Private/Language/locallang_servicereport.xlf:priority" /></th>
|
||||
<th><f:translate key="LLL:EXT:reports/Resources/Private/Language/locallang_servicereport.xlf:quality" /></th>
|
||||
<th style="width: 35%"><f:translate key="LLL:EXT:reports/Resources/Private/Language/locallang_servicereport.xlf:subtypes" /></th>
|
||||
<th><f:translate key="LLL:EXT:reports/Resources/Private/Language/locallang_servicereport.xlf:os" /></th>
|
||||
<th><f:translate key="LLL:EXT:reports/Resources/Private/Language/locallang_servicereport.xlf:externals" /></th>
|
||||
<th><f:translate key="LLL:EXT:reports/Resources/Private/Language/locallang_servicereport.xlf:available" /></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<f:for each="{serviceList.Services}" as="service">
|
||||
<f:render section="ServiceRow" arguments="{service: service}" />
|
||||
</f:for>
|
||||
</tbody>
|
||||
</table>
|
||||
</f:section>
|
||||
|
||||
<f:section name="ServiceRow">
|
||||
<tr class="service {service.AvailabilityClass}">
|
||||
<td>{service.Information.title} ({service.Information.extKey})</td>
|
||||
<td class="first-cell">{service.Description}
|
||||
<f:if condition="{service.Information.description}">
|
||||
<p class="service-description">{service.Information.description}</p>
|
||||
</f:if>
|
||||
<code>{service.Key}</code>
|
||||
</td>
|
||||
<td class="cell">{service.Information.priority}</td>
|
||||
<td class="cell">{service.Information.quality}</td>
|
||||
<td class="cell">{service.Subtypes}</td>
|
||||
<td class="cell">{service.OperatingSystem}</td>
|
||||
<td class="cell">{service.RequiredExecutables}</td>
|
||||
<td class="last-cell">{service.Available}</td>
|
||||
</tr>
|
||||
</f:section>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 733 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path fill="#8B2F60" d="M0 0h64v64H0z"/><path fill="#FFF" d="M45 50H17a1 1 0 0 1-1-1V15a1 1 0 0 1 1-1h28a1 1 0 0 1 1 1v34a1 1 0 0 1-1 1z"/><path fill="#8B2F60" d="M42 42h4v2h-4zM42 34h4v2h-4z"/><path fill="#8B2F60" d="M42 26h2v24h-2z"/><path fill="#8B2F60" d="M42 26h4v2h-4zM20 18h16v2H20zM20 22h10v2H20zM20 26h10v2H20zM20 34h4v12h-4zM26 38h4v8h-4zM32 32h4v14h-4z"/></svg>
|
||||
|
After Width: | Height: | Size: 432 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"name": "typo3/cms-reports",
|
||||
"type": "typo3-cms-framework",
|
||||
"description": "The reports module groups several system reports.",
|
||||
"homepage": "https://typo3.org",
|
||||
"license": ["GPL-2.0-or-later"],
|
||||
"authors": [{
|
||||
"name": "TYPO3 Core Team",
|
||||
"email": "typo3cms@typo3.org",
|
||||
"role": "Developer"
|
||||
}],
|
||||
"config": {
|
||||
"sort-packages": true
|
||||
},
|
||||
"require": {
|
||||
"typo3/cms-core": "9.5.31"
|
||||
},
|
||||
"suggest": {
|
||||
"typo3/cms-scheduler": "Determine system's status and send it via email"
|
||||
},
|
||||
"conflict": {
|
||||
"typo3/cms": "*"
|
||||
},
|
||||
"extra": {
|
||||
"typo3/cms": {
|
||||
"Package": {
|
||||
"partOfFactoryDefault": true
|
||||
},
|
||||
"extension-key": "reports"
|
||||
},
|
||||
"typo3/class-alias-loader": {
|
||||
"class-alias-maps": [
|
||||
"Migrations/Code/ClassAliasMap.php"
|
||||
]
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"TYPO3\\CMS\\Reports\\": "Classes/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"TYPO3\\CMS\\Reports\\Tests\\": "Tests/"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
$EM_CONF[$_EXTKEY] = [
|
||||
'title' => 'System Reports',
|
||||
'description' => 'The reports module groups several system reports.',
|
||||
'category' => 'module',
|
||||
'author' => 'TYPO3 Core Team',
|
||||
'author_email' => 'typo3cms@typo3.org',
|
||||
'author_company' => '',
|
||||
'state' => 'stable',
|
||||
'uploadfolder' => 0,
|
||||
'createDirs' => '',
|
||||
'clearCacheOnLoad' => 0,
|
||||
'version' => '9.5.31',
|
||||
'constraints' => [
|
||||
'depends' => [
|
||||
'typo3' => '9.5.31',
|
||||
],
|
||||
'conflicts' => [],
|
||||
'suggests' => [
|
||||
'scheduler' => ''
|
||||
],
|
||||
],
|
||||
];
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
defined('TYPO3_MODE') or die();
|
||||
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Reports\Task\SystemStatusUpdateTask::class] = [
|
||||
'extension' => 'reports',
|
||||
'title' => 'LLL:EXT:reports/Resources/Private/Language/locallang_reports.xlf:status_updateTaskTitle',
|
||||
'description' => 'LLL:EXT:reports/Resources/Private/Language/locallang_reports.xlf:status_updateTaskDescription',
|
||||
'additionalFields' => \TYPO3\CMS\Reports\Task\SystemStatusUpdateTaskNotificationEmailField::class
|
||||
];
|
||||
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['displayWarningMessages']['tx_reports_WarningMessagePostProcessor'] = \TYPO3\CMS\Reports\Report\Status\WarningMessagePostProcessor::class;
|
||||
|
||||
if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status'])) {
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status'] = [];
|
||||
}
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status'] = array_merge(
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status'],
|
||||
[
|
||||
'title' => 'LLL:EXT:reports/Resources/Private/Language/locallang_reports.xlf:status_report_title',
|
||||
'icon' => 'EXT:reports/Resources/Public/Icons/module-reports.svg',
|
||||
'description' => 'LLL:EXT:reports/Resources/Private/Language/locallang_reports.xlf:status_report_description',
|
||||
'report' => \TYPO3\CMS\Reports\Report\Status\Status::class
|
||||
]
|
||||
);
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['typo3'][] = \TYPO3\CMS\Reports\Report\Status\Typo3Status::class;
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['system'][] = \TYPO3\CMS\Reports\Report\Status\SystemStatus::class;
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['security'][] = \TYPO3\CMS\Reports\Report\Status\SecurityStatus::class;
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['configuration'][] = \TYPO3\CMS\Reports\Report\Status\ConfigurationStatus::class;
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['fal'][] = \TYPO3\CMS\Reports\Report\Status\FalStatus::class;
|
||||
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['sv']['services'] = [
|
||||
'title' => 'LLL:EXT:reports/Resources/Private/Language/locallang_servicereport.xlf:report_title',
|
||||
'description' => 'LLL:EXT:reports/Resources/Private/Language/locallang_servicereport.xlf:report_description',
|
||||
'icon' => 'EXT:reports/Resources/Public/Images/service-reports.png',
|
||||
'report' => \TYPO3\CMS\Reports\Report\ServicesListReport::class
|
||||
];
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
defined('TYPO3_MODE') or die();
|
||||
|
||||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule(
|
||||
'system',
|
||||
'reports',
|
||||
'',
|
||||
'',
|
||||
[
|
||||
'routeTarget' => \TYPO3\CMS\Reports\Controller\ReportController::class . '::handleRequest',
|
||||
'access' => 'admin',
|
||||
'name' => 'system_reports',
|
||||
'icon' => 'EXT:reports/Resources/Public/Icons/module-reports.svg',
|
||||
'labels' => 'LLL:EXT:reports/Resources/Private/Language/locallang.xlf'
|
||||
]
|
||||
);
|
||||
Reference in new issue
Block a user