Fixed bug #12025: Make statuses in the status report sorted and grouped
authorSteffen Kamper <info@sk-typo3.de>
Thu, 24 Sep 2009 11:25:43 +0000 (11:25 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Thu, 24 Sep 2009 11:25:43 +0000 (11:25 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6045 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/install/report/class.tx_install_report_installstatus.php
typo3/sysext/reports/ext_autoload.php
typo3/sysext/reports/ext_tables.php
typo3/sysext/reports/mod/mod_styles.css
typo3/sysext/reports/reports/class.tx_reports_reports_status.php
typo3/sysext/reports/reports/locallang.xml
typo3/sysext/reports/reports/status/class.tx_reports_reports_status_configurationstatus.php [new file with mode: 0644]
typo3/sysext/reports/reports/status/class.tx_reports_reports_status_installtoolstatus.php [deleted file]
typo3/sysext/reports/reports/status/class.tx_reports_reports_status_securitystatus.php [new file with mode: 0644]
typo3/sysext/reports/reports/status/class.tx_reports_reports_status_systemstatus.php

index b457d91..8b514c8 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2009-09-24  Steffen Kamper  <info@sk-typo3.de>
 
+       * Fixed bug #12025: Make statuses in the status report sorted and grouped
        * Follow-up to bug #12021: Extension Manager is not translatable (part 8) (thanks to Christopher Stelmaszyk)
        * Cleanup #12053: Cleanup of Extension Manager
        * Fixed bug #12021: Extension Manager is not translatable (part 8) (thanks to Christopher Stelmaszyk)
index e3da157..d7369ab 100644 (file)
@@ -35,7 +35,7 @@ require_once(t3lib_extMgm::extPath('install', 'requirements.php'));
  */
 class tx_install_report_InstallStatus implements tx_reports_StatusProvider {
 
-       protected $reportList = 'Typo3Version,FileSystem,Php,PhpMemoryLimit,PhpRegisterGlobals,Webserver';
+       protected $reportList = 'Typo3Version,FileSystem,RemainingUpdates';
 
        /**
         * Compiles a collection of system status checks as a status report.
@@ -157,100 +157,35 @@ class tx_install_report_InstallStatus implements tx_reports_StatusProvider {
        }
 
        /**
-        * Reports the webserver TYPO3 is running on.
+        * Checks if there are still updates to perform
         *
-        * @return      tx_reports_reports_status_Status        The server software as a status
+        * @return      tx_reports_reports_status_Status        An tx_reports_reports_status_Status object representing whether the installation is not completely updated yet
         */
-       protected function getWebserverStatus() {
-               return t3lib_div::makeInstance('tx_reports_reports_status_Status',
-                       'Web Server',
-                       $_SERVER['SERVER_SOFTWARE']
-               );
-       }
-
-       /**
-        * Checks the current PHP version against a minimum required version.
-        *
-        * @return      tx_reports_reports_status_Status        A status of whether a minimum PHP version requirment is met
-        */
-       protected function getPhpStatus() {
+       protected function getRemainingUpdatesStatus() {
+               $value    = $GLOBALS['LANG']->getLL('status_updateComplete');
                $message  = '';
                $severity = tx_reports_reports_status_Status::OK;
 
-               if (version_compare(phpversion(), TYPO3_REQUIREMENTS_MINIMUM_PHP) < 0) {
-                       $message  = 'Your PHP installation is too old.';
-                       $severity = tx_reports_reports_status_Status::ERROR;
-               }
-
-               return t3lib_div::makeInstance('tx_reports_reports_status_Status',
-                       'PHP',
-                       phpversion(),
-                       $message,
-                       $severity
-               );
-       }
-
-       /**
-        * Checks the current memory limit against a minimum required version.
-        *
-        * @return      tx_reports_reports_status_Status        A status of whether a minimum memory limit requirment is met
-        */
-       protected function getPhpMemoryLimitStatus() {
-               $memoryLimit = ini_get('memory_limit');
-               $message     = '';
-               $severity    = tx_reports_reports_status_Status::OK;
-
-               if ($memoryLimit && t3lib_div::getBytesFromSizeMeasurement($memoryLimit) < t3lib_div::getBytesFromSizeMeasurement(TYPO3_REQUIREMENTS_RECOMMENDED_PHP_MEMORY_LIMIT)) {
-                       $message = 'Depending on your configuration, TYPO3 can run with a ' . $memoryLimit . ' PHP memory limit. However, a ' . TYPO3_REQUIREMENTS_RECOMMENDED_PHP_MEMORY_LIMIT . ' PHP memory limit or above is recommended, especially if your site uses additional extensions.';
+               if (!t3lib_div::compat_version(TYPO3_branch)) {
+                       $value    = $GLOBALS['LANG']->getLL('status_updateIncomplete');
                        $severity = tx_reports_reports_status_Status::WARNING;
-               }
-
-               if ($memoryLimit && t3lib_div::getBytesFromSizeMeasurement($memoryLimit) < t3lib_div::getBytesFromSizeMeasurement(TYPO3_REQUIREMENTS_MINIMUM_PHP_MEMORY_LIMIT)) {
-                       $message = 'Depending on your configuration, TYPO3 can run with a ' . $memoryLimit . ' PHP memory limit. However, a ' . TYPO3_REQUIREMENTS_MINIMUM_PHP_MEMORY_LIMIT . ' PHP memory limit or above is required, especially if your site uses additional extensions.';
-                       $severity = tx_reports_reports_status_Status::ERROR;
-               }
 
-               if ($severity > tx_reports_reports_status_Status::OK) {
-                       if ($php_ini_path = get_cfg_var('cfg_file_path')) {
-                               $message .= ' Increase the memory limit by editing the memory_limit parameter in the file ' . $php_ini_path . ' and then restart your web server (or contact your system administrator or hosting provider for assistance).';
-                       } else {
-                               $message .= ' Contact your system administrator or hosting provider for assistance with increasing your PHP memory limit.';
-                       }
+                       $url = 'install/index.php?redirect_url=index.php'
+                               . urlencode('?TYPO3_INSTALL[type]=update');
+                       $message  = sprintf(
+                               $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.install_update'),
+                               '<a href="' . $url . '">',
+                               '</a>'
+                       );
                }
 
                return t3lib_div::makeInstance('tx_reports_reports_status_Status',
-                       'PHP Memory Limit', $memoryLimit, $message, $severity
-               );
-       }
-
-       /**
-        * checks whether register globals is on or off.
-        *
-        * @return      tx_reports_reports_status_Status        A status of whether register globals is on or off
-        */
-       protected function getPhpRegisterGlobalsStatus() {
-               $value    = $GLOBALS['LANG']->getLL('status_disabled');
-               $message  = '';
-               $severity = tx_reports_reports_status_Status::OK;
-
-               $registerGlobals = trim(ini_get('register_globals'));
-
-                       // can't reliably check for 'on', therefore checking for the oposite 'off', '', or 0
-               if (!empty($registerGlobals) && strtolower($registerGlobals) != 'off') {
-                       $message = '<em>register_globals</em> is enabled. TYPO3 requires this configuration directive to be disabled. Your site may not be secure when <em>register_globals</em> is enabled. The PHP manual has instructions for <a href="http://php.net/configuration.changes">how to change configuration settings</a>.';
-                       $severity = tx_reports_reports_status_Status::ERROR;
-                       $value = $GLOBALS['LANG']->getLL('status_enabled')
-                               . ' (\'' . $registerGlobals . '\')';
-               }
-
-               return t3lib_div::makeInstance('tx_reports_reports_status_Status',
-                       'PHP Register Globals', $value, $message, $severity
+                       'Remaining Updates', $value, $message, $severity
                );
        }
 
 }
 
-
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/install/report/class.tx_install_report_installstatus.php'])   {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/install/report/class.tx_install_report_installstatus.php']);
 }
index 335a1f1..0d6e0d5 100644 (file)
@@ -10,8 +10,9 @@ return array(
        'tx_reports_report' => $extensionPath . 'interfaces/interface.tx_reports_report.php',
        'tx_reports_module' => $extensionPath . 'mod/index.php',
        'tx_reports_reports_status' => $extensionPath . 'reports/class.tx_reports_reports_status.php',
-       'tx_reports_reports_status_installtoolstatus' => $extensionPath . 'reports/status/class.tx_reports_reports_status_installtoolstatus.php',
        'tx_reports_reports_status_systemstatus' => $extensionPath . 'reports/status/class.tx_reports_reports_status_systemstatus.php',
+       'tx_reports_reports_status_securitystatus' => $extensionPath . 'reports/status/class.tx_reports_reports_status_securitystatus.php',
+       'tx_reports_reports_status_configurationstatus' => $extensionPath . 'reports/status/class.tx_reports_reports_status_configurationstatus.php',
        'tx_reports_reports_status_status' => $extensionPath . 'reports/status/class.tx_reports_reports_status_status.php',
 );
 ?>
index b817dbf..53a58a9 100644 (file)
@@ -19,7 +19,8 @@ if (TYPO3_MODE == 'BE') {
        );
 
        $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['system'] = 'tx_reports_reports_status_SystemStatus';
-       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['_installtool'] = 'tx_reports_reports_status_InstallToolStatus';
+       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['security'] = 'tx_reports_reports_status_SecurityStatus';
+       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['configuration'] = 'tx_reports_reports_status_ConfigurationStatus';
 
 }
 
index 5f1efcb..5580d6f 100644 (file)
@@ -5,6 +5,7 @@ body#ext-reports-mod-index-php {
 
 #typo3-inner-docbody p.help {
        font-size: 12px;
+       margin-bottom: 10px;
 }
 
 
@@ -45,7 +46,9 @@ table.system-status-report td {
        padding: 6px;
        font-size: 12px;
 }
-
+table.system-status-report th {
+       width: 300px;
+}
 table.system-status-report th a,
 table.system-status-report td a {
        color: #000;
index ed0f451..dd283c0 100644 (file)
@@ -52,8 +52,15 @@ class tx_reports_reports_Status implements tx_reports_Report {
                $status  = array();
                $content = '';
 
-               foreach ($this->statusProviders as $statusProvider) {
-                       $status += $statusProvider->getStatus();
+               foreach ($this->statusProviders as $statusProviderId => $statusProvider) {
+                       if (strcmp(substr($statusProviderId, 0, 4), 'LLL:')) {
+                               $providerLabel = $GLOBALS['LANG']->getLL('status_' . $statusProviderId);
+                       } else {
+                                       // label from extension
+                               $providerLabel = $GLOBALS['LANG']->sL($statusProviderId);
+                       }
+                       $provider = $providerLabel ? $providerLabel : $statusProviderId;
+                       $status[$provider] = $statusProvider->getStatus();
                }
 
                $content .= '<p class="help">'
@@ -69,8 +76,6 @@ class tx_reports_reports_Status implements tx_reports_Report {
         * @return      void
         */
        protected function getStatusProviders() {
-               ksort($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']);
-
                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status'] as $key => $statusProvider) {
                        if (t3lib_div::inList('title,description,report', $key)) {
                                continue; // skip (for this report) unneccessary data
@@ -84,34 +89,97 @@ class tx_reports_reports_Status implements tx_reports_Report {
        }
 
        /**
-        * Renders the system's status
+        * Renders the system's status
         *
         * @param       array   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 = '<table class="system-status-report">';
-               $classes = array(
-                       tx_reports_reports_status_Status::NOTICE  => 'notice',
-                       tx_reports_reports_status_Status::INFO    => 'information',
-                       tx_reports_reports_status_Status::OK      => 'ok',
-                       tx_reports_reports_status_Status::WARNING => 'warning',
-                       tx_reports_reports_status_Status::ERROR   => 'error',
+               $content = '';
+
+               $statuses = $this->sortStatusProviders($statusCollection);
+
+               foreach($statuses as $provider => $providerStatus) {
+                       $providerState = $this->sortStatuses($providerStatus);
+
+                       $content .= '<h2>' . $provider . '</h2>';
+                       $content .= '<table class="system-status-report">';
+                       $classes = array(
+                               tx_reports_reports_status_Status::NOTICE  => 'notice',
+                               tx_reports_reports_status_Status::INFO    => 'information',
+                               tx_reports_reports_status_Status::OK      => 'ok',
+                               tx_reports_reports_status_Status::WARNING => 'warning',
+                               tx_reports_reports_status_Status::ERROR   => 'error',
+                       );
+
+                       foreach ($providerState as $status) {
+                               $class = 'typo3-message message-' . $classes[$status->getSeverity()];
+                               $description = $status->getMessage();
+       
+                               if (empty($description)) {
+                                       $content .= '<tr><th class="'. $class .' statusTitle">'. $status->getTitle() .'</th><td class="'. $class .'">'. $status->getValue() .'</td></tr>';
+                               } else {
+                                       $content .= '<tr><th class="'. $class .' merge-down">'. $status->getTitle() .'</th><td class="'. $class .' merge-down">'. $status->getValue() .'</td></tr>';
+                                       $content .= '<tr><td class="'. $class .' merge-up" colspan="2">'. $description .'</td></tr>';
+                               }
+                       }
+       
+                       $content .= '</table>';
+               }
+               return $content;
+       }
+       
+       /**
+        * sorts the status providers (alphabetically and adds "_install" provider at the beginning)
+        *
+        * @param   array   A collection of statuses (with providers)
+        * @return  array   The collection of statuses sorted by provider (beginning with provider "_install")
+        */
+       protected function sortStatusProviders(array $statusCollection) {
+               $systemStatus = array(
+                       'TYPO3 System'  => $statusCollection['Installation'],
+                       'System'        => $statusCollection['System'],
+                       'Security'      => $statusCollection['security'],
+                       'Configuration' => $statusCollection['configuration'],
                );
+               unset(
+                       $statusCollection['Installation'],
+                       $statusCollection['System'],
+                       $statusCollection['security'],
+                       $statusCollection['configuration']
+               );
+               ksort($statusCollection);
+               $statusCollection = array_merge($systemStatus, $statusCollection);
 
-               foreach ($statusCollection as $status) {
-                       $class = 'typo3-message message-' . $classes[$status->getSeverity()];
-                       $description = $status->getMessage();
+               return $statusCollection;
+       }
+       
+       /**
+        * Sorts the statuses by severity
+        *
+        * @param   array   A collection of statuses per provider
+        * @return  array   The collection of statuses sorted by severity
+        */
+       protected function sortStatuses(array $statusCollection) {
+               $statuses  = array();
+               $sortTitle = array();
 
-                       if (empty($description)) {
-                               $content .= '<tr><th class="'. $class .'">'. $status->getTitle() .'</th><td class="'. $class .'">'. $status->getValue() .'</td></tr>';
-                       } else {
-                               $content .= '<tr><th class="'. $class .' merge-down">'. $status->getTitle() .'</th><td class="'. $class .' merge-down">'. $status->getValue() .'</td></tr>';
-                               $content .= '<tr><td class="'. $class .' merge-up" colspan="2">'. $description .'</td></tr>';
+               foreach ($statusCollection as $status) {
+                       if ($status->getTitle() === 'TYPO3') {
+                               $header = $status;
+                               continue;
                        }
+
+                       $statuses[] = $status;
+                       $sortTitle[] = $status->getSeverity();
                }
+               array_multisort($sortTitle, SORT_DESC, $statuses);
 
-               return $content . '</table>';
+                       // making sure that the core version information is always on the top
+               if(is_object($header)) {
+                       array_unshift($statuses, $header);
+               }
+               return $statuses;
        }
 }
 
index 8b83500..17d9484 100644 (file)
@@ -17,6 +17,8 @@
                        <label index="status_connectionFailed">Connection Failed</label>
                        <label index="status_updateComplete">Update Complete</label>
                        <label index="status_updateIncomplete">Update Incomplete</label>
+                       <label index="status__install">Installation</label>
+                       <label index="status_system">System</label>
                </languageKey>
        </data>
 </T3locallang>
\ No newline at end of file
diff --git a/typo3/sysext/reports/reports/status/class.tx_reports_reports_status_configurationstatus.php b/typo3/sysext/reports/reports/status/class.tx_reports_reports_status_configurationstatus.php
new file mode 100644 (file)
index 0000000..bae08b5
--- /dev/null
@@ -0,0 +1,185 @@
+<?php\r
+/***************************************************************\r
+*  Copyright notice\r
+*\r
+*  (c) 2009 Ingo Renner <ingo@typo3.org>\r
+*  All rights reserved\r
+*\r
+*  This script is part of the TYPO3 project. The TYPO3 project is\r
+*  free software; you can redistribute it and/or modify\r
+*  it under the terms of the GNU General Public License as published by\r
+*  the Free Software Foundation; either version 2 of the License, or\r
+*  (at your option) any later version.\r
+*\r
+*  The GNU General Public License can be found at\r
+*  http://www.gnu.org/copyleft/gpl.html.\r
+*\r
+*  This script is distributed in the hope that it will be useful,\r
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+*  GNU General Public License for more details.\r
+*\r
+*  This copyright notice MUST APPEAR in all copies of the script!\r
+***************************************************************/\r
+\r
+\r
+/**\r
+ * Performs some checks about the install tool protection status\r
+ *\r
+ * @author     Ingo Renner <ingo@typo3.org>\r
+ * @package TYPO3\r
+ * @subpackage reports\r
+ */\r
+class tx_reports_reports_status_ConfigurationStatus implements tx_reports_StatusProvider {\r
+\r
+       /**\r
+        * Determines the Install Tool's status, mainly concerning its protection.\r
+        *\r
+        * @see typo3/sysext/reports/interfaces/tx_reports_StatusProvider::getStatus()\r
+        */\r
+       public function getStatus() {\r
+               $statuses = array(\r
+                       'emptyReferenceIndex' => $this->getReferenceIndexStatus(),\r
+                       \r
+               );\r
+\r
+               if ($this->isMemcachedUsed()) {\r
+                       $statuses['memcachedConnection'] = $this->getMemcachedConnectionStatus();\r
+               }\r
+\r
+               return $statuses;\r
+       }\r
+\r
+       /**\r
+        * Checks if sys_refindex is empty.\r
+        *\r
+        * @return      tx_reports_reports_status_Status        An tx_reports_reports_status_Status object representing whether the reference index is empty or not\r
+        */\r
+       protected function getReferenceIndexStatus() {\r
+               $value    = $GLOBALS['LANG']->getLL('status_ok');\r
+               $message  = '';\r
+               $severity = tx_reports_reports_status_Status::OK;\r
+\r
+               $count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('*', 'sys_refindex');\r
+\r
+               if (!$count) {\r
+                       $value    = $GLOBALS['LANG']->getLL('status_empty');\r
+                       $severity = tx_reports_reports_status_Status::WARNING;\r
+\r
+                       $url = 'sysext/lowlevel/dbint/index.php?&id=0&SET[function]=refindex';\r
+                       $message  = sprintf(\r
+                               $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.backend_reference'),\r
+                               '<a href="' . $url . '">',\r
+                               '</a>'\r
+                       );\r
+               }\r
+\r
+               return t3lib_div::makeInstance('tx_reports_reports_status_Status',\r
+                       'Reference Index', $value, $message, $severity\r
+               );\r
+       }\r
+\r
+       /**\r
+        * Checks whether memcached is configured, if that's the case we asume it's also used.\r
+        *\r
+        * @return      boolean True if memcached is used, false otherwise.\r
+        */\r
+       protected function isMemcachedUsed() {\r
+               $memcachedUsed = false;\r
+\r
+               $memcachedServers = $this->getConfiguredMemcachedServers();\r
+               if (count($memcachedServers)) {\r
+                       $memcachedUsed = true;\r
+               }\r
+\r
+               return $memcachedUsed;\r
+       }\r
+\r
+       /**\r
+        * Gets the configured memcached server connections.\r
+        *\r
+        * @return      array   An array of configured memcached server connections.\r
+        */\r
+       protected function getConfiguredMemcachedServers() {\r
+               $memcachedServers = array();\r
+\r
+               if (is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'])) {\r
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'] as $table => $conf) {\r
+                               if (is_array($conf)) {\r
+                                       foreach ($conf as $key => $value) {\r
+                                               if (!is_array($value) && $value === 't3lib_cache_backend_MemcachedBackend') {\r
+                                                       $memcachedServers = $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$table]['options']['servers'];\r
+                                                       break;\r
+                                               }\r
+                                       }\r
+                               }\r
+                       }\r
+               }\r
+\r
+               return $memcachedServers;\r
+       }\r
+\r
+       /**\r
+        * Checks whether TYPO3 can connect to the configured memcached servers.\r
+        *\r
+        * @return      tx_reports_reports_status_Status        An tx_reports_reports_status_Status object representing whether TYPO3 can connect to the configured memcached servers\r
+        */\r
+       protected function getMemcachedConnectionStatus() {\r
+               $value    = $GLOBALS['LANG']->getLL('status_ok');\r
+               $message  = '';\r
+               $severity = tx_reports_reports_status_Status::OK;\r
+\r
+               $failedConnections    = array();\r
+               $defaultMemcachedPort = ini_get('memcache.default_port');\r
+               $memcachedServers     = $this->getConfiguredMemcachedServers();\r
+\r
+               if (function_exists('memcache_connect') && is_array($memcachedServers)) {\r
+                       foreach ($memcachedServers as $testServer) {\r
+                               $configuredServer = $testServer;\r
+                               if (substr($testServer, 0, 7) == 'unix://') {\r
+                                       $host = $testServer;\r
+                                       $port = 0;\r
+                               } else {\r
+                                       if (substr($testServer, 0, 6) === 'tcp://') {\r
+                                               $testServer = substr($testServer, 6);\r
+                                       }\r
+                                       if (strstr($testServer, ':') !== FALSE) {\r
+                                               list($host, $port) = explode(':', $testServer, 2);\r
+                                       } else {\r
+                                               $host = $testServer;\r
+                                               $port = $defaultPort;\r
+                                       }\r
+                               }\r
+                               $memcachedConnection = @memcache_connect($host, $port);\r
+                               if ($memcachedConnection != null) {\r
+                                       memcache_close($memcachedConnection);\r
+                               } else {\r
+                                       $failedConnections[] = $configuredServer;\r
+                               }\r
+                       }\r
+               }\r
+\r
+               if (count($failedConnections)) {\r
+                       $value    = $GLOBALS['LANG']->getLL('status_connectionFailed');\r
+                       $severity = tx_reports_reports_status_Status::WARNING;\r
+\r
+                       $message = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.memcache_not_usable')\r
+                               . '<br /><br />'\r
+                               . '<ul><li>'\r
+                               . implode('</li><li>', $failedConnections)\r
+                               . '</li></ul>';\r
+               }\r
+\r
+               return t3lib_div::makeInstance('tx_reports_reports_status_Status',\r
+                       'Memcached Configuration', $value, $message, $severity\r
+               );\r
+       }\r
+\r
+}\r
+\r
+\r
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/reports/reports/status/class.tx_reports_reports_status_installtoolstatus.php'])       {\r
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/reports/reports/status/class.tx_reports_reports_status_installtoolstatus.php']);\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/typo3/sysext/reports/reports/status/class.tx_reports_reports_status_installtoolstatus.php b/typo3/sysext/reports/reports/status/class.tx_reports_reports_status_installtoolstatus.php
deleted file mode 100644 (file)
index 504ae9a..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-<?php
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2009 Ingo Renner <ingo@typo3.org>
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project 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.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*
-*  This script 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.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-
-/**
- * Performs some checks about the install tool protection status
- *
- * @author     Ingo Renner <ingo@typo3.org>
- * @package TYPO3
- * @subpackage reports
- */
-class tx_reports_reports_status_InstallToolStatus implements tx_reports_StatusProvider {
-
-       /**
-        * Determines the Install Tool's status, mainly concerning its protection.
-        *
-        * @see typo3/sysext/reports/interfaces/tx_reports_StatusProvider::getStatus()
-        */
-       public function getStatus() {
-               $this->executeAdminCommand();
-
-               return array(
-                       'installToolEnabled'  => $this->getInstallToolProtectionStatus(),
-                       'installToolPassword' => $this->getInstallToolPasswordStatus(),
-                       'adminUserAccount'    => $this->getAdminAccountStatus()
-               );
-       }
-
-       /**
-        * Executes commands like removing the Install Tool enable file.
-        *
-        * @return      void
-        */
-       protected function executeAdminCommand() {
-               $command = t3lib_div::_GET('adminCmd');
-
-               switch($command) {
-                       case 'remove_ENABLE_INSTALL_TOOL':
-                               unlink(PATH_site . 'typo3conf/ENABLE_INSTALL_TOOL');
-                       break;
-               }
-       }
-
-       /**
-        * Checks whether the Install Tool password is set to its default value.
-        *
-        * @return      tx_reports_reports_status_Status        An tx_reports_reports_status_Status object representing the security of the install tool password
-        */
-       protected function getInstallToolPasswordStatus() {
-               $value    = $GLOBALS['LANG']->getLL('status_ok');
-               $message  = '';
-               $severity = tx_reports_reports_status_Status::OK;
-
-               if ($GLOBALS['TYPO3_CONF_VARS']['BE']['installToolPassword'] == md5('joh316')) {
-                       $value    = $GLOBALS['LANG']->getLL('status_insecure');
-                       $severity = tx_reports_reports_status_Status::ERROR;
-
-                       $changeInstallToolPasswordUrl = 'install/index.php?redirect_url=index.php'
-                               . urlencode('?TYPO3_INSTALL[type]=about');
-
-                       $message = sprintf(
-                               $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.install_password'),
-                               '<a href="' . $changeInstallToolPasswordUrl . '">',
-                               '</a>'
-                       );
-               }
-
-               return t3lib_div::makeInstance('tx_reports_reports_status_Status',
-                       'Install Tool Password', $value, $message, $severity
-               );
-       }
-
-       /**
-        * Checks whether a an BE user account named admin with default password exists.
-        *
-        * @return      tx_reports_reports_status_Status        An tx_reports_reports_status_Status object representing whether a default admin account exists
-        */
-       protected function getAdminAccountStatus() {
-               $value    = $GLOBALS['LANG']->getLL('status_ok');
-               $message  = '';
-               $severity = tx_reports_reports_status_Status::OK;
-
-               $whereClause = 'username = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr('admin', 'be_users')
-                       . ' AND password = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr('5f4dcc3b5aa765d61d8327deb882cf99', 'be_users')
-                       . t3lib_BEfunc::deleteClause('be_users');
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
-                       'uid, username, password',
-                       'be_users',
-                       $whereClause
-               );
-               if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                       $value    = $GLOBALS['LANG']->getLL('status_insecure');
-                       $severity = tx_reports_reports_status_Status::ERROR;
-
-                       $editUserAccountUrl = 'alt_doc.php?returnUrl=index.php&edit[be_users][' . $row['uid'] . ']=edit';
-                       $message = sprintf(
-                               $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.backend_admin'),
-                               '<a href="' . $editUserAccountUrl . '">',
-                               '</a>'
-                       );
-               }
-               $GLOBALS['TYPO3_DB']->sql_free_result($res);
-
-               return t3lib_div::makeInstance('tx_reports_reports_status_Status',
-                       'Admin User Account', $value, $message, $severity
-               );
-       }
-
-       /**
-        * Checks for the existance of the ENABLE_INSTALL_TOOL file.
-        *
-        * @return      tx_reports_reports_status_Status        An tx_reports_reports_status_Status object representing whether ENABLE_INSTALL_TOOL exists
-        */
-       protected function getInstallToolProtectionStatus() {
-               $enableInstallToolFile = PATH_site . 'typo3conf/ENABLE_INSTALL_TOOL';
-               $value    = $GLOBALS['LANG']->getLL('status_disabled');
-               $message  = '';
-               $severity = tx_reports_reports_status_Status::OK;
-
-               $enableInstallToolFileExists = is_file($enableInstallToolFile);
-
-               if ($enableInstallToolFileExists || ($enableInstallToolFileExists && trim(file_get_contents($enableInstallToolFile)) === 'KEEP_FILE')) {
-                       $value    = $GLOBALS['LANG']->getLL('status_enabled');
-                       $severity = tx_reports_reports_status_Status::WARNING;
-
-                       $disableInstallToolUrl = t3lib_div::getIndpEnv('TYPO3_REQUEST_URL')
-                               . '&adminCmd=remove_ENABLE_INSTALL_TOOL';
-
-                       $message = sprintf(
-                               $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.install_enabled'),
-                               '<span style="white-space: nowrap;">' . $enableInstallToolFile . '</span>');
-                       $message .= ' <a href="' . $disableInstallToolUrl . '">'
-                               . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.install_enabled_cmd')
-                               . '</a>';
-               }
-
-               return t3lib_div::makeInstance('tx_reports_reports_status_Status',
-                       'Install Tool', $value, $message, $severity
-               );
-       }
-}
-
-
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/reports/reports/status/class.tx_reports_reports_status_installtoolstatus.php'])       {
-       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/reports/reports/status/class.tx_reports_reports_status_installtoolstatus.php']);
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/reports/reports/status/class.tx_reports_reports_status_securitystatus.php b/typo3/sysext/reports/reports/status/class.tx_reports_reports_status_securitystatus.php
new file mode 100644 (file)
index 0000000..e3130e9
--- /dev/null
@@ -0,0 +1,275 @@
+<?php\r
+/***************************************************************\r
+*  Copyright notice\r
+*\r
+*  (c) 2009 Ingo Renner <ingo@typo3.org>\r
+*  All rights reserved\r
+*\r
+*  This script is part of the TYPO3 project. The TYPO3 project is\r
+*  free software; you can redistribute it and/or modify\r
+*  it under the terms of the GNU General Public License as published by\r
+*  the Free Software Foundation; either version 2 of the License, or\r
+*  (at your option) any later version.\r
+*\r
+*  The GNU General Public License can be found at\r
+*  http://www.gnu.org/copyleft/gpl.html.\r
+*\r
+*  This script is distributed in the hope that it will be useful,\r
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+*  GNU General Public License for more details.\r
+*\r
+*  This copyright notice MUST APPEAR in all copies of the script!\r
+***************************************************************/\r
+\r
+\r
+/**\r
+ * Performs several checks about the system's health\r
+ *\r
+ * @author     Ingo Renner <ingo@typo3.org>\r
+ * @package TYPO3\r
+ * @subpackage reports\r
+ */\r
+class tx_reports_reports_status_SecurityStatus implements tx_reports_StatusProvider {\r
+\r
+       /**\r
+        * Determines the Install Tool's status, mainly concerning its protection.\r
+        *\r
+        * @see typo3/sysext/reports/interfaces/tx_reports_StatusProvider::getStatus()\r
+        */\r
+       public function getStatus() {\r
+               $this->executeAdminCommand();\r
+               \r
+               $statuses = array(\r
+                       'adminUserAccount'    => $this->getAdminAccountStatus(),\r
+                       'encryptionKeyEmpty'  => $this->getEncryptionKeyStatus(),\r
+                       'fileDenyPattern'     => $this->getFileDenyPatternStatus(),\r
+                       'htaccessUpload'      => $this->getHtaccessUploadStatus(),\r
+                       'installToolEnabled'  => $this->getInstallToolProtectionStatus(),\r
+                       'installToolPassword' => $this->getInstallToolPasswordStatus(),\r
+               );\r
+\r
+               return $statuses;\r
+       }\r
+\r
+       /**\r
+        * Checks whether a an BE user account named admin with default password exists.\r
+        *\r
+        * @return      tx_reports_reports_status_Status        An tx_reports_reports_status_Status object representing whether a default admin account exists\r
+        */\r
+       protected function getAdminAccountStatus() {\r
+               $value    = $GLOBALS['LANG']->getLL('status_ok');\r
+               $message  = '';\r
+               $severity = tx_reports_reports_status_Status::OK;\r
+\r
+               $whereClause = 'username = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr('admin', 'be_users')\r
+                       . ' AND password = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr('5f4dcc3b5aa765d61d8327deb882cf99', 'be_users')\r
+                       . t3lib_BEfunc::deleteClause('be_users');\r
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\r
+                       'uid, username, password',\r
+                       'be_users',\r
+                       $whereClause\r
+               );\r
+               if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\r
+                       $value    = $GLOBALS['LANG']->getLL('status_insecure');\r
+                       $severity = tx_reports_reports_status_Status::ERROR;\r
+\r
+                       $editUserAccountUrl = 'alt_doc.php?returnUrl=index.php&edit[be_users][' . $row['uid'] . ']=edit';\r
+                       $message = sprintf(\r
+                               $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.backend_admin'),\r
+                               '<a href="' . $editUserAccountUrl . '">',\r
+                               '</a>'\r
+                       );\r
+               }\r
+               $GLOBALS['TYPO3_DB']->sql_free_result($res);\r
+\r
+               return t3lib_div::makeInstance('tx_reports_reports_status_Status',\r
+                       'Admin User Account', $value, $message, $severity\r
+               );\r
+       }\r
+\r
+       /**\r
+        * Checks whether the encryption key is empty.\r
+        *\r
+        * @return      tx_reports_reports_status_Status        An tx_reports_reports_status_Status object representing whether the encryption key is empty or not\r
+        */\r
+       protected function getEncryptionKeyStatus() {\r
+               $value    = $GLOBALS['LANG']->getLL('status_ok');\r
+               $message  = '';\r
+               $severity = tx_reports_reports_status_Status::OK;\r
+\r
+               if (empty($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'])) {\r
+                       $value    = $GLOBALS['LANG']->getLL('status_insecure');\r
+                       $severity = tx_reports_reports_status_Status::ERROR;\r
+\r
+                       $url = 'install/index.php?redirect_url=index.php'\r
+                               . urlencode('?TYPO3_INSTALL[type]=config#set_encryptionKey');\r
+\r
+                       $message = sprintf(\r
+                               $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.install_encryption'),\r
+                               '<a href="' . $url . '">',\r
+                               '</a>'\r
+                       );\r
+               }\r
+\r
+               return t3lib_div::makeInstance('tx_reports_reports_status_Status',\r
+                       'Encryption Key', $value, $message, $severity\r
+               );\r
+       }\r
+\r
+       /**\r
+        * Checks if fileDenyPattern was changed which is dangerous on Apache\r
+        *\r
+        * @return      tx_reports_reports_status_Status        An tx_reports_reports_status_Status object representing whether the file deny pattern has changed\r
+        */\r
+       protected function getFileDenyPatternStatus() {\r
+               $value    = $GLOBALS['LANG']->getLL('status_ok');\r
+               $message  = '';\r
+               $severity = tx_reports_reports_status_Status::OK;\r
+\r
+               if ($GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'] != FILE_DENY_PATTERN_DEFAULT) {\r
+                       $value    = $GLOBALS['LANG']->getLL('status_insecure');\r
+                       $severity = tx_reports_reports_status_Status::ERROR;\r
+\r
+                       $url = 'install/index.php?redirect_url=index.php'\r
+                               . urlencode('?TYPO3_INSTALL[type]=config#set_encryptionKey');\r
+\r
+                       $message = sprintf(\r
+                               $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.file_deny_pattern'),\r
+                               '<br /><pre>'\r
+                               . htmlspecialchars(FILE_DENY_PATTERN_DEFAULT)\r
+                               . '</pre><br />'\r
+                       );\r
+               }\r
+\r
+               return t3lib_div::makeInstance('tx_reports_reports_status_Status',\r
+                       'File Deny Pattern', $value, $message, $severity\r
+               );\r
+       }\r
+\r
+       /**\r
+        * Checks if fileDenyPattern allows to upload .htaccess files which is\r
+        * dangerous on Apache.\r
+        *\r
+        * @return      tx_reports_reports_status_Status        An tx_reports_reports_status_Status object representing whether it's possible to upload .htaccess files\r
+        */\r
+       protected function getHtaccessUploadStatus() {\r
+               $value    = $GLOBALS['LANG']->getLL('status_ok');\r
+               $message  = '';\r
+               $severity = tx_reports_reports_status_Status::OK;\r
+\r
+               if ($GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'] != FILE_DENY_PATTERN_DEFAULT && t3lib_div::verifyFilenameAgainstDenyPattern('.htaccess')) {\r
+                       $value    = $GLOBALS['LANG']->getLL('status_insecure');\r
+                       $severity = tx_reports_reports_status_Status::ERROR;\r
+                       $message  = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.file_deny_htaccess');\r
+               }\r
+\r
+               return t3lib_div::makeInstance('tx_reports_reports_status_Status',\r
+                       '.htaccess Upload Protection', $value, $message, $severity\r
+               );\r
+       }\r
+\r
+       /**\r
+        * Checks whether memcached is configured, if that's the case we asume it's also used.\r
+        *\r
+        * @return      boolean True if memcached is used, false otherwise.\r
+        */\r
+       protected function isMemcachedUsed() {\r
+               $memcachedUsed = false;\r
+\r
+               $memcachedServers = $this->getConfiguredMemcachedServers();\r
+               if (count($memcachedServers)) {\r
+                       $memcachedUsed = true;\r
+               }\r
+\r
+               return $memcachedUsed;\r
+       }\r
+\r
+\r
+       /**\r
+        * Executes commands like removing the Install Tool enable file.\r
+        *\r
+        * @return      void\r
+        */\r
+       protected function executeAdminCommand() {\r
+               $command = t3lib_div::_GET('adminCmd');\r
+\r
+               switch($command) {\r
+                       case 'remove_ENABLE_INSTALL_TOOL':\r
+                               unlink(PATH_site . 'typo3conf/ENABLE_INSTALL_TOOL');\r
+                       break;\r
+               }\r
+       }\r
+\r
+       /**\r
+        * Checks whether the Install Tool password is set to its default value.\r
+        *\r
+        * @return      tx_reports_reports_status_Status        An tx_reports_reports_status_Status object representing the security of the install tool password\r
+        */\r
+       protected function getInstallToolPasswordStatus() {\r
+               $value    = $GLOBALS['LANG']->getLL('status_ok');\r
+               $message  = '';\r
+               $severity = tx_reports_reports_status_Status::OK;\r
+\r
+               if ($GLOBALS['TYPO3_CONF_VARS']['BE']['installToolPassword'] == md5('joh316')) {\r
+                       $value    = $GLOBALS['LANG']->getLL('status_insecure');\r
+                       $severity = tx_reports_reports_status_Status::ERROR;\r
+\r
+                       $changeInstallToolPasswordUrl = 'install/index.php?redirect_url=index.php'\r
+                               . urlencode('?TYPO3_INSTALL[type]=about');\r
+\r
+                       $message = sprintf(\r
+                               $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.install_password'),\r
+                               '<a href="' . $changeInstallToolPasswordUrl . '">',\r
+                               '</a>'\r
+                       );\r
+               }\r
+\r
+               return t3lib_div::makeInstance('tx_reports_reports_status_Status',\r
+                       'Install Tool Password', $value, $message, $severity\r
+               );\r
+       }\r
+\r
+       \r
+\r
+       /**\r
+        * Checks for the existance of the ENABLE_INSTALL_TOOL file.\r
+        *\r
+        * @return      tx_reports_reports_status_Status        An tx_reports_reports_status_Status object representing whether ENABLE_INSTALL_TOOL exists\r
+        */\r
+       protected function getInstallToolProtectionStatus() {\r
+               $enableInstallToolFile = PATH_site . 'typo3conf/ENABLE_INSTALL_TOOL';\r
+               $value    = $GLOBALS['LANG']->getLL('status_disabled');\r
+               $message  = '';\r
+               $severity = tx_reports_reports_status_Status::OK;\r
+\r
+               $enableInstallToolFileExists = is_file($enableInstallToolFile);\r
+\r
+               if ($enableInstallToolFileExists || ($enableInstallToolFileExists && trim(file_get_contents($enableInstallToolFile)) === 'KEEP_FILE')) {\r
+                       $value    = $GLOBALS['LANG']->getLL('status_enabled');\r
+                       $severity = tx_reports_reports_status_Status::WARNING;\r
+\r
+                       $disableInstallToolUrl = t3lib_div::getIndpEnv('TYPO3_REQUEST_URL')\r
+                               . '&adminCmd=remove_ENABLE_INSTALL_TOOL';\r
+\r
+                       $message = sprintf(\r
+                               $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.install_enabled'),\r
+                               '<span style="white-space: nowrap;">' . $enableInstallToolFile . '</span>');\r
+                       $message .= ' <a href="' . $disableInstallToolUrl . '">'\r
+                               . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.install_enabled_cmd')\r
+                               . '</a>';\r
+               }\r
+\r
+               return t3lib_div::makeInstance('tx_reports_reports_status_Status',\r
+                       'Install Tool', $value, $message, $severity\r
+               );\r
+       }\r
+\r
+}\r
+\r
+\r
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/reports/reports/status/class.tx_reports_reports_status_systemstatus.php'])    {\r
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/reports/reports/status/class.tx_reports_reports_status_systemstatus.php']);\r
+}\r
+\r
+?>
\ No newline at end of file
index aed64f7..88e91c9 100644 (file)
@@ -39,251 +39,105 @@ class tx_reports_reports_status_SystemStatus implements tx_reports_StatusProvide
         */
        public function getStatus() {
                $statuses = array(
-                       'encryptionKeyEmpty'  => $this->getEncryptionKeyStatus(),
-                       'fileDenyPattern'     => $this->getFileDenyPatternStatus(),
-                       'htaccessUpload'      => $this->getHtaccessUploadStatus(),
-                       'remainingUdates'     => $this->getRemainingUpdatesStatus(),
-                       'emptyReferenceIndex' => $this->getReferenceIndexStatus()
+                       'Php'                 => $this->getPhpStatus(),
+                       'PhpMemoryLimit'      => $this->getPhpMemoryLimitStatus(),
+                       'PhpRegisterGlobals'  => $this->getPhpRegisterGlobalsStatus(),
+                       'Webserver'           => $this->getWebserverStatus(),
                );
 
-               if ($this->isMemcachedUsed()) {
-                       $statuses['memcachedConnection'] = $this->getMemcachedConnectionStatus();
-               }
-
                return $statuses;
        }
 
+
        /**
-        * Checks whether the encryption key is empty.
+        * Checks the current PHP version against a minimum required version.
         *
-        * @return      tx_reports_reports_status_Status        An tx_reports_reports_status_Status object representing whether the encryption key is empty or not
+        * @return      tx_reports_reports_status_Status        A status of whether a minimum PHP version requirment is met
         */
-       protected function getEncryptionKeyStatus() {
-               $value    = $GLOBALS['LANG']->getLL('status_ok');
+       protected function getPhpStatus() {
                $message  = '';
                $severity = tx_reports_reports_status_Status::OK;
 
-               if (empty($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'])) {
-                       $value    = $GLOBALS['LANG']->getLL('status_insecure');
+               if (version_compare(phpversion(), TYPO3_REQUIREMENTS_MINIMUM_PHP) < 0) {
+                       $message  = 'Your PHP installation is too old.';
                        $severity = tx_reports_reports_status_Status::ERROR;
-
-                       $url = 'install/index.php?redirect_url=index.php'
-                               . urlencode('?TYPO3_INSTALL[type]=config#set_encryptionKey');
-
-                       $message = sprintf(
-                               $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.install_encryption'),
-                               '<a href="' . $url . '">',
-                               '</a>'
-                       );
                }
 
                return t3lib_div::makeInstance('tx_reports_reports_status_Status',
-                       'Encryption Key', $value, $message, $severity
+                       'PHP',
+                       phpversion(),
+                       $message,
+                       $severity
                );
        }
 
        /**
-        * Checks if fileDenyPattern was changed which is dangerous on Apache
+        * Checks the current memory limit against a minimum required version.
         *
-        * @return      tx_reports_reports_status_Status        An tx_reports_reports_status_Status object representing whether the file deny pattern has changed
+        * @return      tx_reports_reports_status_Status        A status of whether a minimum memory limit requirment is met
         */
-       protected function getFileDenyPatternStatus() {
-               $value    = $GLOBALS['LANG']->getLL('status_ok');
-               $message  = '';
-               $severity = tx_reports_reports_status_Status::OK;
-
-               if ($GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'] != FILE_DENY_PATTERN_DEFAULT) {
-                       $value    = $GLOBALS['LANG']->getLL('status_insecure');
-                       $severity = tx_reports_reports_status_Status::ERROR;
+       protected function getPhpMemoryLimitStatus() {
+               $memoryLimit = ini_get('memory_limit');
+               $message     = '';
+               $severity    = tx_reports_reports_status_Status::OK;
 
-                       $url = 'install/index.php?redirect_url=index.php'
-                               . urlencode('?TYPO3_INSTALL[type]=config#set_encryptionKey');
-
-                       $message = sprintf(
-                               $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.file_deny_pattern'),
-                               '<br /><pre>'
-                               . htmlspecialchars(FILE_DENY_PATTERN_DEFAULT)
-                               . '</pre><br />'
-                       );
+               if ($memoryLimit && t3lib_div::getBytesFromSizeMeasurement($memoryLimit) < t3lib_div::getBytesFromSizeMeasurement(TYPO3_REQUIREMENTS_RECOMMENDED_PHP_MEMORY_LIMIT)) {
+                       $message = 'Depending on your configuration, TYPO3 can run with a ' . $memoryLimit . ' PHP memory limit. However, a ' . TYPO3_REQUIREMENTS_RECOMMENDED_PHP_MEMORY_LIMIT . ' PHP memory limit or above is recommended, especially if your site uses additional extensions.';
+                       $severity = tx_reports_reports_status_Status::WARNING;
                }
 
-               return t3lib_div::makeInstance('tx_reports_reports_status_Status',
-                       'File Deny Pattern', $value, $message, $severity
-               );
-       }
-
-       /**
-        * Checks if fileDenyPattern allows to upload .htaccess files which is
-        * dangerous on Apache.
-        *
-        * @return      tx_reports_reports_status_Status        An tx_reports_reports_status_Status object representing whether it's possible to upload .htaccess files
-        */
-       protected function getHtaccessUploadStatus() {
-               $value    = $GLOBALS['LANG']->getLL('status_ok');
-               $message  = '';
-               $severity = tx_reports_reports_status_Status::OK;
-
-               if ($GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'] != FILE_DENY_PATTERN_DEFAULT && t3lib_div::verifyFilenameAgainstDenyPattern('.htaccess')) {
-                       $value    = $GLOBALS['LANG']->getLL('status_insecure');
+               if ($memoryLimit && t3lib_div::getBytesFromSizeMeasurement($memoryLimit) < t3lib_div::getBytesFromSizeMeasurement(TYPO3_REQUIREMENTS_MINIMUM_PHP_MEMORY_LIMIT)) {
+                       $message = 'Depending on your configuration, TYPO3 can run with a ' . $memoryLimit . ' PHP memory limit. However, a ' . TYPO3_REQUIREMENTS_MINIMUM_PHP_MEMORY_LIMIT . ' PHP memory limit or above is required, especially if your site uses additional extensions.';
                        $severity = tx_reports_reports_status_Status::ERROR;
-                       $message  = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.file_deny_htaccess');
                }
 
-               return t3lib_div::makeInstance('tx_reports_reports_status_Status',
-                       '.htaccess Upload Protection', $value, $message, $severity
-               );
-       }
-
-       /**
-        * Checks if there are still updates to perform
-        *
-        * @return      tx_reports_reports_status_Status        An tx_reports_reports_status_Status object representing whether the installation is not completely updated yet
-        */
-       protected function getRemainingUpdatesStatus() {
-               $value    = $GLOBALS['LANG']->getLL('status_updateComplete');
-               $message  = '';
-               $severity = tx_reports_reports_status_Status::OK;
-
-               if (!t3lib_div::compat_version(TYPO3_branch)) {
-                       $value    = $GLOBALS['LANG']->getLL('status_updateIncomplete');
-                       $severity = tx_reports_reports_status_Status::WARNING;
-
-                       $url = 'install/index.php?redirect_url=index.php'
-                               . urlencode('?TYPO3_INSTALL[type]=update');
-                       $message  = sprintf(
-                               $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.install_update'),
-                               '<a href="' . $url . '">',
-                               '</a>'
-                       );
+               if ($severity > tx_reports_reports_status_Status::OK) {
+                       if ($php_ini_path = get_cfg_var('cfg_file_path')) {
+                               $message .= ' Increase the memory limit by editing the memory_limit parameter in the file ' . $php_ini_path . ' and then restart your web server (or contact your system administrator or hosting provider for assistance).';
+                       } else {
+                               $message .= ' Contact your system administrator or hosting provider for assistance with increasing your PHP memory limit.';
+                       }
                }
 
                return t3lib_div::makeInstance('tx_reports_reports_status_Status',
-                       'Remaining Updates', $value, $message, $severity
+                       'PHP Memory Limit', $memoryLimit, $message, $severity
                );
        }
 
        /**
-        * Checks if sys_refindex is empty.
+        * checks whether register globals is on or off.
         *
-        * @return      tx_reports_reports_status_Status        An tx_reports_reports_status_Status object representing whether the reference index is empty or not
+        * @return      tx_reports_reports_status_Status        A status of whether register globals is on or off
         */
-       protected function getReferenceIndexStatus() {
-               $value    = $GLOBALS['LANG']->getLL('status_ok');
+       protected function getPhpRegisterGlobalsStatus() {
+               $value    = $GLOBALS['LANG']->getLL('status_disabled');
                $message  = '';
                $severity = tx_reports_reports_status_Status::OK;
 
-               $count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('*', 'sys_refindex');
-
-               if (!$count) {
-                       $value    = $GLOBALS['LANG']->getLL('status_empty');
-                       $severity = tx_reports_reports_status_Status::WARNING;
+               $registerGlobals = trim(ini_get('register_globals'));
 
-                       $url = 'sysext/lowlevel/dbint/index.php?&id=0&SET[function]=refindex';
-                       $message  = sprintf(
-                               $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.backend_reference'),
-                               '<a href="' . $url . '">',
-                               '</a>'
-                       );
+                       // can't reliably check for 'on', therefore checking for the oposite 'off', '', or 0
+               if (!empty($registerGlobals) && strtolower($registerGlobals) != 'off') {
+                       $message = '<em>register_globals</em> is enabled. TYPO3 requires this configuration directive to be disabled. Your site may not be secure when <em>register_globals</em> is enabled. The PHP manual has instructions for <a href="http://php.net/configuration.changes">how to change configuration settings</a>.';
+                       $severity = tx_reports_reports_status_Status::ERROR;
+                       $value = $GLOBALS['LANG']->getLL('status_enabled')
+                               . ' (\'' . $registerGlobals . '\')';
                }
 
                return t3lib_div::makeInstance('tx_reports_reports_status_Status',
-                       'Reference Index', $value, $message, $severity
+                       'PHP Register Globals', $value, $message, $severity
                );
        }
 
        /**
-        * Checks whether memcached is configured, if that's the case we asume it's also used.
-        *
-        * @return      boolean True if memcached is used, false otherwise.
-        */
-       protected function isMemcachedUsed() {
-               $memcachedUsed = false;
-
-               $memcachedServers = $this->getConfiguredMemcachedServers();
-               if (count($memcachedServers)) {
-                       $memcachedUsed = true;
-               }
-
-               return $memcachedUsed;
-       }
-
-       /**
-        * Gets the configured memcached server connections.
-        *
-        * @return      array   An array of configured memcached server connections.
-        */
-       protected function getConfiguredMemcachedServers() {
-               $memcachedServers = array();
-
-               if (is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'])) {
-                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'] as $table => $conf) {
-                               if (is_array($conf)) {
-                                       foreach ($conf as $key => $value) {
-                                               if (!is_array($value) && $value === 't3lib_cache_backend_MemcachedBackend') {
-                                                       $memcachedServers = $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$table]['options']['servers'];
-                                                       break;
-                                               }
-                                       }
-                               }
-                       }
-               }
-
-               return $memcachedServers;
-       }
-
-       /**
-        * Checks whether TYPO3 can connect to the configured memcached servers.
+        * Reports the webserver TYPO3 is running on.
         *
-        * @return      tx_reports_reports_status_Status        An tx_reports_reports_status_Status object representing whether TYPO3 can connect to the configured memcached servers
+        * @return      tx_reports_reports_status_Status        The server software as a status
         */
-       protected function getMemcachedConnectionStatus() {
-               $value    = $GLOBALS['LANG']->getLL('status_ok');
-               $message  = '';
-               $severity = tx_reports_reports_status_Status::OK;
-
-               $failedConnections    = array();
-               $defaultMemcachedPort = ini_get('memcache.default_port');
-               $memcachedServers     = $this->getConfiguredMemcachedServers();
-
-               if (function_exists('memcache_connect') && is_array($memcachedServers)) {
-                       foreach ($memcachedServers as $testServer) {
-                               $configuredServer = $testServer;
-                               if (substr($testServer, 0, 7) == 'unix://') {
-                                       $host = $testServer;
-                                       $port = 0;
-                               } else {
-                                       if (substr($testServer, 0, 6) === 'tcp://') {
-                                               $testServer = substr($testServer, 6);
-                                       }
-                                       if (strstr($testServer, ':') !== FALSE) {
-                                               list($host, $port) = explode(':', $testServer, 2);
-                                       } else {
-                                               $host = $testServer;
-                                               $port = $defaultPort;
-                                       }
-                               }
-                               $memcachedConnection = @memcache_connect($host, $port);
-                               if ($memcachedConnection != null) {
-                                       memcache_close($memcachedConnection);
-                               } else {
-                                       $failedConnections[] = $configuredServer;
-                               }
-                       }
-               }
-
-               if (count($failedConnections)) {
-                       $value    = $GLOBALS['LANG']->getLL('status_connectionFailed');
-                       $severity = tx_reports_reports_status_Status::WARNING;
-
-                       $message = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:warning.memcache_not_usable')
-                               . '<br /><br />'
-                               . '<ul><li>'
-                               . implode('</li><li>', $failedConnections)
-                               . '</li></ul>';
-               }
-
+       protected function getWebserverStatus() {
                return t3lib_div::makeInstance('tx_reports_reports_status_Status',
-                       'Memcached Configuration', $value, $message, $severity
+                       'Web Server',
+                       $_SERVER['SERVER_SOFTWARE']
                );
        }
 }